internal static RetailAccountPaymentDto[] GetByRetailAcctId(Rbr_Db pDb, int pRetailAcctId) { var _list = new ArrayList(); RetailAccountPaymentRow[] _retailAccountPaymentRows = pDb.RetailAccountPaymentCollection.GetByRetail_acct_id(pRetailAcctId); foreach (RetailAccountPaymentRow _retailAccountPaymentRow in _retailAccountPaymentRows) { BalanceAdjustmentReasonDto _balanceAdjustmentReason = BalanceAdjustmentReasonManager.Get(pDb, _retailAccountPaymentRow.Balance_adjustment_reason_id); PersonDto _person = PersonManager.Get(pDb, _retailAccountPaymentRow.Person_id); _list.Add(mapToRetailAccountPayment(_retailAccountPaymentRow, _person, _balanceAdjustmentReason)); } if (_list.Count > 1) { _list.Sort(new GenericComparer(RetailAccountPaymentDto.DateTime_PropName, ListSortDirection.Descending)); } return((RetailAccountPaymentDto[])_list.ToArray(typeof(RetailAccountPaymentDto))); }
internal static CustomerAcctPaymentDto[] GetByPersonId(Rbr_Db pDb, int pPersonId) { var _list = new ArrayList(); var _customerAcctPaymentRows = pDb.CustomerAcctPaymentCollection.GetByPerson_id(pPersonId); foreach (var _customerAcctPaymentRow in _customerAcctPaymentRows) { var _balanceAdjustmentReason = BalanceAdjustmentReasonManager.Get(pDb, _customerAcctPaymentRow.Balance_adjustment_reason_id); var _person = PersonManager.Get(pDb, _customerAcctPaymentRow.Person_id); var _customerAcctRow = Get(pDb, _customerAcctPaymentRow.Customer_acct_id); _list.Add(mapToCustomerAcctPayment(_customerAcctPaymentRow, _customerAcctRow.Name, _person, _balanceAdjustmentReason)); } if (_list.Count > 1) { _list.Sort(new GenericComparer(CustomerAcctPaymentDto.DateTime_PropName, ListSortDirection.Descending)); } return((CustomerAcctPaymentDto[])_list.ToArray(typeof(CustomerAcctPaymentDto))); }