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 { #region TaxHeadAssignmentDA internal class TaxHeadAssignmentDA { #region Constructor private TaxHeadAssignmentDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, TaxHeadAssignment item) { tc.ExecuteNonQuery("INSERT INTO INCOMETAXHEAD(HeadID, description, deductPercent, CreatedBy, CreationDate, SequenceNo, Status)" + " VALUES(%n, %s, %n, %n, %d, %n, %n)", item.ID.Integer, item.Description, item.DeductPercent, item.CreatedBy.Integer,DataReader.GetNullValue(item.CreatedDate), item.Sequence, item.Status); } #endregion #region Update function internal static void Update(TransactionContext tc, TaxHeadAssignment item) { tc.ExecuteNonQuery("UPDATE INCOMETAXHEAD SET description=%s, deductPercent=%n, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" + " WHERE HeadID=%n", item.Description, item.DeductPercent, item.ModifiedBy.Integer, item.ModifiedDate, item.Sequence, item.Status, item.ID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM INCOMETAXHEAD"); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM INCOMETAXHEAD WHERE HeadID=%n", nID.Integer); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM [INCOMETAXHEAD] WHERE HeadID=%n", nID.Integer); } #endregion } #endregion }