using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { internal class ProdBonusLineDA { #region Constructor private ProdBonusLineDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, ProdBonusLine item) { tc.ExecuteNonQuery( "INSERT INTO ProdBonusLine(ProdBonusLineID,LineName, ProdBonusSetupID, LineAchievedPercent,LineOTHour,ScheduledHour)" + " VALUES(%n,%s, %n, %n, %n,%n)", item.ID, item.LineName, item.ProdBonusSetupID, item.LineAchievedPercent, item.LineOTHour, item.ScheduledHour); } #endregion #region Update function internal static void Update(TransactionContext tc, ProdBonusLine item) { tc.ExecuteNonQuery( "UPDATE ProdBonusLine SET ProdBonusSetupID=%n, LineAchievedPercent=%n,LineOTHour=%n, LineName=%s,ScheduledHour=%n " + "WHERE ProdBonusLineID=%n", item.ProdBonusSetupID, item.LineAchievedPercent, item.LineOTHour, item.LineName, item.ScheduledHour, item.ID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM ProdBonusLine"); } internal static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("SELECT * FROM ProdBonusLine WHERE ProdBonusLineID=%n", nID); } internal static IDataReader GetProdBonusParameters(TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * FROM ProdBonusParameter WHERE ProdBonusLineID=%n", id); } internal static IDataReader GetProdBonusWorkSchedules(TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * FROM ProdBonusWorkSchedule WHERE ProdBonusLineID=%n", id); } internal static IDataReader GetProdBonusSupervisors(TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * FROM ProdBonusSupervisor WHERE ProdBonusLineID=%n", id); } internal static IDataReader GetLineBySetupId(TransactionContext tc, int prodSetupId) { return tc.ExecuteReader("SELECT * FROM ProdBonusLine WHERE ProdBonusSetupID=%n", prodSetupId); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("DELETE FROM ProdBonusLine WHERE ProdBonusLineID=%n", nID); } internal static void DeleteChiled(TransactionContext tc, int p) { throw new NotImplementedException(); } #endregion } }