using HRM.BO; using Ease.Core.DataAccess; using System.Data; namespace HRM.DA { internal class FestivalBonusProjectionDA { #region Constructor private FestivalBonusProjectionDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, FestivalBonusProjection item) { tc.ExecuteNonQuery( "INSERT INTO FestivalBonusProjection(FestivalBonusProjectionID, basicmonth, noofbasic, CreatedBy, CreationDate, SequenceNo, Status)" + " VALUES(%n, %n, %n, %n, %d, %n, %n)", item.ID, (int)item.BasicMonth, item.NoofBasic, DataReader.GetNullValue(item.CreatedBy), DataReader.GetNullValue(item.CreatedDate), item.Sequence, item.Status); } #endregion #region Update function internal static void Update(TransactionContext tc, FestivalBonusProjection item) { tc.ExecuteNonQuery( "UPDATE FestivalBonusProjection SET basicmonth=%n, noofbasic=%n, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" + " WHERE FestivalBonusProjectionID=%n", (int)item.BasicMonth, item.NoofBasic, DataReader.GetNullValue(item.ModifiedBy), DataReader.GetNullValue(item.ModifiedDate), item.Sequence, item.Status, item.ID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc, EnumStatus status) { if (EnumStatus.Active == status || EnumStatus.Inactive == status) { return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection Where Status=%n Order By SequenceNo", status); } else { return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection Order By SequenceNo"); } } internal static IDataReader Get(TransactionContext tc, int ID) { return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection WHERE FestivalBonusProjectionID=%n", ID); } internal static IDataReader Get(TransactionContext tc, EnumMonths dBasicMonth) { return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection WHERE basicmonth=%n", (int)dBasicMonth); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int ID) { tc.ExecuteNonQuery("DELETE FROM FestivalBonusProjection WHERE FestivalBonusProjectionID=%n", ID); } #endregion } }