private void fillDisciplineTextBox(StudentGradesWindow gradesWindow, int i) { string discipline = "Discipline" + i; var disciplineTextBloc = (TextBlock)gradesWindow.FindName(discipline); string gradeDiscipline = StudentGrades[i].Discipline; isTextBoxNull(gradeDiscipline, disciplineTextBloc); }
private void fillGradeTextBox(StudentGradesWindow gradesWindow, int i) { string grade = "Grade" + i; var gradeTextBox = (TextBlock)gradesWindow.FindName(grade); string disciplineGrade = StudentGrades[i].Grade.ToString(); isTextBoxNull(disciplineGrade, gradeTextBox); }
private void fillFormOfControlTextBox(StudentGradesWindow gradesWindow, int i) { string formOfControl = "FormOfControl" + i; var formOfControlTextBox = (TextBlock)gradesWindow.FindName(formOfControl); string gradeFormOfControl = StudentGrades[i].FormOfControl.ToString(); isTextBoxNull(gradeFormOfControl, formOfControlTextBox); }
private void fillLastChangedControlTextBox(StudentGradesWindow gradesWindow, int i) { string lastChanged = "LastChanged" + i; var lastChangedTextBox = (TextBlock)gradesWindow.FindName(lastChanged); string gradeLastChanged = StudentGrades[i].LastChanged.ToString(); isTextBoxNull(gradeLastChanged, lastChangedTextBox); }
private void showStudentGradesButton(object sender, RoutedEventArgs e) { Student student = ((MainWindowViewModel)(DataContext)).Student; StudentGradesWindow gradesWindow = new StudentGradesWindow(); StudentGradesWindowViewModel gradesViewModel = new StudentGradesWindowViewModel(student, gradesWindow); gradesWindow.DataContext = gradesViewModel; gradesWindow.Show(); }
public StudentGradesWindowViewModel(Student student, StudentGradesWindow gradesWindow) { if (student == null) { student = new Student(); gradesWindow = new StudentGradesWindow(); } Student = student; context = new StudentInfoContext(); LoadStudentGrades(gradesWindow); }
private void LoadStudentGrades(StudentGradesWindow gradesWindow) { loadStudentDisciplineGradesFromDb(); for (int i = 0; i < StudentGrades.Count; i++) { fillDisciplineTextBox(gradesWindow, i); fillGradeTextBox(gradesWindow, i); fillFormOfControlTextBox(gradesWindow, i); fillLastChangedControlTextBox(gradesWindow, i); } MessageBox.Show(StudentGrades.Count.ToString()); }