private void copy_Click(object sender, RoutedEventArgs e) { if (dg.SelectedIndex > -1) { StudentsDialog dialog = new StudentsDialog(mode.Copy, this, (int)dg.SelectedValue); dialog.ShowDialog(); } else { MessageBox.Show("Не выбрано поле!"); } }
private void add_Click(object sender, RoutedEventArgs e) { StudentsDialog dialog = new StudentsDialog(mode.Add, this); dialog.ShowDialog(); }
private void Dg_MouseDoubleClick(object sender, MouseButtonEventArgs e) { StudentsDialog dialog = new StudentsDialog(mode.Update, this, (int)dg.SelectedValue); dialog.ShowDialog(); }