EchoTex_Payroll/HRM.DA/DA/Basic/ProcessItemDA.cs

73 lines
2.0 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00
using Ease.Core.DataAccess;
using System.Data;
using HRM.BO;
namespace HRM.DA
{
#region ProcessItemDA
internal class ProcessItemDA
{
#region Constructor
private ProcessItemDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, ProcessItem item)
{
tc.ExecuteNonQuery(
"INSERT INTO ProcessItem(ProcessItemID, itemCode, defaultDescription, userDescription, position, itemGroup)" +
" VALUES(%n, %n, %s, %s, %n, %n)", item.ID, item.ItemCode, item.DefaultDescription,
item.UserDescription, item.Position, item.ItemGroup);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, ProcessItem item)
{
tc.ExecuteNonQuery(
"UPDATE ProcessItem SET itemCode=%n, defaultDescription=%s, userDescription=%s, position=%n, itemGroup=%n" +
" WHERE ProcessItemID=%n", item.ItemCode, item.DefaultDescription, item.UserDescription, item.Position,
item.ItemGroup, item.ID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM ProcessItem");
}
internal static IDataReader GetForTHeadGroup(TransactionContext tc)
{
return tc.ExecuteReader("Select * from ProcessItem where ItemGroup >=6 order by ItemGroup,userDescription");
}
internal static IDataReader Get(TransactionContext tc, int ID)
{
return tc.ExecuteReader("SELECT * FROM ProcessItem WHERE ProcessItemID=%n", ID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int ID)
{
tc.ExecuteNonQuery("DELETE FROM ProcessItem WHERE ProcessItemID=%n", ID);
}
#endregion
}
#endregion
}