public ActionResult Create() { if (Session["LogedUserID"] != null) { try { var _patientView = db.SP_SelectPatient(); return(View(_patientView)); } catch (Exception ex) { ViewBag.errorMessage = "Error occurred while loading data."; return(View()); } } else { return(RedirectToAction("AdminLogin", "Account")); } }