public string ProcessAndReturnId(InputModel userInputModel) { var deployment = inputModelToWidgetMapper.CreateInstance(userInputModel); deployment.CreateDate = deployment.CreateDate ?? getCurrentDateTime.Now(); deployment.LastModifyDate = getCurrentDateTime.Now(); return deploymentRepository.SaveAndReturnId(deployment); }
public ModifyViewModel BuildViewModel(InputModel userInputModel) { return new ModifyViewModel() { InputModel = userInputModel ?? new InputModel() }; }
public ActionResult Create(InputModel inputModel) { return Modify(inputModel); }
public ActionResult Modify(InputModel inputModel) { if (ModelState.IsValid) { processInputModelService.ProcessAndReturnId(inputModel); var routeValues = new RouteValueDictionary(); routeValues.Add("Controller", GetTheNameOfThisController()); routeValues.Add("Action", "Modify"); routeValues.Add("id", inputModel.Id); return new RedirectToRouteResult(routeValues); } return View("Modify", modifyViewModelBuilder.BuildViewModel(inputModel)); }