public static Decimal GetPartPaidAmount(Int32 ApDocumentId) { Decimal PaidAmount = 0m; TDBTransaction ReadTransaction = null; DBAccess.GDBAccessObj.BeginAutoReadTransaction(ref ReadTransaction, delegate { AApDocumentPaymentTable PreviousPayments = AApDocumentPaymentAccess.LoadViaAApDocument(ApDocumentId, ReadTransaction); foreach (AApDocumentPaymentRow PrevPaymentRow in PreviousPayments.Rows) { PaidAmount += PrevPaymentRow.Amount; } }); // End of BeginAutoReadTransaction return(PaidAmount); }
public static Decimal GetPartPaidAmount(Int32 ApDocumentId) { Decimal PaidAmount = 0m; TDBTransaction ReadTransaction = null; DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted, TEnforceIsolationLevel.eilMinimum, ref ReadTransaction, delegate { AApDocumentPaymentTable PreviousPayments = AApDocumentPaymentAccess.LoadViaAApDocument(ApDocumentId, ReadTransaction); foreach (AApDocumentPaymentRow PrevPaymentRow in PreviousPayments.Rows) { PaidAmount += PrevPaymentRow.Amount; } }); // End of BeginAutoReadTransaction return(PaidAmount); }
public static Decimal GetPartPaidAmount(Int32 ApDocumentId) { Decimal PaidAmount = 0m; TDBTransaction ReadTransaction = new TDBTransaction(); TDataBase db = DBAccess.Connect("GetPartPaidAmount"); db.ReadTransaction( ref ReadTransaction, delegate { AApDocumentPaymentTable PreviousPayments = AApDocumentPaymentAccess.LoadViaAApDocument(ApDocumentId, ReadTransaction); foreach (AApDocumentPaymentRow PrevPaymentRow in PreviousPayments.Rows) { PaidAmount += PrevPaymentRow.Amount; } }); // End of ReadTransaction return(PaidAmount); }