示例#1
0
        private void GetTimeTableTeacherInfo(object sender, ExecutedRoutedEventArgs e)
        {
            int selectedTeacherId = SubjectControl.GetSelectedSubjectScheduleItem().Subject.TeacherId;

            TeachersList.SelectedItem = _displayedTeachers.First(teacher => teacher.TeacherId == selectedTeacherId);
            TeachersTab.IsSelected    = true;
        }
示例#2
0
        private void ModifySelectedTimeTableSubject(object sender, ExecutedRoutedEventArgs e)
        {
            int        selectedPairNumber = SubjectControl.GetSelectedPairNumber();
            DaysOfWeek selectedDay        = SubjectControl.GetSelectedDay();

            SubjectScheduleItem selectedSubjectScheduleItem = SubjectControl.GetSelectedSubjectScheduleItem();
            var modifyDialog = new Dialogs.ModifyTimeTableSubjectDialog(_subjectRepository.GetAllSubjects(),
                                                                        selectedSubjectScheduleItem, _pairTypeRepository.GetAllPairTypes().ToList());

            modifyDialog.ShowDialog();

            if (!modifyDialog.IsSeleted && modifyDialog.SelectedPairType == null && modifyDialog.SelectedSubject == null)
            {
                return;
            }
            SubjectScheduleItem modifiedScheduleItem = new SubjectScheduleItem()
            {
                PairType = modifyDialog.SelectedPairType,
                Subject  = modifyDialog.SelectedSubject
            };

            _displayedSchedule.ScheduleDayColumns.First(col => col.DayName == selectedDay).SubjectDayDict[
                selectedPairNumber] = modifiedScheduleItem;

            SubjectControl.LoadSchedule(_displayedSchedule);
            _subjectRepository.AddModifyOneTimeTableSubject(_displayedSchedule.Year, _displayedSchedule.SemesterNumber,
                                                            _displayedSchedule.WeekNumber,
                                                            selectedDay, selectedPairNumber, modifiedScheduleItem.Subject, modifiedScheduleItem.PairType);
        }
示例#3
0
        private void GetTimeTableSubjectInfo(object sender, ExecutedRoutedEventArgs e)
        {
            Subject selectedSubject = SubjectControl.GetSelectedSubjectScheduleItem().Subject;

            SubjectList.SelectedItem = _displayedSubjects.First(subj => subj.SubjectId == selectedSubject.SubjectId);
            SubjectsTab.IsSelected   = true;
        }
示例#4
0
        private void GetTimeTableTasksInfo(object sender, ExecutedRoutedEventArgs e)
        {
            Subject selectedSubject = SubjectControl.GetSelectedSubjectScheduleItem().Subject;

            if (CertainSubjectTasks.IsChecked != null && !(bool)CertainSubjectTasks.IsChecked)
            {
                CertainSubjectTasks.IsChecked = true;
            }
            AwailableSubjects.SelectedItem = _displayedSubjects.First(subj => subj.SubjectId == selectedSubject.SubjectId);
            TasksTab.IsSelected            = true;
        }
示例#5
0
        private void SubjSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selectedScheduleItem = SubjectControl.GetSelectedSubjectScheduleItem();

            if (selectedScheduleItem == null)
            {
                TimeTableDescriptionType.Text         = "";
                TimeTableDescriptionName.Text         = "";
                TimeTableDescriptionTeacher.Text      = "";
                TimeTableDescriptionNuberOfTasks.Text = "";
                return;
            }
            var selectedItemTeacher =
                _displayedTeachers.First(teach => teach.TeacherId == selectedScheduleItem.Subject.TeacherId);

            TimeTableDescriptionType.Text         = "Type of the subject: " + selectedScheduleItem.PairType.TypeName;
            TimeTableDescriptionName.Text         = "Subject Name: " + selectedScheduleItem.Subject.Name;
            TimeTableDescriptionTeacher.Text      = "Subject Teacher: " + selectedItemTeacher.FirstName + " " + selectedItemTeacher.MiddleName;
            TimeTableDescriptionNuberOfTasks.Text = "Count of tasks: " + _displayedTaskTableItems.Count(item => item.TaskTableItemSubject.SubjectId == selectedScheduleItem.Subject.SubjectId).ToString();
        }