コード例 #1
0
        public ActionResult Edit(PaymentMethodViewModel viewModel)
        {
            if (!_paymentMethodService.DoesPaymentMethodExist(viewModel.Id))
            {
                return(HttpNotFound());
            }

            if (!ModelState.IsValid)
            {
                viewModel.Heading = "Edit";
                return(View("PaymentMethodForm", viewModel));
            }

            _paymentMethodService.Edit(viewModel);

            return(RedirectToAction("Index"));
        }