private void addTransportButton_Click(object sender, RoutedEventArgs e) { AddTransportWindow form = new AddTransportWindow(); form.ShowDialog(); this.ShowAll(); }
private void editTransportButton_Click(object sender, RoutedEventArgs e) { if (transportsGrid.SelectedItem != null) { var edit = (Transport)transportsGrid.SelectedItem; AddTransportWindow form = new AddTransportWindow(DBContext.Orders.Find(edit.ID).ID); form.ShowDialog(); } else { MessageBox.Show("Не выбрано поле для редактирования", "Ошибка"); } this.ShowAll(); }