76 lines
2.5 KiB
C#
76 lines
2.5 KiB
C#
|
using HRM.BO;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using System;
|
|||
|
using System.Data;
|
|||
|
|
|||
|
namespace HRM.DA.Fund
|
|||
|
{
|
|||
|
internal class WPPFSettlementDA
|
|||
|
{
|
|||
|
#region Insert function
|
|||
|
|
|||
|
internal static void Insert(TransactionContext tc, WPPFSettlement oItem)
|
|||
|
{
|
|||
|
string sql = SQLParser.MakeSQL(@"INSERT INTO WPPFSettlement
|
|||
|
(WPPFSettlementID, MemberID, SettlementDate,
|
|||
|
WPPFAmount, WPPFInterest, GLTranID, GLTranInterestID,
|
|||
|
CreatedDate,CreatedBy)
|
|||
|
VALUES(%n,%n, %d,
|
|||
|
%n,%n, %n, %n,%d,
|
|||
|
%n)",
|
|||
|
oItem.ID, oItem.MemberID, oItem.SettlementDate,
|
|||
|
oItem.WPPFAmount, oItem.WPPFInterest, oItem.GLTranID, oItem.GLTranInterestID, oItem.CreatedDate,
|
|||
|
oItem.CreatedBy);
|
|||
|
tc.ExecuteNonQuery(sql);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Update function
|
|||
|
|
|||
|
internal static void Update(TransactionContext tc, WPPFSettlement oItem)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery(
|
|||
|
"UPDATE WPPFSettlement SET MemberID=%n, SettlementDate=%d, WPPFAmount=%n, WPPFInterest=%n, GLTranID=%n, GLTranInterestID=%n, ModifiedDate=%d, ModifiedBy=%n" +
|
|||
|
" WHERE WPPFSettlementID=%n", oItem.MemberID, oItem.SettlementDate, oItem.WPPFAmount,
|
|||
|
oItem.WPPFInterest, oItem.GLTranID, oItem.GLTranInterestID, oItem.ModifiedDate, oItem.ModifiedBy,
|
|||
|
oItem.ID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region int Generation function
|
|||
|
|
|||
|
internal static int GetNewID(TransactionContext tc)
|
|||
|
{
|
|||
|
return tc.GenerateID("WPPFSettlement", "WPPFSettlementID");
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Get Function
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM WPPFSettlement");
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, int nFinalSettlementID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM WPPFSettlement WHERE WPPFSettlementID=%n", nFinalSettlementID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, string sSql)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM WPPFSettlement %q order by SettlementDate", sSql);
|
|||
|
}
|
|||
|
|
|||
|
internal static void Delete(TransactionContext tc, int settlementID)
|
|||
|
{
|
|||
|
string sUpdate = SQLParser.MakeSQL("Delete WPPFSettlement where WPPFSettlementID = %n", settlementID);
|
|||
|
tc.ExecuteNonQuery(sUpdate);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|