public ActionResult Edit(ScenarioViewModel viewModel) { var request = viewModel.MapTo<SaveScenarioRequest>(); var response = _scenarioService.SaveScenario(request); TempData["IsSuccess"] = response.IsSuccess; TempData["Message"] = response.Message; if (response.IsSuccess) { return RedirectToAction("Index"); } return View("Edit", viewModel); }
public ActionResult Create() { var viewModel = new ScenarioViewModel(); viewModel.IsActive = true; return View(viewModel); }