Exemplo n.º 1
0
        private void LoadData()
        {
            ICollection <Instructor> instructors = service.GetAllInstructors();

            monitorCombox.Items.Clear();
            if (instructors != null)
            {
                foreach (Instructor i in service.GetAllInstructors())
                {
                    bool check = true;
                    foreach (Activity a in i.Activities)
                    {
                        if (!(a.StartDate > activity.FinishDate || a.FinishDate < activity.StartDate))
                        {
                            if ((a.ActivityDays & activity.ActivityDays) != 0)
                            {
                                if (!(a.StartHour > (activity.StartHour + activity.Duration) ||
                                      (a.StartHour + a.Duration) < activity.StartHour))
                                {
                                    check = false;
                                }
                            }
                        }
                    }
                    if (check == true)
                    {
                        monitorCombox.Items.Add(i.Name);
                        instructorsLibres.Add(i);
                    }
                }
            }
            monitorCombox.SelectedIndex = -1;
            monitorCombox.ResetText();
        }