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

70 lines
3.0 KiB
C#
Raw Permalink 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 LoanSettlementDA
public class LoanSettlementDA
{
#region Constructor
private LoanSettlementDA() { }
#endregion
#region Get
internal static IDataReader Get(TransactionContext tc, ID id)
{
return tc.ExecuteReader("SELECT * FROM LoanSettlement WHERE LoanSettlementID=%n", id.Integer);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM LoanSettlement");
}
#endregion
#region Insert
internal static void Insert(TransactionContext tc, LoanSettlement oLoanSettlement)
{
tc.ExecuteNonQuery("INSERT INTO LoanSettlement(LoanSettlementID, LoanIssueID, WFStatus," +
" BankID, BranchID, ChequeNo,AccountNo,SubmitDate,Remarks," +
" CreatedBy, CreationDate)" +
" VALUES(%n, %n, %n, %n, %n,%s,%s,%d,%s,%n,%d)",
oLoanSettlement.ID.Integer, oLoanSettlement.LoanIssueID.Integer,
oLoanSettlement.WFStatus,oLoanSettlement.BankID.Integer,oLoanSettlement.BranchID.Integer,
oLoanSettlement.ChequeNo, oLoanSettlement.AccountNo,oLoanSettlement.SubmitDate,
oLoanSettlement.Remarks, DataReader.GetNullValue(oLoanSettlement.CreatedBy.Integer),
DataReader.GetNullValue(oLoanSettlement.CreatedDate));
}
#endregion
#region Update
internal static void Update(TransactionContext tc, LoanSettlement oLoanSettlement)
{
tc.ExecuteNonQuery("UPDATE LoanSettlement SET( [LoanIssueID]=%n,[WFStatus]=%n,[BankID]=%n," +
" [BranchID]=%n,[ChequeNo]=%s,[AccountNo]=%s,[SubmitDate]=%d,[Remarks]=%s,"+
" [ModifiedBy]=%n,[ModifiedDate]=%d WHERE [LoanSettlementID]=%n)" +
oLoanSettlement.LoanIssueID.Integer, oLoanSettlement.WFStatus, oLoanSettlement.BankID.Integer,
oLoanSettlement.BranchID.Integer,oLoanSettlement.ChequeNo,oLoanSettlement.AccountNo,
oLoanSettlement.SubmitDate,oLoanSettlement.Remarks,
DataReader.GetNullValue(oLoanSettlement.ModifiedBy.Integer),
DataReader.GetNullValue(oLoanSettlement.ModifiedDate), oLoanSettlement.ID.Integer);
}
#endregion
#region Delete
internal static void Delete(TransactionContext tc, ID id)
{
tc.ExecuteNonQuery("DELETE FROM [LoanSettlement] WHERE LoanSettlementID=%n", id.Integer);
}
#endregion
}
#endregion
}