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 { 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.Integer, item.LineName, item.ProdBonusSetupID.Integer,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.Integer, item.LineAchievedPercent, item.LineOTHour, item.LineName, item.ScheduledHour , item.ID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM ProdBonusLine"); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM ProdBonusLine WHERE ProdBonusLineID=%n",nID.Integer ); } internal static IDataReader GetProdBonusParameters(TransactionContext tc, ID id) { return tc.ExecuteReader("SELECT * FROM ProdBonusParameter WHERE ProdBonusLineID=%n", id.Integer); } internal static IDataReader GetProdBonusWorkSchedules(TransactionContext tc, ID id) { return tc.ExecuteReader("SELECT * FROM ProdBonusWorkSchedule WHERE ProdBonusLineID=%n", id.Integer); } internal static IDataReader GetProdBonusSupervisors(TransactionContext tc, ID id) { return tc.ExecuteReader("SELECT * FROM ProdBonusSupervisor WHERE ProdBonusLineID=%n", id.Integer); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM ProdBonusLine WHERE ProdBonusLineID=%n", nID.Integer); } #endregion internal static void DeleteChiled(TransactionContext tc, int p) { throw new NotImplementedException(); } } }