Exemple #1
0
        static BalanceAdjustmentReasonRow mapToBalanceAdjustmentReasonRow(BalanceAdjustmentReasonDto pBalanceAdjustmentReason)
        {
            if (pBalanceAdjustmentReason == null)
            {
                return(null);
            }
            var _balanceAdjustmentReasonRow = new BalanceAdjustmentReasonRow();

            _balanceAdjustmentReasonRow.Balance_adjustment_reason_id = pBalanceAdjustmentReason.BalanceAdjustmentReasonId;
            _balanceAdjustmentReasonRow.Description = pBalanceAdjustmentReason.Description;
            _balanceAdjustmentReasonRow.BalanceAdjustmentReasonType = pBalanceAdjustmentReason.BalanceAdjustmentReasonType;

            return(_balanceAdjustmentReasonRow);
        }
Exemple #2
0
        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)));
        }
Exemple #3
0
        internal static void Save(Rbr_Db pDb, BalanceAdjustmentReasonDto pBalanceAdjustmentReason)
        {
            var _balanceAdjustmentReasonRow = mapToBalanceAdjustmentReasonRow(pBalanceAdjustmentReason);

            if (_balanceAdjustmentReasonRow != null)
            {
                if (_balanceAdjustmentReasonRow.Balance_adjustment_reason_id == 0)
                {
                    pDb.BalanceAdjustmentReasonCollection.Insert(_balanceAdjustmentReasonRow);
                    pBalanceAdjustmentReason.BalanceAdjustmentReasonId = _balanceAdjustmentReasonRow.Balance_adjustment_reason_id;
                }
                else
                {
                    pDb.BalanceAdjustmentReasonCollection.Update(_balanceAdjustmentReasonRow);
                }
            }
        }
Exemple #4
0
        static CustomerAcctPaymentDto mapToCustomerAcctPayment(CustomerAcctPaymentRow_Base pCustomerAcctPaymentRow, string pCustomerAcctName, PersonDto pPerson, BalanceAdjustmentReasonDto pBalanceAdjustmentReason)
        {
            var _customerAcctPayment = new CustomerAcctPaymentDto
            {
                DateTime                = pCustomerAcctPaymentRow.Date_time,
                CustomerAcctId          = pCustomerAcctPaymentRow.Customer_acct_id,
                CustomerAcctName        = pCustomerAcctName,
                PreviousAmount          = pCustomerAcctPaymentRow.Previous_amount,
                Amount                  = pCustomerAcctPaymentRow.Payment_amount,
                Comments                = pCustomerAcctPaymentRow.Comments,
                BalanceAdjustmentReason = pBalanceAdjustmentReason,
                Person                  = pPerson
            };

            return(_customerAcctPayment);
        }
Exemple #5
0
        static RetailAccountPaymentDto mapToRetailAccountPayment(RetailAccountPaymentRow pRetailAccountPaymentRow, PersonDto pPerson, BalanceAdjustmentReasonDto pBalanceAdjustmentReason)
        {
            var _retailAccountPayment = new RetailAccountPaymentDto();

            _retailAccountPayment.DateTime                = pRetailAccountPaymentRow.Date_time;
            _retailAccountPayment.RetailAcctId            = pRetailAccountPaymentRow.Retail_acct_id;
            _retailAccountPayment.PreviousAmount          = pRetailAccountPaymentRow.Previous_amount;
            _retailAccountPayment.Amount                  = pRetailAccountPaymentRow.Payment_amount;
            _retailAccountPayment.PreviousBonusMinutes    = pRetailAccountPaymentRow.Previous_bonus_minutes;
            _retailAccountPayment.AddedBonusMinutes       = pRetailAccountPaymentRow.Added_bonus_minutes;
            _retailAccountPayment.Comments                = pRetailAccountPaymentRow.Comments;
            _retailAccountPayment.BalanceAdjustmentReason = pBalanceAdjustmentReason;
            _retailAccountPayment.Person                  = pPerson;
            _retailAccountPayment.CdrKey                  = pRetailAccountPaymentRow.Cdr_key;

            return(_retailAccountPayment);
        }