CEL_Payroll/Payroll.Service/Loan/DA/LoanEmployeeDocDA.cs

86 lines
3.8 KiB
C#
Raw Normal View History

2024-09-17 14:30:13 +06:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.CoreV35.Model;
using System.Data.SqlClient;
using Ease.CoreV35.DataAccess;
using Payroll.BO;
using System.Data;
using Ease.CoreV35.DataAccess.SQL;
namespace Payroll.Service
{
#region LoanEmpDocDA
public class LoanEmployeeDocDA
{
#region Constructor
private LoanEmployeeDocDA() { }
#endregion
#region Get
internal static IDataReader Get(TransactionContext tc, ID id)
{
return tc.ExecuteReader("SELECT * FROM LoanEmpDoc WHERE LoanEmpDocID=%n", id.Integer);
}
internal static IDataReader GetbyIssueId(TransactionContext tc, ID issueID)
{
return tc.ExecuteReader("SELECT * FROM LoanEmpDoc WHERE LoanIssueID=%n", issueID.Integer);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM LoanEmpDoc");
}
#endregion
#region Insert
internal static void Insert(TransactionContext tc, LoanEmployeeDoc oLoanEmpDoc)
{
tc.ExecuteNonQuery("INSERT INTO LoanEmpDoc(LoanEmpDocID, HRDocID, LoanIssueID, employeeID," +
" HRID, HRReceivedDate, FileNo,SafeNo,HRRemarks,EmpReceiveDate,EmpReceiveRemarks," +
" CreatedBy, CreationDate)" +
" VALUES(%n, %n, %n, %n, %n, %d, %s,%s,%s,%d,%s,%n,%d)",
oLoanEmpDoc.ID.Integer, oLoanEmpDoc.HRDocID.Integer, oLoanEmpDoc.LoanIssueID.Integer,
oLoanEmpDoc.EmployeeID.Integer,DataReader.GetNullValue(oLoanEmpDoc.HRID, IDType.Integer),
DataReader.GetNullValue(oLoanEmpDoc.HRReceiveDate), DataReader.GetNullValue(oLoanEmpDoc.FileNo),
DataReader.GetNullValue(oLoanEmpDoc.SafeNo), DataReader.GetNullValue(oLoanEmpDoc.HRRemarks),
DataReader.GetNullValue(oLoanEmpDoc.EmpReceiveDate),DataReader.GetNullValue(oLoanEmpDoc.EmpReceiveRemarks),
DataReader.GetNullValue(oLoanEmpDoc.CreatedBy, IDType.Integer),
DataReader.GetNullValue(oLoanEmpDoc.CreatedDate));
}
#endregion
#region Update
internal static void Update(TransactionContext tc, LoanEmployeeDoc oLoanEmpDoc)
{
tc.ExecuteNonQuery("UPDATE LoanEmpDoc SET( [HRDocID]=%n,[LoanIssueID]=%n,[employeeID]=%n," +
" [HRID]=%n,[HRReceivedDate]=%d,[FileNo]=%s,[SafeNo]=%s,[HRRemarks]=%s,[EmpReceiveDate]=%d," +
" [EmpReceiveRemarks]=%s,[ModifiedBy]=%n,[ModifiedDate]=%d" +
" WHERE [LoanEmpDocID]=%n)",
oLoanEmpDoc.HRDocID.Integer, oLoanEmpDoc.LoanIssueID.Integer, oLoanEmpDoc.EmployeeID.Integer,
DataReader.GetNullValue(oLoanEmpDoc.HRID.Integer), DataReader.GetNullValue(oLoanEmpDoc.HRReceiveDate),
DataReader.GetNullValue(oLoanEmpDoc.FileNo), DataReader.GetNullValue(oLoanEmpDoc.SafeNo),
DataReader.GetNullValue(oLoanEmpDoc.HRRemarks), DataReader.GetNullValue(oLoanEmpDoc.EmpReceiveDate),
DataReader.GetNullValue(oLoanEmpDoc.EmpReceiveRemarks), DataReader.GetNullValue(oLoanEmpDoc.ModifiedBy.Integer),
DataReader.GetNullValue(oLoanEmpDoc.ModifiedDate), oLoanEmpDoc.ID.Integer);
}
#endregion
#region Delete
internal static void Delete(TransactionContext tc, ID id)
{
tc.ExecuteNonQuery("DELETE FROM [LoanEmpDoc] WHERE LoanEmpDocID=%n", id.Integer);
}
internal static void DeletebyIssueid(TransactionContext tc, ID id)
{
tc.ExecuteNonQuery("DELETE FROM LoanEmpDoc WHERE LoanIssueID=%n", id.Integer);
}
#endregion
}
#endregion
}