CEL_Payroll/Payroll.Service/Bonus/DA/ProdBonusParameterDA.cs

75 lines
2.2 KiB
C#
Raw 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
{
class ProdBonusParameterDA
{
#region Constructor
private ProdBonusParameterDA() { }
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, ProdBonusParameter item)
{
tc.ExecuteNonQuery("INSERT INTO ProdBonusParameter(ProdBonusParameterID,ProdBonusLineID, ProdBonusSetupID,ItemID,ItemType)" +
" VALUES(%n,%n, %n, %n,%n)", item.ID.Integer, item.ProdBonusLineID.Integer, item.ProdBonusSetupID.Integer, item.ItemID.Integer, (int)item.ItemType);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, ProdBonusParameter item)
{
tc.ExecuteNonQuery("UPDATE ProdBonusParameter SET ProdBonusSetupID=%n,ProdBonusLineID=%n, ProdBonusSetupID=%n,ItemID=%n,ItemType=%n" +
"WHERE ProdBonusParameterID=%n", item.ProdBonusSetupID.Integer,item.ProdBonusLineID.Integer, item.ItemID.Integer, (int)item.ItemType, item.ID.Integer);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM ProdBonusParameter");
}
internal static IDataReader Get(TransactionContext tc,int nSetupID)
{
return tc.ExecuteReader("SELECT * FROM ProdBonusParameter where ProdBonusSetupID=%n", nSetupID);
}
internal static IDataReader Get(TransactionContext tc, ID nID)
{
return tc.ExecuteReader("SELECT * FROM ProdBonusParameter WHERE ProdBonusParameterID=%n",nID.Integer );
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, ID nID)
{
tc.ExecuteNonQuery("DELETE FROM ProdBonusParameter WHERE ProdBonusParameterID=%n", nID.Integer);
}
#endregion
}
}