94 lines
3.5 KiB
C#
94 lines
3.5 KiB
C#
|
using HRM.BO;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using System;
|
|||
|
using System.Data;
|
|||
|
|
|||
|
|
|||
|
namespace HRM.DA
|
|||
|
{
|
|||
|
#region LoanEmpDocDA
|
|||
|
|
|||
|
public class LoanEmployeeDocDA
|
|||
|
{
|
|||
|
#region Constructor
|
|||
|
|
|||
|
private LoanEmployeeDocDA()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Get
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, int id)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM LoanEmpDoc WHERE LoanEmpDocID=%n", id);
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader GetbyIssueId(TransactionContext tc, int issueID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM LoanEmpDoc WHERE LoanIssueID=%n", issueID);
|
|||
|
}
|
|||
|
|
|||
|
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, oLoanEmpDoc.HRDocID, oLoanEmpDoc.LoanIssueID,
|
|||
|
oLoanEmpDoc.EmployeeID, DataReader.GetNullValue(oLoanEmpDoc.HRID),
|
|||
|
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),
|
|||
|
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, oLoanEmpDoc.LoanIssueID, oLoanEmpDoc.EmployeeID,
|
|||
|
DataReader.GetNullValue(oLoanEmpDoc.HRID), 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),
|
|||
|
DataReader.GetNullValue(oLoanEmpDoc.ModifiedDate), oLoanEmpDoc.ID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Delete
|
|||
|
|
|||
|
internal static void Delete(TransactionContext tc, int id)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("DELETE FROM LoanEmpDoc WHERE LoanEmpDocID=%n", id);
|
|||
|
}
|
|||
|
|
|||
|
internal static void DeletebyIssueid(TransactionContext tc, int id)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("DELETE FROM LoanEmpDoc WHERE LoanIssueID=%n", id);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|