Ejemplo n.º 1
0
        private void ButtonAddStudent_Click(object sender, RoutedEventArgs e)
        {
            var studentWindow = new AddEditStudentWindow(null, _calculator);

            if (studentWindow.ShowDialog() == true)
            {
                _repo.Students.Add(studentWindow.Student);
                UpdateStudentList();
            }
        }
Ejemplo n.º 2
0
        private void ButtonEditStudent_Click_1(object sender, RoutedEventArgs e)
        {
            var selectedStudent = listBoxStudents.SelectedItem as Student;

            if (selectedStudent == null)
            {
                MessageBox.Show("Select a course from the list");
                return;
            }

            var studentWindow = new AddEditStudentWindow(selectedStudent, _calculator);

            if (studentWindow.ShowDialog() == true)
            {
                UpdateStudentList();
            }
        }