示例#1
0
        public ActionResult CreateRegularPayment(CreateRegularPaymentViewModel model)
        {
            if (ModelState.IsValid)
            {
                RegularPayment regularPayment = new RegularPayment
                {
                    Name = model.Name,
                    Amount = model.Amount,
                    PaymentDay = model.PaymentDay,
                    BankAccountId = model.BankAccountId
                };

                regularPaymentsRepository.InsertRegularPayment(regularPayment);

                return RedirectToAction("Details", new { accountId = model.BankAccountId });
            }
            else
            {
                return View(model);
            }
        }
示例#2
0
        public ViewResult CreateRegularPayment(int accountId)
        {
            CreateRegularPaymentViewModel model = new CreateRegularPaymentViewModel()
            {
                Name = String.Empty,
                Amount = 0,
                PaymentDay = 1,
                BankAccountId = accountId
            };

            return View(model);
        }