public ActionResult ViewDoctorAppointments(AppointmentModel person)
        {
            if (Convert.ToString(Session["key"]) != "nurse")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Doctor_Api doctorApi = new Doctor_Api();

            if (person.doctor_ID != 0)
            {
                var doctorApmnts = doctorApi.GetDocApntment_Api(person.doctor_ID).Where(a => (a.cancelled == false && a.appointment_Date > DateTime.Now));
                return(View("~/Views/Nurse/NurseViewDoctorAppointments.cshtml", doctorApmnts));
            }
            else
            {
                AppointmentModel doctorApts = new AppointmentModel();

                Admin_Api adminApi = new Admin_Api();
                var       docs     = adminApi.GetAllDoctor();

                foreach (var d in docs)
                {
                    doctorApts.dropDown.Add(new SelectListItem
                    {
                        Text  = d.firstName,
                        Value = Convert.ToString(d.pid)
                    });
                }

                return(View("~/Views/Nurse/ViewDoctorsList.cshtml", doctorApts));
            }
        }
Esempio n. 2
0
        //view  screen
        public ActionResult PatientAppointment(int patientId = 0)
        {
            if (Convert.ToString(Session["key"]) != "patient")
            {
                return(RedirectToAction("Login", "Home"));
            }

            AppointmentModel appModel = new AppointmentModel();
            Admin_Api        adminApi = new Admin_Api();
            var model = adminApi.GetAllDoctor().ToArray();

            List <DoctorDropDown> items = new List <DoctorDropDown>();

            foreach (var m in model)
            {
                appModel.doctorDetails.Add(m);
                items.Add(new DoctorDropDown
                {
                    Value = (m.pid),
                    Text  = m.firstName
                });
            }
            appModel.doctorDropDown = items;

            return(View("~/Views/Patient/PatientBookAppointment.cshtml", appModel));
        }
        public ActionResult ViewDoctors()
        {
            if (Convert.ToString(Session["key"]) != "admin")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Admin_Api adminGetAllDoctorsApi = new Admin_Api();

            var model = adminGetAllDoctorsApi.GetAllDoctor();

            if (model != null)
            {
                return(View("~/Views/Administrator/AdminViewDoctors.cshtml", model));
            }

            return(View("~/Views/Error.cshtml"));
        }
        public ActionResult SelectDoctors()
        {
            if (Convert.ToString(Session["key"]) != "nurse")
            {
                return(RedirectToAction("Login", "Home"));
            }

            AppointmentModel doctorApts = new AppointmentModel();

            Admin_Api adminApi = new Admin_Api();
            var       docs     = adminApi.GetAllDoctor();

            foreach (var d in docs)
            {
                doctorApts.dropDown.Add(new SelectListItem
                {
                    Text  = d.firstName,
                    Value = Convert.ToString(d.pid)
                });
            }

            return(View("~/Views/Nurse/ViewDoctorsList.cshtml", doctorApts));
        }
        public ActionResult GetRoleDetails(NotificationsModel notification)
        {
            if (Convert.ToString(Session["key"]) != "admin")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Admin_Api          adminApi = new Admin_Api();
            NotificationsModel model    = new NotificationsModel();

            ViewBag.dropdownModel = null;

            if (notification.Notifications.Equals("Doctors"))
            {
                var persons = adminApi.GetAllDoctor();
                foreach (var p in persons)
                {
                    model.personDetails.Add(new SelectListItem {
                        Text  = p.firstName,
                        Value = Convert.ToString(p.pid)
                    });
                }
                ViewBag.dropdownModel = "Doctors";
            }
            else if (notification.Notifications.Equals("Patients"))
            {
                var persons = adminApi.GetAllPatients();
                foreach (var p in persons)
                {
                    model.personDetails.Add(new SelectListItem
                    {
                        Text  = p.firstName,
                        Value = Convert.ToString(p.pid)
                    });
                }
                ViewBag.dropdownModel = "Patients";
            }
            else if (notification.Notifications.Equals("Nurses"))
            {
                var persons = adminApi.GetAllNurses();
                foreach (var p in persons)
                {
                    model.personDetails.Add(new SelectListItem
                    {
                        Text  = p.firstName,
                        Value = Convert.ToString(p.pid)
                    });
                }
                ViewBag.dropdownModel = "Nurses";
            }
            else if (notification.Notifications.Equals("LabIncharges"))
            {
                var persons = adminApi.GetAllLabIncharges();
                foreach (var p in persons)
                {
                    model.personDetails.Add(new SelectListItem
                    {
                        Text  = p.firstName,
                        Value = Convert.ToString(p.pid)
                    });
                }
                ViewBag.dropdownModel = "LabIncharges";
            }

            return(View("~/Views/Administrator/AdminAddNotifications.cshtml", model));
        }