public ActionResult Delete(MaterialView material) { try { if (ModelState.IsValid) { JobCardManager manager = new JobCardManager(); manager.DeleteMaterial(material); return(RedirectToAction("Index")); } return(View()); } catch { return(View()); } }