CEL_Payroll/Payroll.Service/Leave/DA/UploadEncashAmountDA.cs

65 lines
2.4 KiB
C#
Raw Normal View History

2024-09-17 14:30:13 +06:00
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 UploadEncashAmount
public class UploadEncashAmountDA
{
#region Constructor
public UploadEncashAmountDA() { }
#endregion
#region InsertFunction
internal static void Insert(TransactionContext tc, UploadEncashAmount oUploadEncashAmount)
{
string sSql = SQLParser.MakeSQL("INSERT INTO UploadEncashAmount(UploadEncashAmountID, EMPLOYEEID, LeaveId,LeaveYear, Days,BasicSalary)" +
" VALUES(%n,%n,%n,%n,%n,%n)",
oUploadEncashAmount.ID.Integer, oUploadEncashAmount.EmployeeID.Integer, oUploadEncashAmount.LeaveID.Integer, oUploadEncashAmount.LeaveYear,
oUploadEncashAmount.Days, oUploadEncashAmount.BasicSalary);
tc.ExecuteNonQuery(sSql);
}
#endregion
#region Update Function
internal static void Update(TransactionContext tc, UploadEncashAmount oUploadEncashAmount)
{
tc.ExecuteNonQuery("UPDATE UploadEncashAmount SET [EMPLOYEEID]=%n,[LeaveId]=%n,[LeaveYear]=%n,[Days]=%n,[BasicSalary]=%n where UploadEncashAmountID=%n",
oUploadEncashAmount.EmployeeID.Integer, oUploadEncashAmount.LeaveID.Integer, oUploadEncashAmount.LeaveYear,
oUploadEncashAmount.Days, oUploadEncashAmount.BasicSalary, oUploadEncashAmount.ID.Integer);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, ID empID)
{
return tc.ExecuteReader("SELECT * from UploadEncashAmount WHERE EMPLOYEEID=%n order by LeaveYear", empID.Integer);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * from UploadEncashAmount order by EMPLOYEEID,LeaveYear");
}
#endregion
#region Delete Function
internal static void Delete(int id, TransactionContext tc)
{
tc.ExecuteNonQuery("DELETE FROM [UploadEncashAmount] WHERE UploadEncashAmountID=%n", id);
}
#endregion
}
#endregion
}