EchoTex_Payroll/HRM.DA/DA/Attendance/AttnMobileRawDataDA.cs

52 lines
2.7 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00
using Ease.Core.DataAccess;
using HRM.BO;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HRM.DA
{
class AttnMobileRawDataDA
{
internal static IDataReader Get(TransactionContext tc, int id)
{
return tc.ExecuteReader(@"select * from AttnMobileRawData where AttnMobileRawDataID=%n", id);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader(@"select * from AttnMobileRawData");
}
internal static int Insert(TransactionContext tc, AttnMobileRawData attnMobileRawData)
{
tc.ExecuteNonQuery(@"Insert into AttnMobileRawData(AttnMobileRawDataID, AttnDate, EmpID, PunchTime,
Latitude, Longitude, IsSynced, InRemarks, OutRemarks,
PunchType, SyncRemarks, CreatedDate, CreatedBy) values(%n,%d,%n,%D,%n,%n,%b,%s,%s,%n,%s,%D,%n)",
attnMobileRawData.ID, attnMobileRawData.AttnDate, attnMobileRawData.EmpID, attnMobileRawData.PunchTime,
attnMobileRawData.Latitude, attnMobileRawData.Longitude, attnMobileRawData.IsSynced, attnMobileRawData.InRemarks, attnMobileRawData.OutRemarks,
attnMobileRawData.PunchType, attnMobileRawData.SyncRemarks, attnMobileRawData.CreatedDate, attnMobileRawData.CreatedBy);
return attnMobileRawData.ID;
}
internal static int Update(TransactionContext tc, AttnMobileRawData attnMobileRawData)
{
tc.ExecuteNonQuery(@"update AttnMobileRawData set AttnMobileRawDataID=%n, AttnDate=%d, EmpID=%n, PunchTime=%D, Latitude=%n, Longitude=%n, IsSynced=%b, InRemarks=%s, OutRemarks=%s,
PunchType=%n, SyncRemarks=%s, CreatedDate=%D, CreatedBy=%n",
attnMobileRawData.ID, attnMobileRawData.AttnDate, attnMobileRawData.EmpID, attnMobileRawData.PunchTime,
attnMobileRawData.Latitude, attnMobileRawData.Longitude, attnMobileRawData.IsSynced, attnMobileRawData.InRemarks, attnMobileRawData.OutRemarks, attnMobileRawData.PunchType,
attnMobileRawData.SyncRemarks, attnMobileRawData.CreatedDate, attnMobileRawData.CreatedBy);
return attnMobileRawData.ID;
}
internal static int Delete(TransactionContext tc, AttnMobileRawData attnMobileRawData)
{
tc.ExecuteNonQuery(@"delete from EMPMOBILE where AttnMobileRawDataID=%n", attnMobileRawData.ID);
return attnMobileRawData.ID;
}
}
}