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; }
private void SaveTrimesterSubjectComments(EntryTrimesterSubjectCommentsViewModel entryTrimesterSubjectComments) { TrimesterSubjectCommentModel.Save(new TrimesterSubjectCommentModel() { Comment = CommentTextBox.Text, Trimester = entryTrimesterSubjectComments.SelectedTrimester, IdStudent = entryTrimesterSubjectComments.SelectedClass.SelectedStudent.Student.Id, IdSubject = entryTrimesterSubjectComments.SelectedClass.SelectedStudent.SelectedTrimesterSubjectCommentsSubject.Subject.Id, Year = entryTrimesterSubjectComments.SelectedTeacher.Year, }); }
private void SelectedStudent_SelectedSubjectChangedEvent() { EntryTrimesterSubjectCommentsViewModel entryTrimesterSubjectComments = (EntryTrimesterSubjectCommentsViewModel)DataContext; if (entryTrimesterSubjectComments.SelectedClass != null) { TrimesterSubjectCommentModel trimesterSubjectComment = TrimesterSubjectCommentModel.Read(entryTrimesterSubjectComments.SelectedTrimester, entryTrimesterSubjectComments.SelectedClass.SelectedStudent.Student, entryTrimesterSubjectComments.SelectedClass.SelectedStudent.SelectedTrimesterSubjectCommentsSubject.Subject); if (trimesterSubjectComment != null) { CommentTextBox.Text = trimesterSubjectComment.Comment; } else { CommentTextBox.Text = ""; } } }