public static List <ScheduleView> GetDoctorShedules(DoctorDTO doctor, DateTime date) { TimeManager tm = new TimeManager(); List <ScheduleView> list = new List <ScheduleView>(); foreach (var el in tm.GetAll()) { if (el.DoctorId == doctor.Id && el.Date == date) { list.Add(ScheduleView.CreateScheduleView(el)); } } return(list); }
private void LoadData(object sender, RoutedEventArgs e) { dpDate.DisplayDateStart = DateTime.Today.AddDays(1); TimeManager tm = new TimeManager(); List <ScheduleView> list = new List <ScheduleView>(); foreach (var el in tm.GetAll()) { list.Add(ScheduleView.CreateScheduleView(el)); } grdSchedule.ItemsSource = null; grdSchedule.ItemsSource = list; dpDate.SelectedDate = null; LoadDoctorsList(); }