CEL_Payroll/Payroll.Service/OverTime/DA/OTSlabDA.cs

80 lines
2.1 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 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.Integer,item.Hours, item.Amount,item.TermID.Integer);
}
#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.Integer);
}
#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, ID nID)
{
return tc.ExecuteReader("SELECT * FROM OTSlab WHERE OTSlabID=%n Order By Hours", nID.Integer);
}
internal static IDataReader GetByTermID(TransactionContext tc, ID nTermID)
{
return tc.ExecuteReader("SELECT * FROM OTSlab WHERE TermID=%n Order By Hours", nTermID.Integer);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, ID nID)
{
tc.ExecuteNonQuery("DELETE FROM [OTSlab] WHERE OTSlabID=%n", nID.Integer);
}
internal static void DeleteByTermID(TransactionContext tc, ID nTermID)
{
tc.ExecuteNonQuery("DELETE FROM [OTSlab] WHERE TermID=%n", nTermID.Integer);
}
#endregion
}
#endregion
}