75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
|
using HRM.BO;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using System;
|
|||
|
using System.Data;
|
|||
|
|
|||
|
|
|||
|
namespace HRM.DA
|
|||
|
{
|
|||
|
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, item.ProdBonusLineID, item.ProdBonusSetupID, item.ItemID,
|
|||
|
(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, item.ProdBonusLineID, item.ItemID,
|
|||
|
(int)item.ItemType, item.ID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Get Function
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM ProdBonusParameter");
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader GetBySetupId(TransactionContext tc, int nSetupID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM ProdBonusParameter where ProdBonusSetupID=%n", nSetupID);
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, int nID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM ProdBonusParameter WHERE ProdBonusParameterID=%n", nID);
|
|||
|
}
|
|||
|
internal static IDataReader GetByLineID(TransactionContext tc, int lineID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM ProdBonusParameter WHERE ProdBonusLineID=%n", lineID);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Delete function
|
|||
|
|
|||
|
internal static void Delete(TransactionContext tc, int nID)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("DELETE FROM ProdBonusParameter WHERE ProdBonusParameterID=%n", nID);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|