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