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 PFinterestProvisionDA internal class PFinterestProvisionDA { #region Constructor private PFinterestProvisionDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, PFinterestProvision item) { tc.ExecuteNonQuery("INSERT INTO PFINTPROVISION(employeeID, processedMonthDate, pFamount, cPFAmount, pFIntProvision, cPFIntProvision, pending, CreatedBy, CreationDate)" + " VALUES(%n, %d, %n, %n, %n, %n, %b, %n, %d)", item.EmployeeID.Integer, item.ProcessedMonthDate, item.PFamount, item.CPFAmount, item.PFIntProvision, item.CPFIntProvision, item.Pending, item.CreatedBy.Integer, item.CreatedDate); } #endregion #region Update function internal static void Update(TransactionContext tc, PFinterestProvision item) { tc.ExecuteNonQuery("UPDATE PFINTPROVISION SET processedMonthDate=%d, pFamount=%n, cPFAmount=%n, pFIntProvision=%n, cPFIntProvision=%n, pending=%b, ModifiedBy=%n, ModifiedDate=%d" + " WHERE employeeID=%n", item.ProcessedMonthDate, item.PFamount, item.CPFAmount, item.PFIntProvision, item.CPFIntProvision, item.Pending, item.ModifiedBy.Integer, item.ModifiedDate,item.EmployeeID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM PFINTPROVISION"); } internal static IDataReader Get(TransactionContext tc, ID nEmpID) { return tc.ExecuteReader("SELECT * FROM PFINTPROVISION WHERE employeeID=%n", nEmpID.Integer); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM [PFINTPROVISION] WHERE PFinterestProvisionID=%n", nID); } #endregion } #endregion }