コード例 #1
0
        private static LessonFrame CreateLessonFrame(Teacher teacher, Subject subject, Flow flow)
        {
            var lessonFrame = new LessonFrame(teacher, subject, flow);

            Insert <LessonFrame> .InsertOriginal(lessonFrame, Select.LessonFrames());

            return(lessonFrame);
        }
コード例 #2
0
        private static void AddGroupToLessonFrame(Group group, LessonFrame lessonFrame)
        {
            var subgroups = Select.Subgroups().Where(x => x.GroupId == group.Id);

            foreach (var subgroup in subgroups)
            {
                AddSubgroupToLessonFrame(subgroup, lessonFrame);
            }
        }
コード例 #3
0
        private static void AddFlowToLessonFrame(Flow flow, LessonFrame lessonFrame)
        {
            var groups = Select.Groups().Where(x => x.FlowId == flow.Id);

            foreach (var group in groups)
            {
                var subgroups = Select.Subgroups().Where(x => x.GroupId == group.Id);
                foreach (var subgroup in subgroups)
                {
                    AddSubgroupToLessonFrame(subgroup, lessonFrame);
                }
            }
        }
コード例 #4
0
        private void CreateLesson(LessonFrame lessonFrame, int classroomId, int dayId, int lessonTime)
        {
            var lesson = new Lesson(lessonFrame.SubjectId, lessonFrame.TeacherId, classroomId, dayId, lessonTime);

            Insert <Lesson> .InsertOriginal(lesson, Select.Lessons());

            var subgroupsInLessonFrames = Select.SubgroupsInLessonFrames().Where(x => x.LessonFrameId == lessonFrame.Id);

            foreach (var subgroupInLessonFrame in subgroupsInLessonFrames)
            {
                var subgroupInLesson = new SubgroupsInLessons(subgroupInLessonFrame.SubgroupId, lesson.Id);
                Insert <SubgroupsInLessons> .InsertOriginal(subgroupInLesson, Select.SubgroupsInLessons());
            }
        }
コード例 #5
0
        /// <summary>
        /// Set up splitview, listbox menu and frame.
        /// </summary>

        public Classroom()
        {
            this.InitializeComponent();

            if (HUB.usingPreBuiltLessons)
            {
                LessonFrame.Navigate(typeof(Lesson1));
            }

            else
            {
                LessonFrame.Navigate(typeof(Lesson));
            }
            MenuItem1.IsSelected = true;
        }
コード例 #6
0
        /// <summary>
        /// Whenever the listbox menu is clicked, navigate correctly or expand the panel
        /// </summary>

        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            bool reset = false;

            if (MenuHamburgerItem.IsSelected)
            {
                MenuSplitView.IsPaneOpen     = !MenuSplitView.IsPaneOpen;
                MenuHamburgerItem.IsSelected = false;
                reset = true;
            }

            if (MenuItem1.IsSelected || (reset && PrevSelect == 1))
            {
                HUB.config = 1;
                if (HUB.usingPreBuiltLessons)
                {
                    LessonFrame.Navigate(typeof(Lesson1));
                }
                else
                {
                    BLA();
                }
                PrevSelect = 1;
            }

            else if (MenuItem2.IsSelected || (reset && PrevSelect == 2))
            {
                HUB.config = 2;
                if (HUB.usingPreBuiltLessons)
                {
                    LessonFrame.Navigate(typeof(Lesson2));
                }
                else
                {
                    BLA();
                }
                PrevSelect = 2;
            }

            else if (MenuItem3.IsSelected || (reset && PrevSelect == 3))
            {
                HUB.config = 3;
                if (HUB.usingPreBuiltLessons)
                {
                    LessonFrame.Navigate(typeof(Lesson4));
                }
                else
                {
                    BLA();
                }
                PrevSelect = 3;
            }

            else if (MenuItem4.IsSelected || (reset && PrevSelect == 4))
            {
                HUB.config = 4;
                if (HUB.usingPreBuiltLessons)
                {
                    LessonFrame.Navigate(typeof(Lesson3));
                }
                else
                {
                    BLA();
                }
                PrevSelect = 4;
            }

            else if (MenuItem5.IsSelected || (reset && PrevSelect == 5))
            {
                HUB.config = 5;
                if (HUB.usingPreBuiltLessons)
                {
                    LessonFrame.Navigate(typeof(Lesson5));
                }
                else
                {
                    BLA();
                }
                PrevSelect = 5;
            }
        }
コード例 #7
0
        private static void AddSubgroupToLessonFrame(Subgroup subgroup, LessonFrame lessonFrame)
        {
            var subgroupInLessonFrame = new SubgroupsInLessonFrames(subgroup.Id, lessonFrame.Id);

            Insert <SubgroupsInLessonFrames> .InsertOriginal(subgroupInLessonFrame, Select.SubgroupsInLessonFrames());
        }