public ActionResult New() { var model = new EditViewModel() { Client = new Structure.Models.Client() }; return View("Edit", model); }
public ActionResult Edit(EditViewModel model) { var response = this.ModelService.SaveClient(model.Client); if (response.HasError){ TempData["Error"] = "Could not save client."; return View(model); } TempData["Success"] = model.Client.Name + " was successfully saved."; return this.RedirectToAction("Index"); }
public ActionResult Edit(int id) { var response = this.ModelService.GetClient(id); var client = response.Result; var model = new EditViewModel() { Client = client }; return View(model); }