Esempio n. 1
0
 public ScheduleItem(LessonsOrder lo, IEnumerable <Teacher> t, IEnumerable <Group> g, Room r)
 {
     lesson   = lo;
     teachers = t;
     groups   = g;
     room     = r;
 }
Esempio n. 2
0
 public ScheduleItem(LessonsOrder lesson, Room room, IEnumerable <Teacher> teachers, IEnumerable <Group> groups)
 {
     Lesson   = lesson;
     Room     = room;
     Teachsrs = teachers;
     Groups   = groups;
 }
 public ScheduleItem(LessonsOrder lo, IEnumerable<Teacher> t, IEnumerable<Group> g, Room r)
 {
     lesson = lo;
     teachers = t;
     groups = g;
     room = r;
 }
Esempio n. 4
0
        private bool IsLessonRoom(DateTime date, LessonsOrder lesson, Room room)
        {
            bool b = false;

            if (items.ContainsKey(date))
            {
                foreach (ScheduleItem s in items[date])
                {
                    if (s.Lesson == lesson && object.Equals(s.Room, room))
                    {
                        b = true;
                    }
                }
            }
            return(b);
        }
Esempio n. 5
0
        private bool IsLessonTeacher(DateTime date, LessonsOrder lesson, Teacher teacher)
        {
            bool b = false;

            if (items.ContainsKey(date))
            {
                foreach (ScheduleItem s in items[date])
                {
                    if (s.Lesson == lesson && s.Teachsrs.Contains <Teacher>(teacher))
                    {
                        b = true;
                        break;
                    }
                }
            }
            return(b);
        }
Esempio n. 6
0
        private bool IsLessonGroup(DateTime date, LessonsOrder lesson, Group group)
        {
            bool b = false;

            if (items.ContainsKey(date))
            {
                foreach (ScheduleItem s in items[date])
                {
                    if (s.Lesson == lesson && s.Groups.Contains <Group>(group))
                    {
                        b = true;
                        break;
                    }
                }
            }

            return(b);
        }
Esempio n. 7
0
        public bool AddLesson(DateTime date, LessonsOrder lesson, Room room, IEnumerable <Teacher> teachers, IEnumerable <Group> groups)
        {
            bool b = true;

            foreach (Teacher t in teachers)
            {
                if (IsLessonTeacher(date, lesson, t))
                {
                    b = false;
                    break;
                }
            }
            if (b)
            {
                foreach (Group g in groups)
                {
                    if (IsLessonGroup(date, lesson, g))
                    {
                        b = false;
                        break;
                    }
                }
            }
            if (IsLessonRoom(date, lesson, room))
            {
                b = false;
            }
            if (b)
            {
                if (!items.ContainsKey(date))
                {
                    items[date] = new List <ScheduleItem>();
                }
                items[date].Add(new ScheduleItem()
                {
                    Lesson = lesson, Room = room, Teachsrs = teachers, Groups = groups
                });
            }
            return(b);
        }
Esempio n. 8
0
        public bool AddLesson(DateTime date, LessonsOrder lesson, Room room, IEnumerable<Teacher> teachers, IEnumerable<Group> groups)
        {
            bool b = true;

            foreach (Teacher t in teachers)
            {
                if (IsLessonTeacher(date, lesson, t))
                {
                    b = false;
                    break;
                }
            }
            if (b)
            {
                foreach (Group g in groups)
                {
                    if (IsLessonGroup(date, lesson, g))
                    {
                        b = false;
                        break;
                    }
                }
            }
            if (IsLessonRoom(date, lesson, room))
            {
                b = false;
            }
            if (b)
            {
                if (!items.ContainsKey(date))
                {
                    items[date] = new List<ScheduleItem>();
                }
                items[date].Add(new ScheduleItem() { Lesson = lesson, Room = room, Teachsrs = teachers, Groups = groups });
            }
            return b;
        }
Esempio n. 9
0
 public bool AddLesson(DateTime date, LessonsOrder lesson, Room room, IEnumerable <Teacher> teachers, IEnumerable <Group> groups)
 {
     return(schedule.AddLesson(date, lesson, room, teachers, groups));
 }
Esempio n. 10
0
 public ScheduleItem(LessonsOrder lesson, Room room, IEnumerable<Teacher> teachers, IEnumerable<Group> groups)
 {
     Lesson = lesson;
     Room = room;
     Teachsrs = teachers;
     Groups = groups;
 }
Esempio n. 11
0
 private TimeSpan TimeOfStart(LessonsOrder lesson)
 {
     return timeOfStart[(int)lesson];
 }
Esempio n. 12
0
 private bool IsLessonTeacher(DateTime date, LessonsOrder lesson, Teacher teacher)
 {
     bool b = false;
     if (items.ContainsKey(date))
     {
         foreach (ScheduleItem s in items[date])
         {
             if (s.Lesson == lesson && s.Teachsrs.Contains<Teacher>(teacher))
             {
                 b = true;
                 break;
             }
         }
     }
     return b;
 }
Esempio n. 13
0
 private bool IsLessonRoom(DateTime date, LessonsOrder lesson, Room room)
 {
     bool b = false;
     if (items.ContainsKey(date))
     {
         foreach (ScheduleItem s in items[date])
         {
             if (s.Lesson == lesson && object.Equals(s.Room, room))
             {
                 b = true;
             }
         }
     }
     return b;
 }
Esempio n. 14
0
        private bool IsLessonGroup(DateTime date, LessonsOrder lesson, Group group)
        {
            bool b = false;

            if (items.ContainsKey(date))
            {
            foreach (ScheduleItem s in items[date])
            {
                if (s.Lesson == lesson && s.Groups.Contains<Group>(group))
                {
                    b = true;
                    break;
                }
            }
            }

            return b;
        }
Esempio n. 15
0
 private TimeSpan TimeOfStart(LessonsOrder lesson)
 {
     return(timeOfStart[(int)lesson]);
 }
Esempio n. 16
0
 public bool AddLesson(DateTime date, LessonsOrder lesson, Room room, IEnumerable<Teacher> teachers, IEnumerable<Group> groups)
 {
     return  schedule.AddLesson(date, lesson, room, teachers, groups);
 }