public ActionResult Index(int?id) { if (Convert.ToString(Session["key"]) != "doctor") { return(RedirectToAction("Login", "Home")); } // id = 5006; if (id != null) { System.Web.HttpContext.Current.Session.Add("key", "doctor"); 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); } NotificationsModel notificationModel = new NotificationsModel(); Admin_Api adminApi = new Admin_Api(); notificationModel.UserRoleID = (int)Session["UserId"];//6003; var notifications = adminApi.GetAllNotificationsByRole(notificationModel); return(View("~/Views/Doctor/DoctorHome.cshtml", notificationModel)); }
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 Index(int?id) { if (Convert.ToString(Session["key"]) != "admin") { return(RedirectToAction("Login", "Home")); } //id = 6003; if (id != null) { System.Web.HttpContext.Current.Session.Add("key", "admin"); 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); } return(View("~/Views/Administrator/AdministratorHome.cshtml")); }
//[HttpGet] public ActionResult Login(LoginModel loginDetails) { ViewBag.Message = "Your application description page."; Login_Api lapi = new Login_Api(); // var result = Convert.ToInt32(lapi.AuthenticateUser(loginDetails)); var result = 3; if (result == 0) { return(View()); } if (result == 1) { ViewBag.UserRole = "nurse"; return(View("~/Views/Nurse/NurseHome.cshtml")); } else if (result == 2) { ViewBag.User = "******"; return(View("~/Views/LabIncharge/LabInchargeHome.cshtml")); } else if (result == 3) { ViewBag.UserRole = "doctor"; return(View("~/Views/Doctor/DoctorHome.cshtml")); } else if (result == 4) { ViewBag.UserRole = "admin"; return(View("~/Views/Administrator/AdministratorHome.cshtml")); } else if (result == 5) { ViewBag.UserRole = "patient"; return(View("~/Views/Patient/PatientHome.cshtml")); } return(View()); }