public ActionResult Recalc(ServiceViewModel service) { RemoveBlankLine(); if (ModelState.IsValid) { service.Update(true); } return(View("Edit", service)); }
public ActionResult Edit(ServiceViewModel service) { RemoveBlankLine(); if (ModelState.IsValid) { try { service.Update(); return(RedirectToAction("Index", new { id = service.CarID })); } catch (Exception e) { ModelState.AddModelError("CustomError", e.Message); return(View(service)); } } return(View(service)); }