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

76 lines
1.9 KiB
C#

using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Data;
namespace HRM.DA
{
#region OTSlabDA
internal class OTSlabDA
{
#region Constructor
private OTSlabDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, OTSlab item)
{
tc.ExecuteNonQuery("INSERT INTO OTSlab(OTSlabID, hours, amount,TermID)" +
" VALUES(%n, %n, %n, %n)", item.ID, item.Hours, item.Amount, item.TermID);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, OTSlab item)
{
tc.ExecuteNonQuery("UPDATE OTSlab SET hours=%n, amount=%n,TermID=%n" +
" WHERE OTSlabID=%n", item.Hours, item.Amount, item.TermID, item.ID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM OTSlab Order By Hours");
}
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM OTSlab WHERE OTSlabID=%n Order By Hours", nID);
}
internal static IDataReader GetByTermID(TransactionContext tc, int nTermID)
{
return tc.ExecuteReader("SELECT * FROM OTSlab WHERE TermID=%n Order By Hours", nTermID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM OTSlab WHERE OTSlabID=%n", nID);
}
internal static void DeleteByTermID(TransactionContext tc, int nTermID)
{
tc.ExecuteNonQuery("DELETE FROM OTSlab WHERE TermID=%n", nTermID);
}
#endregion
}
#endregion
}