Ejemplo n.º 1
0
        public static void DeleteYear(int year)
        {
            TrimesterCommentModel.DeleteAll(year);
            TrimesterSubjectCommentModel.DeleteAll(year);
            SemiTrimesterCommentModel.DeleteAll(year);
            PeriodCommentModel.DeleteAll(year);
            MarkModel.DeleteAll(year);
            TeacherClassModel.DeleteAll(year);
            LevelSubjectModel.DeleteAll(year);
            SubjectTeacherModel.DeleteAll(year);
            SemiTrimesterModel.DeleteAll(year);
            PeriodModel.DeleteAll(year);
            StudentModel.DeleteAll(year);
            ClassModel.DeleteAll(year);
            LevelModel.DeleteAll(year);
            SubjectModel.DeleteAll(year);
            TeacherModel.DeleteAll(year);
            YearParametersModel.DeleteAll(year);
            YearModel.Delete(year);

            MessageBox.Show("Suppresion de l'année réussie.", "Réussite", MessageBoxButton.OK, MessageBoxImage.Information);

            MainViewModel.Instance.LoadYears();
            MainViewModel.Instance.SelectedYear = year - 1;
        }
Ejemplo n.º 2
0
 private void SaveTrimesterComments(EntryTrimesterCommentsViewModel entryTrimesterComments)
 {
     TrimesterCommentModel.Save(new TrimesterCommentModel()
     {
         DivisionPrefectComment = DivisionPrefectCommentTextBox.Text,
         MainTeacherComment = MainTeacherCommentTextBox.Text,
         Trimester = entryTrimesterComments.SelectedTrimester,
         IdStudent = entryTrimesterComments.SelectedClass.SelectedStudent.Student.Id,
         Year = entryTrimesterComments.SelectedClass.Class.Year,
     });
 }
Ejemplo n.º 3
0
        private void SelectedClass_SelectedStudentChangedEvent()
        {
            EntryTrimesterCommentsViewModel entryTrimesterComments = (EntryTrimesterCommentsViewModel)DataContext;

            TrimesterCommentModel TrimesterComment = TrimesterCommentModel.Read(entryTrimesterComments.SelectedTrimester, entryTrimesterComments.SelectedClass.SelectedStudent.Student);
            if (TrimesterComment != null)
            {
                MainTeacherCommentTextBox.Text = TrimesterComment.MainTeacherComment;
                DivisionPrefectCommentTextBox.Text = TrimesterComment.DivisionPrefectComment;
            }
            else
            {
                MainTeacherCommentTextBox.Text = "";
                DivisionPrefectCommentTextBox.Text = "";
            }
        }