Пример #1
0
        private bool IsTeacherAlreadyBooked(StoneCastle.Scheduler.Models.TeacherScheduleModel teacher, TimeShift tf, StoneCastle.Scheduler.Models.TimetableModel tt)
        {
            if (teacher == null || tf == null || tt == null)
            {
                return(false);
            }

            CourseSectionSchedule cs     = tt.TimeTableMatrix[tf.Shift * tf.Slot + tf.Slot, (int)tf.Day];
            ClassCourseSchedule   course = cs.ClassCourse;

            if (cs.Stage == COURSE_SECTION_STAGE.BOOKED && course != null && course.Teacher != null && course.Teacher.Id == teacher.Id)
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
        private bool CanBeBookedForTeacher(StoneCastle.Scheduler.Models.TeacherScheduleModel teacher, TimeShift tf, ScheduleBoard board)
        {
            foreach (ClassGroupSchedule cg in board.ClassGroups)
            {
                foreach (ClassRoomSchedule cr in cg.ClassRooms)
                {
                    StoneCastle.Scheduler.Models.TimetableModel tt = cr.Timetable;

                    if (this.IsTeacherAlreadyBooked(teacher, tf, tt))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }