Exemplo n.º 1
0
        public ActionResult ViewReportsWithID(int id)
        {
            if (Convert.ToString(Session["key"]) != "patient")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Reports_Api  rprt = new Reports_Api();
            PatientModel pat  = new PatientModel();

            pat.pid = (int)Session["UserId"];
            List <ReportModel> m = new List <ReportModel>();
            var model            = rprt.GetReportsByAppt(id);

            m.Add(model);
            if (model.appointment_ID != 0)
            {
                return(View("~/Views/Patient/PatientViewReports.cshtml", m));
            }
            else
            {
                ViewBag.info = "Reports are not yet generated";
                return(View("~/Views/Patient/NoReports.cshtml", m));
            }
        }
        public ActionResult ViewReportsWithID(int id)
        {
            if (Convert.ToString(Session["key"]) != "doctor")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Reports_Api  rprt = new Reports_Api();
            PatientModel pat  = new PatientModel();

            pat.pid = (int)Session["UserId"];
            List <ReportModel> m = new List <ReportModel>();
            var model            = rprt.GetReportsByAppt(id);

            m.Add(model);
            if (model.report_ID != 0)
            {
                return(View("~/Views/Doctor/DoctorManageReports.cshtml", m));
            }
            else
            {
                return(View("~/Views/Doctor/ReportAvailability.cshtml"));
            }
        }