public ActionResult DeleteConfirmed(string id) { try { IBL bl = new BLImplement(); Patient patient = bl.getPatient(id); bl.deletePatient(patient); ViewBag.Message = String.Format("The patient {0} is successfully delete.", patient.Name); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Message = String.Format(ex.Message); return(RedirectToAction("Index")); } }