public IActionResult DeleteAllNotification() { int uid = Convert.ToInt32(HttpContext.Session.GetString("uid")); if (uid == 0) { return(RedirectToAction("Login", "Home")); } if (repObj.GetRoleId(uid) != "F") { if (repObj.GetRoleId(uid) == "E") { return(RedirectToAction("EmployeeHome", "User")); } if (repObj.GetRoleId(uid) == "C") { return(RedirectToAction("CustomerHome", "User")); } } int cidn = Convert.ToInt32(HttpContext.Session.GetString("uid")); bool query = repObj.DeleteAllNotification(cidn); if (query) { return(RedirectToAction("GetNotifications", "Farmer")); } return(View("Error")); }