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); } }
public ActionResult EditRegularPayment(int accountId, int regularPaymentId) { RegularPayment regularPayment = regularPaymentsRepository.GetRegularPaymentById(regularPaymentId); EditRegularPaymentViewModel model = new EditRegularPaymentViewModel(regularPayment); return View(model); }