using System; using Ease.Core.Model; using Ease.Core.DataAccess; using HRM.BO; using Ease.Core.Utility; using System.Collections.Generic; using System.Data; namespace HRM.DA { #region TaxAdjustmentDA internal class TaxAdjustmentDA { #region Constructor private TaxAdjustmentDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, TaxAdjustment item) { tc.ExecuteNonQuery( "INSERT INTO TaxAdjustment(TaxAdjustmentID, name,TaxType,CreatedBy, CreationDate, SequenceNo,Status)" + " VALUES(%n, %s, %n, %n, %d, %n,%n)", item.ID, item.Name, item.TaxType, item.CreatedBy, item.CreatedDate, item.Sequence, item.Status); } #endregion #region Update function internal static void Update(TransactionContext tc, TaxAdjustment item) { tc.ExecuteNonQuery( "UPDATE TaxAdjustment SET name=%s, TaxType=%n, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" + " WHERE TaxAdjustmentID=%n", item.Name, item.TaxType, item.ModifiedBy, item.ModifiedDate, item.Sequence, item.Status, item.ID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM TaxAdjustment"); } internal static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("SELECT * FROM TaxAdjustment WHERE TaxAdjustmentID=%n", nID); } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { if (EnumStatus.Active == status || EnumStatus.Inactive == status) { return tc.ExecuteReader("SELECT * FROM TaxAdjustment Where Status=%n Order By SequenceNo", status); } else { return tc.ExecuteReader("SELECT * FROM TaxAdjustment Order By SequenceNo"); } } #endregion #region Delete function internal static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("DELETE FROM TaxAdjustment WHERE TaxAdjustmentID=%n", nID); } #endregion } #endregion }