public ScheduleItem(LessonsOrder lo, IEnumerable <Teacher> t, IEnumerable <Group> g, Room r) { lesson = lo; teachers = t; groups = g; room = r; }
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; }
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); }
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); }
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); }
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); }
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; }
public bool AddLesson(DateTime date, LessonsOrder lesson, Room room, IEnumerable <Teacher> teachers, IEnumerable <Group> groups) { return(schedule.AddLesson(date, lesson, room, teachers, groups)); }
public ScheduleItem(LessonsOrder lesson, Room room, IEnumerable<Teacher> teachers, IEnumerable<Group> groups) { Lesson = lesson; Room = room; Teachsrs = teachers; Groups = groups; }
private TimeSpan TimeOfStart(LessonsOrder lesson) { return timeOfStart[(int)lesson]; }
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; }
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; }
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; }
private TimeSpan TimeOfStart(LessonsOrder lesson) { return(timeOfStart[(int)lesson]); }
public bool AddLesson(DateTime date, LessonsOrder lesson, Room room, IEnumerable<Teacher> teachers, IEnumerable<Group> groups) { return schedule.AddLesson(date, lesson, room, teachers, groups); }