using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.Model; using Ease.CoreV35.DataAccess; using Payroll.BO; using System.Data; namespace Payroll.Service { class EmpFieldTrackDA { internal static IDataReader Get(TransactionContext tc, ID id) { return tc.ExecuteReader(@"select * from EMPFIELDTRACK where EmpFieldTrackID=%n", id.Integer); } internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader(@"select * from EMPFIELDTRACK"); } internal static ID Insert(TransactionContext tc, EmpFieldTrack empTrack) { tc.ExecuteNonQuery(@"insert into EMPFIELDTRACK(EmpFieldTrackID,EmployeeID,IMENO,NearLocation,Client,Remarks,Zipcode,Latitude,Longitude,TranDateTime) values(%n,%n,%s,%s,%s,%s,%s,%n,%n,%D)", empTrack.ID.Integer, empTrack.EmployeeID.Integer,empTrack.IMENumber, empTrack.NearLocation, empTrack.Client, empTrack.Remarks,empTrack.Zipcode,empTrack.Longitude,empTrack.Longitude,empTrack.TranDateTime); return empTrack.ID; } internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery(@"delete from EMPFIELDTRACK where EmpFieldTrackID=%n", nID.Integer); } internal static ID Update(TransactionContext tc, EmpFieldTrack empTrack) { tc.ExecuteNonQuery(@"update EMPFIELDTRACK set EmployeeID=%n,IMENO=%s,NearLocation=%s,Client=%s,Remarks=%s,Zipcode=%s,Latitude=%n,Longitude=%n,TranDateTime=%D where EmpFieldTrackID=%n ", empTrack.EmployeeID.Integer, empTrack.IMENumber, empTrack.NearLocation, empTrack.Client, empTrack.Remarks, empTrack.Zipcode,empTrack.Longitude,empTrack.Longitude,empTrack.TranDateTime, empTrack.ID.Integer); return empTrack.ID; } } }