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