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