Esempio n. 1
0
        public void GetAllDoctors_NoDoctors_ReturnsEmptyList()
        {
            //arrange

            //act
            var res = _doctorService.GetAllDoctors();

            //assert
            res.Doctors.Should().BeEmpty();
        }
        public ActionResult AddAppointments()
        {
            if (!User.Identity.IsAuthenticated)
            {
                RedirectToAction("Login", "Account", new { returnUrl = Url.Action("AddAppointments", "Appointments") });
            }
            else
            {
                DoctorService        _ds     = new DoctorService();
                IEnumerable <Doctor> _doctor = _ds.GetAllDoctors();
                DoctorViewModel      dvm     = new DoctorViewModel();
                dvm.DocID   = 0;
                dvm.Doctors = new List <SelectListItem>();

                foreach (var item in _doctor)
                {
                    dvm.Doctors.Add(new SelectListItem()
                    {
                        Text = item.Name, Value = item.ID.ToString()
                    });
                }
                return(View(dvm));
            }
            return(View());
        }
Esempio n. 3
0
        public ActionResult Search(DoctorSearchModel model)
        {
            model = model ?? new DoctorSearchModel();
            var doctors = _doctorService.GetAllDoctors(model.AreaName, model.SpecialtyName, model.DoctorName).ToList();

            model.DoctorCollection = doctors.ToPagedList(model.Page, model.PageSize);
            return(View(model));
        }
        public List <string> GetDoctorFullNames()
        {
            var doctors = DoctorService.GetAllDoctors();

            var results = new List <string>(doctors.Count);

            foreach (var doctor in doctors)
            {
                results.Add(doctor.FullName);
            }

            return(results);
        }
Esempio n. 5
0
        public SuggestCheckupDTO GetFirstFreeDoctorForChosenInterval(SuggestCheckupDTO suggestCheckupDTO)
        {
            List <Doctor> listOfAllDoctors = doctorService.GetAllDoctors();

            foreach (Doctor doctor in listOfAllDoctors)
            {
                suggestCheckupDTO.DoctorID = doctor.Id;
                while (suggestCheckupDTO.StartInterval < suggestCheckupDTO.EndInterval)
                {
                    suggestCheckupDTO.StartInterval = suggestCheckupDTO.StartInterval.AddHours(1);

                    if (doctorService.IsDoctorFree(suggestCheckupDTO.DoctorID, suggestCheckupDTO.StartInterval, suggestCheckupDTO.StartInterval.AddHours(1)))
                    {
                        return(suggestCheckupDTO);
                    }
                }
            }
            suggestCheckupDTO.DoctorID = -1;

            return(suggestCheckupDTO);
        }
 public List <Doctor> GetAllDoctors()
 {
     return(doctorService.GetAllDoctors());
 }
Esempio n. 7
0
        public string GetAllDoctors()
        {
            IDoctorService clinicService = new DoctorService();

            return(clinicService.GetAllDoctors());
        }