/// <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); }
/// <summary> /// Retrives list of free time slots of a doctor on a particular date /// </summary> /// <param name="doctorId"></param> /// <param name="date"></param> /// <returns>List of Availavle Time slots</returns> public List <AppointmentTime> GetDoctorTimeSlots() { AppointmentsData appointmentsData = new AppointmentsData(); return(appointmentsData.GetTimeSlot()); }