public bool PayBill(BillPay bill)
        {
            if (!checkIfFundsSufficient(bill.Amount, 0))
            {
                return(false);
            }

            Balance -= bill.Amount;
            GenerateTransaction(Transaction.BillPayTransaction, bill.Amount, 0);
            if (bill.Period != BillPay.Periods.OnceOff)
            {
                switch (bill.Period)
                {
                case BillPay.Periods.Monthly:
                    bill.ScheduleDate = bill.ScheduleDate.AddMonths(1);
                    bill.ModifyDate   = DateTime.UtcNow;
                    break;

                case BillPay.Periods.Quarterly:
                    bill.ScheduleDate = bill.ScheduleDate.AddMonths(3);
                    bill.ModifyDate   = DateTime.UtcNow;
                    break;

                case BillPay.Periods.Annually:
                    bill.ScheduleDate = bill.ScheduleDate.AddYears(1);
                    bill.ModifyDate   = DateTime.UtcNow;
                    break;

                default:
                    break;
                }
            }
            return(true);
        }
        public bool PayBill(BillPay bill)
        {
            if (!checkIfFundsSufficient(bill.Amount, 0))
            {
                return(false);
            }

            Balance -= bill.Amount;
            GenerateTransaction(Transaction.BillPayTransaction, bill.Amount, 0);
            return(true);
        }
Example #3
0
 //Method for updating bills from a billpayviewmodel object
 public void UpdateBill(BillPay bill)
 {
     AccountNumber   = bill.FKAccountNumber.AccountNumber;
     FKAccountNumber = bill.FKAccountNumber;
     PayeeID         = bill.FKPayeeID.PayeeID;
     FKPayeeID       = bill.FKPayeeID;
     Amount          = bill.Amount;
     ScheduleDate    = bill.ScheduleDate;
     Period          = bill.Period;
     ModifyDate      = DateTime.UtcNow;
 }