private IActionResult createEdit(AccountsCreateEditModel model) { if (ModelState.IsValid) { var errors = model.CreateOrUpdate(); addErrors(errors); } if (ModelState.IsValid) { return(RedirectToAction("Index")); } return(View("CreateEdit", model)); }
public IActionResult Edit(String id) { if (String.IsNullOrEmpty(id)) { return(RedirectToAction("Create")); } var model = new AccountsCreateEditModel(id); if (model.Account == null) { return(RedirectToAction("Create")); } return(View("CreateEdit", model)); }
public IActionResult Edit(String id, AccountsCreateEditModel model) { return(createEdit(model)); }
public IActionResult Create(AccountsCreateEditModel model) { model.Type = OperationType.Creation; return(createEdit(model)); }
public IActionResult Create() { var model = new AccountsCreateEditModel(); return(View("CreateEdit", model)); }