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 ProdBonusWorkScheduleDA { #region Constructor private ProdBonusWorkScheduleDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, ProdBonusWorkSchedule item) { tc.ExecuteNonQuery("INSERT INTO ProdBonusWorkSchedule(ProdBonusWorkScheduleID, ProdBonusSetupID,ProdBonusLineID,StartDateTime)" + " VALUES(%n, %n,%n, %D)", item.ID.Integer, item.ProdBonusSetupID.Integer, item.ProdBonusLineID.Integer,item.StartDateTime); } #endregion #region Update function internal static void Update(TransactionContext tc, ProdBonusWorkSchedule item) { tc.ExecuteNonQuery("UPDATE ProdBonusWorkSchedule SET ProdBonusSetupID=%n,ProdBonusLineID=%n, StartDateTime=%D" + "WHERE ProdBonusWorkScheduleID=%n", item.ProdBonusSetupID.Integer,item.ProdBonusLineID.Integer, item.StartDateTime, item.ID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM ProdBonusWorkSchedule"); } internal static IDataReader Get(TransactionContext tc,int nSetupID) { return tc.ExecuteReader("SELECT * FROM ProdBonusWorkSchedule where ProdBonusSetupID=%n", nSetupID); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM ProdBonusWorkSchedule WHERE ProdBonusWorkScheduleID=%n",nID.Integer ); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM ProdBonusWorkSchedule WHERE ProdBonusWorkScheduleID=%n", nID.Integer); } #endregion } }