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; using Payroll.BO; namespace Payroll.Service.Attendence.DA { #region ShiftRotationDA internal class ShiftRotationDA { #region Constructor private ShiftRotationDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, ShiftRotation item) { tc.ExecuteNonQuery("INSERT INTO ShiftRotation(ShiftRotationID, ShiftID, CreatedBy, CreatedDate, SequenceNo, Status, workGroupType)" + " VALUES(%n, %n, %n, %d, %n, %n, %n)", item.ID.Integer, item.ShiftID.Integer, item.CreatedBy.Integer, item.CreatedDate, item.Sequence, item.Status, item.WorkPlanType); } #endregion #region Update function internal static void Update(TransactionContext tc, ShiftRotation item) { tc.ExecuteNonQuery("UPDATE ShiftRotation SET ShiftID=%n, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n, workGroupType=%n" + " WHERE ShiftRotationID=%n", item.ShiftID.Integer, item.ModifiedBy.Integer, item.ModifiedDate, item.Sequence, item.Status, item.WorkPlanType, item.ID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc, EnumWorkPlanGroup workGroup) { return tc.ExecuteReader("SELECT * FROM ShiftRotation where workGroupType=%n Order by SequenceNo", workGroup); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM ShiftRotation WHERE ShiftRotationID=%n", nID.Integer); } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { if (EnumStatus.Active == status) { return tc.ExecuteReader("SELECT * FROM ShiftRotation where Status=%n Order By SequenceNo", status); } else { return tc.ExecuteReader("SELECT * FROM ShiftRotation Order By SequenceNo"); } } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM [ShiftRotation] WHERE ShiftRotationID=%n", nID.Integer); } #endregion } #endregion }