EchoTex_Payroll/HRM.DA/DA/Attendance/AttendanceWFHistoryDA.cs
2024-10-14 10:01:49 +06:00

45 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;
using HRM.BO;
using Ease.Core.DataAccess;
namespace HRM.DA
{
internal class AttendanceWFHistoryDA
{
internal static void Insert(TransactionContext tc, AttendanceWFHistory oAttendanceWFHistory)
{
tc.ExecuteNonQuery(@"INSERT INTO ATTNWFHISTORY
(AttnWFHistoryID,DAILYATTNPROCESSID,EmployeeID,WFStatus,OTHOUR,Remarks,AttnStatus)
VALUES(%n,%n,%n,%n,%n,%s,%n)",
oAttendanceWFHistory.ID, oAttendanceWFHistory.DailyAttnProcessID, oAttendanceWFHistory.EmployeeID,
(int)oAttendanceWFHistory.WFStatus, oAttendanceWFHistory.OTHour, oAttendanceWFHistory.Remarks,
(int)oAttendanceWFHistory.AttandanceStatus);
}
internal static void Update(TransactionContext tc, AttendanceWFHistory oAttendanceWFHistory)
{
tc.ExecuteNonQuery(
@"UPDATE ATTNWFHISTORY SET DAILYATTNPROCESSID=%n, EmployeeID=%n, WFStatus=%n, OTHOUR=%n, Remarks=%s, AttnStatus=%n
WHERE AttnWFHistoryID=%n", oAttendanceWFHistory.DailyAttnProcessID,
oAttendanceWFHistory.EmployeeID,
(int)oAttendanceWFHistory.WFStatus, oAttendanceWFHistory.OTHour, oAttendanceWFHistory.Remarks,
(int)oAttendanceWFHistory.AttandanceStatus, oAttendanceWFHistory.ID);
}
internal static void Delete(TransactionContext tc, int id)
{
tc.ExecuteNonQuery("DELETE FROM ATTNWFHISTORY WHERE AttnWFHistoryID=%n", id);
}
internal static IDataReader Get(TransactionContext tc, int id)
{
return tc.ExecuteReader("SELECT * FROM ATTNWFHISTORY WHERE AttnWFHistoryID=%n", id);
}
}
}