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 TaxChallanDA internal class TaxChallanDA { #region Constructor private TaxChallanDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, TaxChallan item) { tc.ExecuteNonQuery("INSERT INTO TaxChallan(ChallenID, salaryMonthly, employeeID, taxParamID, challenNo, Amount, depositDate, CreatedBy, CreationDate)" + " VALUES(%n, %d, %n, %n, %s, %n, %d, %n, %d)", item.ID.Integer, item.SalaryMonthly, item.EmployeeID.Integer, item.TaxParameterID.Integer, item.ChallanNo, item.Amount, item.DepositDate, item.CreatedBy.Integer, item.CreatedDate); } #endregion #region Update function internal static void Update(TransactionContext tc, TaxChallan item) { tc.ExecuteNonQuery("UPDATE TaxChallan SET salaryMonthly=%d, employeeID=%n, taxParamID=%n, challanNo=%s, amount=%n, depositDate=%n, ModifiedBy=%n, ModifiedDate=%d" + " WHERE ChallanID=%n", item.SalaryMonthly, item.EmployeeID.Integer, item.TaxParameterID.Integer, item.ChallanNo, item.Amount, item.DepositDate, item.ModifiedBy.Integer, item.ModifiedDate, item.ID.Integer); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM TaxChallan"); } internal static IDataReader GetOldTaxChallan(TransactionContext tc, ID nEmpID, ID nTaxParamID) { return tc.ExecuteReader("Select * from GP_TaxChallan where EMPLOYEEID=%n AND TAXPARAMID=%n", nEmpID.Integer, nTaxParamID.Integer); } internal static IDataReader Get(TransactionContext tc, ID nEmpID, ID nTaxParamID) { return tc.ExecuteReader("Select * from TaxChallan where EMPLOYEEID=%n AND TAXPARAMID=%n", nEmpID.Integer, nTaxParamID.Integer); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM TaxChallan WHERE ChallanID=%n", nID); } internal static DataSet GetChalaCountByTaxParamID(TransactionContext tc, int nTaxParamID) { string strSQLQuery = SQLParser.MakeSQL("select Salarymonthly,Challenno,count(employeeid) TotalEmployee from TAXCHALLAN where Taxparamid=%n group by Salarymonthly,Challenno order by Salarymonthly,Challenno", nTaxParamID); return tc.ExecuteDataSet(strSQLQuery); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM [TaxChallan] WHERE ChallanID=%n", nID); } internal static void DeleteAllByTaxparamID(TransactionContext tc, int nTaxparamID) { tc.ExecuteNonQuery("DELETE FROM [TaxChallan] WHERE taxParamID=%n", nTaxparamID); } internal static void DeleteByEmpIDandChallanNo(TransactionContext tc, int nEmpid,string sChallanNo) { tc.ExecuteNonQuery("DELETE FROM [TaxChallan] WHERE employeeid=%n AND Challenno=%s", nEmpid, sChallanNo); } #endregion } #endregion }