public ActionResult DeleteRole(int roleId) { businessLogics = new BusinessLogics(); var result = businessLogics.DeleteRole(roleId); if (result == 1) { return(RedirectToAction("Index", "SiteRoleManagement")); } else if (result == 0) { ViewBag.ErrorMsg = "Role Doesn't Exists"; } else if (result == 2) { ViewBag.ErrorMsg = "Associated accounts with the role is still active"; } else { ViewBag.ErrorMsg = "Internal Error occured while deleting the role"; } return(RedirectToAction("Index", "SiteRoleManagement")); }