using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using Ease.CoreV35.DataAccess; using Ease.CoreV35.Model; using Payroll.BO; namespace Payroll.Service { internal class EmployeeConfirmationDA { #region Get internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM EmpConfirmation where EmpConfirmID=%n",nID.Integer); } internal static IDataReader GetByEmployeeID(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM EmpConfirmation where EmployeeID=%n", nID.Integer); } internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM EmpConfirmation"); } internal static void DeleteByEmployeeID(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("Delete FROM EmpConfirmation where EmployeeID=%n",nID.Integer); } #endregion #region Insert & Update internal static void Insert(TransactionContext tc, EmployeeConfirmation item) { string sSQL = SQLParser.MakeSQL("INSERT INTO EmpConfirmation(EmpConfirmID, EmployeeID, Month, ConfirmDate, CreatedBy,CreationDate)" + " VALUES(%n, %n, %n, %d , %n, %d)", item.ID.Integer, item.EmployeeID.Integer, item.Month, item.ConfirmDate,DataReader.GetNullValue(item.CreatedBy.Integer), DataReader.GetNullValue(item.CreatedDate)); tc.ExecuteNonQuery(sSQL); } internal static void Update(TransactionContext tc, EmployeeConfirmation item) { string sSQL = SQLParser.MakeSQL("UPDATE EmpConfirmation SET EmployeeID=%n, Month=%n, ConfirmDate=%d, ModifiedBy=%n, ModifiedDate=%d" + " WHERE EmpConfirmID=%n", item.EmployeeID.Integer, item.Month, item.ConfirmDate, DataReader.GetNullValue(item.ModifiedBy.Integer), DataReader.GetNullValue(item.ModifiedDate), item.ID.Integer); tc.ExecuteNonQuery(sSQL); } #endregion #region Delete internal static void Delete(TransactionContext tc, ID id) { tc.ExecuteNonQuery("Delete FROM EmpConfirmation where EmpConfirmID=%n", id.Integer); } #endregion } }