using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.DataAccess; using Payroll.BO; using System.Data; using Ease.CoreV35.Model; namespace Payroll.Service.Attendence.DA { #region AutoWorkPlanDA internal class AutoWorkPlanDA { #region Constructor private AutoWorkPlanDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, AutoWorkPlan item) { tc.ExecuteNonQuery("INSERT INTO AutoWorkPlan(AutoWorkPlanID, EmployeeID, ShiftID, StartDate, CreatedBy, CreatedDate)" + " VALUES(%n, %n, %n, %d, %n, %d)", item.ID.Integer, item.EmployeeID.Integer, item.ShiftID.Integer, item.StartDate, item.CreatedBy.Integer, item.CreatedDate); } #endregion #region Update function internal static void Update(TransactionContext tc, AutoWorkPlan item) { tc.ExecuteNonQuery("UPDATE AutoWorkPlan SET EmployeeID=%n, ShiftID=%n, StartDate=%d, ModifiedBy=%n, ModifiedDate=%d" + " WHERE AutoWorkPlanID=%n", item.EmployeeID.Integer, item.ShiftID.Integer, item.StartDate, item.ModifiedBy.Integer, item.ModifiedDate, item.ID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM AutoWorkPlan"); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM AutoWorkPlan WHERE AutoWorkPlanID=%n", nID); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM [AutoWorkPlan] WHERE AutoWorkPlanID=%n", nID); } #endregion } #endregion }