Example #1
0
 public ActionResult Recalc(ServiceViewModel service)
 {
     RemoveBlankLine();
     if (ModelState.IsValid)
     {
         service.Update(true);
     }
     return(View("Edit", service));
 }
Example #2
0
 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));
 }