public ActionResult DeActivateAccount() { businessLogics = new BusinessLogics(); if (Session["LoginEmail"] == null) { return(RedirectToAction("Logout", "Authentication")); } string email = Session["LoginEmail"].ToString(); var result = businessLogics.DeleteAccount(email); if (result == 0) { ViewBag.ErrorMsg = "No account found with the email provided"; } else if (result == 1) { //Successfully deactivated the account return(RedirectToAction("Logout", "Authentication")); } else { ViewBag.ErrorMsg = "Internal Error occured while deleting your account"; } return(RedirectToAction("Index", "UserProfile")); }