public ActionResult Index(int?id) { if (Convert.ToString(Session["key"]) != "labIncharge") { return(RedirectToAction("Login", "Home")); } if (id != null) { System.Web.HttpContext.Current.Session.Add("key", "labIncharge"); System.Web.HttpContext.Current.Session.Add("UserId", id); Login_Api la = new Login_Api(); var name = la.GetUserName(id); System.Web.HttpContext.Current.Session.Add("UserName", name); } LabIncharge_Api inchargeApi = new LabIncharge_Api(); var reportsModel = inchargeApi.GetAllPatientReports_Api(); if (reportsModel != null) { return(View("~/Views/LabIncharge/LabInchargeHome.cshtml", reportsModel)); } return(View("~/Views/Error.cshtml")); }
public ActionResult ViewAllReportsByDoctor() { if (Convert.ToString(Session["key"]) != "doctor") { return(RedirectToAction("Login", "Home")); } Patient_Api patientApi = new Patient_Api(); ViewBag.GetPatientsList = new SelectList(patientApi.GetPaitentsList()); LabIncharge_Api inchargeApi = new LabIncharge_Api(); var reportsModel = inchargeApi.GetAllPatientReports_Api(); return(View("~/Views/Doctor/DoctorManageReports.cshtml", reportsModel)); }