示例#1
0
        public ActionResult Index()
        {
            var date  = DateTime.Now.Date;
            var model = new CollectionOfAll
            {
                Ambulances          = db.Ambulances.ToList(),
                Departments         = db.Department.ToList(),
                Doctors             = db.Doctors.ToList(),
                Patients            = db.Patients.ToList(),
                Medicines           = db.Medicines.ToList(),
                ActiveAppointments  = db.Appointments.Where(c => c.Status).Where(c => c.AppointmentDate >= date).ToList(),
                PendingAppointments = db.Appointments.Where(c => c.Status == false).Where(c => c.AppointmentDate >= date).ToList(),
                AmbulanceDrivers    = db.AmbulanceDrivers.ToList(),
                Announcements       = db.Announcements.Where(c => c.AnnouncementFor == "Doctor").ToList()
            };

            return(View(model));
        }
        public ActionResult Index(string message)
        {
            ViewBag.Messege = message;
            string user    = User.Identity.GetUserId();
            var    patient = db.Patients.Single(c => c.ApplicationUserId == user);
            var    date    = DateTime.Now.Date;
            var    model   = new CollectionOfAll
            {
                Departments         = db.Department.ToList(),
                Doctors             = db.Doctors.ToList(),
                Patients            = db.Patients.ToList(),
                Medicines           = db.Medicines.ToList(),
                ActiveAppointments  = db.Appointments.Where(c => c.Status).Where(c => c.PatientId == patient.Id).Where(c => c.AppointmentDate >= date).ToList(),
                PendingAppointments = db.Appointments.Where(c => c.Status == false).Where(c => c.PatientId == patient.Id).Where(c => c.AppointmentDate >= date).ToList(),
            };

            return(View(model));
        }
示例#3
0
        //[OnlyAllowedAttribute(Roles = "Admin")]
        public ActionResult Index(string message)
        {
            var date = DateTime.Now.Date;

            ViewBag.Messege = message;
            var model = new CollectionOfAll
            {
                Departments        = db.Department.ToList(),
                Doctors            = db.Doctors.ToList(),
                Patients           = db.Patients.ToList(),
                Medicines          = db.Medicines.ToList(),
                ActiveAppointments =
                    db.Appointments.Where(c => c.Status).Where(c => c.AppointmentDate >= date).ToList(),
                PendingAppointments = db.Appointments.Where(c => c.Status == false)
                                      .Where(c => c.AppointmentDate >= date).ToList(),
            };

            return(View(model));
        }
        public ActionResult Index(string message)
        {
            var date = DateTime.Now.Date;

            ViewBag.Messege = message;
            var user   = User.Identity.GetUserId();
            var doctor = db.Psychologists.Single(c => c.ApplicationUserId == user);
            var model  = new CollectionOfAll
            {
                Departments         = db.Centre.ToList(),
                Psychologists       = db.Psychologists.ToList(),
                Patients            = db.Patients.ToList(),
                ActiveAppointments  = db.Appointments.Where(c => c.Schedule.PsychologistId == doctor.Id).Where(c => c.Status).Where(c => c.AppointmentDate >= date).ToList(),
                PendingAppointments = db.Appointments.Where(c => c.Schedule.PsychologistId == doctor.Id).Where(c => c.Status == false).Where(c => c.AppointmentDate >= date).ToList(),

                Announcements = db.Announcements.Where(c => c.AnnouncementFor == "Psychologist").ToList()
            };

            return(View(model));
        }
示例#5
0
        public ActionResult Index()
        {
            string user    = User.Identity.GetUserId();
            var    patient = db.Patients.Single(c => c.ApplicationUserId == user);
            var    date    = DateTime.Now.Date;
            var    model   = new CollectionOfAll
            {
                Ambulances          = db.Ambulances.ToList(),
                Departments         = db.Department.ToList(),
                Doctors             = db.Doctors.ToList(),
                Patients            = db.Patients.ToList(),
                Medicines           = db.Medicines.ToList(),
                ActiveAppointments  = db.Appointments.Where(c => c.Status).Where(c => c.PatientId == patient.Id).Where(c => c.AppointmentDate >= date).ToList(),
                PendingAppointments = db.Appointments.Where(c => c.Status == false).Where(c => c.PatientId == patient.Id).Where(c => c.AppointmentDate >= date).ToList(),
                AmbulanceDrivers    = db.AmbulanceDrivers.ToList(),
                Announcements       = db.Announcements.Where(c => c.AnnouncementFor == "Patient").ToList()
            };

            return(View(model));
        }
示例#6
0
        public ActionResult Index(string message)
        {
            try
            {
                ViewBag.Messege = message;
                string user    = User.Identity.GetUserId();
                var    patient = db.Patients.Single(c => c.ApplicationUserId == user);

                if (patient.Image != null)
                {
                    ViewBag.propic = patient.Image;
                }
                else
                {
                    ViewBag.propic = default_image;
                }

                var date  = DateTime.Now.Date;
                var model = new CollectionOfAll
                {
                    Departments         = db.Centre.ToList(),
                    Psychologists       = db.Psychologists.ToList(),
                    Patients            = db.Patients.ToList(),
                    ActiveAppointments  = db.Appointments.Where(c => c.Status).Where(c => c.PatientId == patient.Id).Where(c => c.AppointmentDate >= date).ToList(),
                    PendingAppointments = db.Appointments.Where(c => c.Status == false).Where(c => c.PatientId == patient.Id).Where(c => c.AppointmentDate >= date).ToList(),
                    Announcements       = db.Announcements.Where(c => c.AnnouncementFor == "Patient").ToList()
                };

                return(View(model));
            }
            catch (Exception error)
            {
                Console.Write(error.Message);
            }

            //if we got here something went wrong
            return(View());
        }