public JsonResult deletePartJson(int partId) { try { int deleted = PartProcessor.DeletePart( partId ); return(Json("Delete")); } catch { return(Json("Error")); } }
public ActionResult deletePart(int id) { int deleted = 0; if (ModelState.IsValid) { try { deleted = PartProcessor.DeletePart( id ); TempData["newPartResult"] = 2; return(RedirectToAction("ViewParts")); } catch (Exception ex) { TempData["partDeleted"] = deleted; return(RedirectToAction("ViewParts")); } } return(View()); }