Beispiel #1
0
        private void AddNewStudentButton_Click(object sender, RoutedEventArgs e)
        {
            var addStudnetWindow = new AddStudentWindow();

            addStudnetWindow.AddStudent += new AddStudentHandler(AddStudentHandler);
            addStudnetWindow.ShowDialog();
        }
Beispiel #2
0
        private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var dg       = sender as DataGrid;
            var selected = dg.SelectedItem;

            if (selected != null)
            {
                var student   = selected as Structures.Student;
                var addWindow = new AddStudentWindow(student);
                addWindow.UpdateStudent += new UpdateStudentHandler(UpdateStudentHandler);
                addWindow.ShowDialog();
            }
        }
Beispiel #3
0
        private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var dg       = sender as DataGrid;
            var selected = dg.SelectedItem;

            if (selected != null)
            {
                var student = selected as Student;
                connection.context.Students.Attach(student);
                var addWindow = new AddStudentWindow(student, Studies);
                addWindow.ShowDialog();
            }
        }
        private void ChangeButton_Click(object sender, RoutedEventArgs e)
        {
            var     Window           = new AddStudentWindow();
            Student SelectedStudent  = null;
            var     SelectedStudents = StudentsDataGrid.SelectedItems;

            if (SelectedStudents.Count == 0)
            {
                MessageBox.Show("Nie wybrano żadnego studenta!");
                return;
            }
            else
            if (SelectedStudents.Count > 1)
            {
                MessageBox.Show("Wybrano zbyt wielu studentów!");
                return;
            }
            else
            {
                SelectedStudent = (Student)StudentsDataGrid.SelectedItem;
            }

            Window.Open(ListaStudentow, SelectedStudent);
        }
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            var Window = new AddStudentWindow();

            Window.Open(ListaStudentow, null);
        }