Exemplo n.º 1
0
        /// <summary>
        /// Retrives the list Available time slots for a particular doctor on a particular date
        /// </summary>
        /// <param name="doctorId"></param>
        /// <param name="date"></param>
        /// <returns>List of Availavle Time slots</returns>
        public List <AppointmentTime> GetDoctorAvailableTimeSlots(int doctorId, DateTime date)
        {
            AppointmentsData       appointmentsData           = new AppointmentsData();
            List <Appointment>     BookedAppointmentTimeSlots = appointmentsData.GetDoctorAppointmentsData(doctorId, date);
            List <AppointmentTime> AllTimeSlots       = appointmentsData.GetTimeSlot();
            List <AppointmentTime> availableTimeSlots = new List <AppointmentTime>();

            foreach (AppointmentTime TimeSlots in AllTimeSlots)
            {
                Boolean SlotBooked = false;
                foreach (Appointment BookedTimeSlots in BookedAppointmentTimeSlots)
                {
                    if (TimeSlots.Id == BookedTimeSlots.AppointmentTimeId)
                    {
                        SlotBooked = true;
                    }
                }
                if (SlotBooked == false)
                {
                    availableTimeSlots.Add(TimeSlots);
                }
            }
            return(availableTimeSlots);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retreaves the list of all the appointments associated to a doctor id
        /// </summary>
        /// <returns>List of Appointments</returns>
        public List <Appointment> GetDoctorAppointmentList(int id)
        {
            AppointmentsData appointmentsData = new AppointmentsData();

            return(appointmentsData.GetDoctorAppointmentsData(id));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrives the list of Doctor Appointment for a paricular date
        /// </summary>
        /// <param name="doctorId"></param>
        /// <param name="date"></param>
        /// <returns>List of Appointments</returns>
        public List <Appointment> GetDoctorTimeSlots(int doctorId, DateTime date)
        {
            AppointmentsData appointmentsData = new AppointmentsData();

            return(appointmentsData.GetDoctorAppointmentsData(doctorId, date));
        }