CEL_Payroll/Payroll.Service/PF/DA/PFExceptionDA.cs

70 lines
2.3 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using Payroll.BO;
using System.Data;
using System.Linq;
using Ease.CoreV35.Model;
using System.Data.SqlClient;
using Ease.CoreV35.DataAccess;
using System.Collections.Generic;
using Ease.CoreV35.DataAccess.SQL;
namespace Payroll.Service
{
#region PFExceptionDA
internal class PFExceptionDA
{
#region Constructor
private PFExceptionDA() { }
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, PFException item)
{
tc.ExecuteNonQuery("INSERT INTO PFException(PFExceptionID, EmployeeID, EPFPercent, CPFPercent, EPFAmount, CPFAmount, StartDate, CreatedBy, CreatedDate)" +
" VALUES(%n, %n, %n, %n, %n, %n, %d, %n, %d)", item.ID.Integer, item.EmployeeID.Integer,DataReader.GetNullValue(item.EPFPercent), DataReader.GetNullValue(item.CPFPercent), DataReader.GetNullValue(item.EPFAmount), DataReader.GetNullValue(item.CPFAmount), item.StartDate, item.CreatedBy.Integer, item.CreatedDate);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, PFException item)
{
tc.ExecuteNonQuery(@"UPDATE PFException SET EmployeeID=%n , EPFPercent=%n, CPFPercent=%n,
EPFAmount=%n,CPFAmount=%n, StartDate=%d,
ModifiedBy=%n,ModifiedDate = %d
WHERE PFExceptionID=%n", item.EmployeeID, DataReader.GetNullValue(item.EPFPercent),
DataReader.GetNullValue(item.CPFPercent), DataReader.GetNullValue(item.EPFAmount),
DataReader.GetNullValue(item.CPFAmount),item.StartDate,item.ModifiedBy,
item.ModifiedDate.Value,item.ID.Integer);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM PFException");
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, ID PFExceptionID)
{
tc.ExecuteNonQuery("DELETE FROM [PFException] WHERE PFExceptionID=%n", PFExceptionID.Integer);
}
#endregion
}
#endregion
}