/* добавление клиента */ private void AddClientBtn_Click(object sender, RoutedEventArgs e) { var editClientForm = new editClient(null, clientsWindow); editClientForm.Owner = this; editClientForm.WindowStartupLocation = WindowStartupLocation.CenterOwner; editClientForm.ShowDialog(); }
/* редактирование клиента */ private void EditClientBtn_Click(object sender, RoutedEventArgs e) { if (clientsList.SelectedItem != null) { var id = (clientsList.SelectedItem as Client).Id; var editClientForm = new editClient(id, clientsWindow); editClientForm.Owner = this; editClientForm.WindowStartupLocation = WindowStartupLocation.CenterOwner; editClientForm.ShowDialog(); } else { MessageBox.Show("Клиент не выбран!", "Предупреждение", MessageBoxButton.OK); } }