public ActionResult Create(ReplenishmentViewModel replenishmentViewModel) { try { if (ModelState.IsValid) { var replenishmentObj = new Replenishment { Amount = replenishmentViewModel.Amount, MobileNumber = replenishmentViewModel.MobileNumber, NumberOfCard = replenishmentViewModel.NumberOfCard, ExpirationDate = replenishmentViewModel.ExpirationDate, Cvc = replenishmentViewModel.Cvc, NameOfCard = replenishmentViewModel.NameOfCard }; ReplenishmentService.ExecutionOfReplenishment(_factory, User.Identity.GetUserId(), replenishmentObj, logger); TempData["SuccessMessage"] = "Счет успешно пополнен."; return(RedirectToAction("Index", "PersonalAccounts")); } return(View(replenishmentViewModel)); } catch (Exception ex) { logger.Error(ex, ex.Message); return(View("Error", new HandleErrorInfo(ex, "Replenishments", "Create"))); } }
public ActionResult Create() { ReplenishmentViewModel replenishmentViewModel = new ReplenishmentViewModel(); return(View(replenishmentViewModel)); }