private void AssignToLocationsOnSyllabus(SyllabusDomain syllabus, long facultyId)
        {
            var locations = _locationRepository.GetFacultyLocations(facultyId);

            locations.Shuffle();
            syllabus.AssignToLocations(locations);
            syllabus.UnitLessons.RemoveAll(x => x.LessonId == 0 && x.UserId == 0 && x.LocationId == 0);
        }
        private void CheckAssignToLocationOnSyllabus(SyllabusDomain syllabus, long facultyId)
        {
            var emptyLocationOnUnits = syllabus.UnitLessons.FindAll(x => x.LessonId > 0 && x.UserId > 0 && x.LocationId == 0);

            while (emptyLocationOnUnits.Count != 0)
            {
                emptyLocationOnUnits = syllabus.UnitLessons.FindAll(x => x.LessonId > 0 && x.UserId > 0 && x.LocationId == 0);
                if (emptyLocationOnUnits.Count > 0)
                {
                    AssignToLocationsOnSyllabus(syllabus, facultyId);
                }
            }
        }
        private void CheckAssignToTeacherOnSyllabus(List <SyllabusForLessonWithGroupListDto> syllabusLessons, SyllabusDomain syllabus, EducationType educationType)
        {
            var emptyLessonOnSyllabus = syllabus.UnitLessons.FindAll(x => x.LessonId > 0 && x.UserId == 0);
            var unAssignLessons       = syllabusLessons.FindAll(x => emptyLessonOnSyllabus.Contains(emptyLessonOnSyllabus.Find(y => y.LessonId == x.LessonId))).ToList();

            if (unAssignLessons.Count > 0)
            {
                AssignToTeacherOnSyllabus(unAssignLessons, syllabus, educationType);
            }
        }
 private void AssignToTeacherOnSyllabus(List <SyllabusForLessonWithGroupListDto> syllabusLessons, SyllabusDomain syllabus, EducationType educationType)
 {
     foreach (var lesson in syllabusLessons)
     {
         var teachers          = _userRepository.GetUserWithConstraintsForLesson(lesson.LessonId);
         var teacher           = TeacherSelection(teachers, educationType);
         var teacherForLessons = _lessonRepository.GetLessonsForTeacher(teacher.UserId);
         syllabus.AssignToTeacher(teacherForLessons, teacher);
     }
 }