using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { internal class ProdBonusSupervisorDA { #region Constructor private ProdBonusSupervisorDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, ProdBonusSupervisor item) { tc.ExecuteNonQuery( "INSERT INTO ProdBonusSupervisor(ProdBonusSupervisorID, ProdBonusSetupID,ProdBonusLineID, EmployeeID,BonusPercent,Amount)" + " VALUES(%n, %n, %n,%n,%n,%n)", item.ID, item.ProdBonusSetupID, item.ProdBonusLineID, item.EmployeeID, item.BonusPercent, item.Amount); } #endregion #region Update function internal static void Update(TransactionContext tc, ProdBonusSupervisor item) { tc.ExecuteNonQuery( "UPDATE ProdBonusSupervisor SET ProdBonusSetupID=%n, EmployeeID=%n,EmployeeID=%n,ProdBonusLineID=%n,BonusPercent=%n,Amount=%n" + "WHERE ProdBonusSupervisorID=%n", item.ProdBonusSetupID, item.ProdBonusLineID, item.EmployeeID, item.BonusPercent, item.Amount, item.ID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM ProdBonusSupervisor"); } internal static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("SELECT * FROM ProdBonusSupervisor WHERE ProdBonusSupervisorID=%n", nID); } internal static IDataReader GetByLineID(TransactionContext tc, int nID) { return tc.ExecuteReader("SELECT * FROM ProdBonusSupervisor WHERE ProdBonusLineID=%n", nID); } internal static IDataReader GetBySetupLineIDByInSQL(TransactionContext tc, string supteid) { return tc.ExecuteReader("SELECT pt.* FROM ProdBonusSupervisor pt Inner join " + " ProductionBonusSetup ps on ps.ProductionBonusSetupID =pt.ProdBonusSetupID" + " where ps.ProductionBonusSetupID IN (%q) ", supteid); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("DELETE FROM ProdBonusSupervisor WHERE ProdBonusSupervisorID=%n", nID); } #endregion } }