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

                regularPaymentsRepository.UpdateRegularPayment(regularPayment);

                return RedirectToAction("Details", new { accountId = model.BankAccountId });
            }
            else
            {
                return View(model);
            }
        }
示例#2
0
        public ActionResult EditRegularPayment(int accountId, int regularPaymentId)
        {
            RegularPayment regularPayment = regularPaymentsRepository.GetRegularPaymentById(regularPaymentId);

            EditRegularPaymentViewModel model = new EditRegularPaymentViewModel(regularPayment);

            return View(model);
        }