75 lines
2.4 KiB
C#
75 lines
2.4 KiB
C#
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 ITEmpHeadDA
|
|
|
|
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,IsArrear)" +
|
|
" VALUES(%n, %n, %n, %d, %d, %n, %n, %d,%n,%n)", item.ID.Integer, item.EmployeeID.Integer, item.HeadID, item.StartDate, item.EndDate,
|
|
item.HouseRent, item.CreatedBy.Integer, DataReader.GetNullValue(item.CreatedDate),item.TaxparamID.Integer,item.IsArrear);
|
|
}
|
|
|
|
#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,IsArrear=%n" +
|
|
" WHERE ITEMPHEADID=%n", item.EmployeeID.Integer, item.HeadID, item.StartDate, item.EndDate, item.HouseRent, item.ModifiedBy.Integer, item.ModifiedDate,item.TaxparamID.Integer,item.IsArrear, item.ID.Integer);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Get Function
|
|
|
|
internal static IDataReader Get(TransactionContext tc, int taxparamID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM ITEMPHEAD where TaxparamID=%n",taxparamID);
|
|
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, ID nID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM ITEMPHEAD WHERE ITEMPHEADID=%n", nID.Integer);
|
|
}
|
|
internal static IDataReader Get(TransactionContext tc, int nEmpID, int taxparamID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM ITEMPHEAD WHERE TaxparamID=%n and EMPLOYEEID=%n", taxparamID, nEmpID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Delete function
|
|
|
|
internal static void Delete(TransactionContext tc, ID nID)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM [ITEMPHEAD] WHERE ITEMPHEADID=%n", nID.Integer);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
#endregion
|
|
}
|