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 { internal class ITEmpHeadDA { #region Constructor private ITEmpHeadDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, ITEmpHead item) { tc.ExecuteNonQuery( "INSERT INTO ITEMPHEAD(ITEMPHEADID, EMPLOYEEID, HEADID, STARTDATE, ENDDATE, HOUSERENT,CreatedBy, CreationDate,TaxparamID)" + " VALUES(%n, %n, %n, %d, %d, %n, %n, %d,%n)", item.ID, item.EmployeeID, item.HeadID, item.StartDate, item.EndDate, item.HouseRent, item.CreatedBy, DataReader.GetNullValue(item.CreatedDate), item.TaxparamID); } #endregion #region Update function internal static void Update(TransactionContext tc, ITEmpHead item) { tc.ExecuteNonQuery( "UPDATE ITEMPHEAD SET EMPLOYEEID=%n, HEADID=%n, STARTDATE=%d, ENDDATE=%d, HOUSERENT=%n, ModifiedBy=%n, ModifiedDate=%d,TaxparamID=%n" + " WHERE ITEMPHEADID=%n", item.EmployeeID, item.HeadID, item.StartDate, item.EndDate, item.HouseRent, item.ModifiedBy, item.ModifiedDate, item.TaxparamID, item.ID); } #endregion #region Get Function internal static IDataReader GetWithTaxParam(TransactionContext tc, int taxparamID) { return tc.ExecuteReader( "SELECT i.*, e.employeeNo,e.Name FROM ITEMPHEAD i,Employee e where i.EMPLOYEEID =e.EMPLOYEEID and i.TaxparamID=%n", taxparamID); } internal static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("SELECT * FROM ITEMPHEAD WHERE ITEMPHEADID=%n", nID); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ITEmpHead Item) { tc.ExecuteNonQuery("DELETE FROM ITEMPHEAD WHERE ITEMPHEADID=%n AND EmployeeID=%n AND TaxparamID=%n", Item.ID, Item.EmployeeID, Item.TaxparamID); } #endregion } }