// Action to delete a borrower public ActionResult Delete(string PersonId) { if (Session["User"] == null) { return(RedirectToAction("Login", "Pages")); } try { // Let's delete everything the borrower has borrowed Borrow.delete(PersonId); // Let's delete the borrower Borrower.delete(PersonId); } catch { return(View("Error500")); } return(RedirectToAction("List")); }