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 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.Integer, item.ProdBonusSetupID.Integer,item.ProdBonusLineID.Integer, item.EmployeeID.Integer,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.Integer, item.ProdBonusLineID.Integer, item.EmployeeID.Integer, item.BonusPercent, item.Amount, item.ID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM ProdBonusSupervisor"); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM ProdBonusSupervisor WHERE ProdBonusSupervisorID=%n",nID.Integer ); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM ProdBonusSupervisor WHERE ProdBonusSupervisorID=%n", nID.Integer); } #endregion } }