private void btnEdit_Click(object sender, RoutedEventArgs e) { try { Car oCar = dtgCars.SelectedItem as Car; ucAddEditCars oucAddEditCars = new ucAddEditCars(oCar, true); winDialog oDialog = new winDialog(oucAddEditCars) { ShowInTaskbar = true, WindowTitle = "Edit a Car", Height = 235, Width = 510 }; oDialog.ShowDialog(); UpdateGrid(); } catch (Exception) { MessageBox.Show("Can not open window to edit car."); } }
private void btnAddCar_Click(object sender, RoutedEventArgs e) { try { Car oCar = new Car(); ucAddEditCars oucAddEditCars = new ucAddEditCars(oCar, false); winDialog oDialog = new winDialog(oucAddEditCars) { ShowInTaskbar = true, WindowTitle = "Add a new Car", Height = 235, Width = 510 }; oDialog.ShowDialog(); UpdateGrid(); } catch (Exception) { MessageBox.Show("Can not open window to add car."); } }
private void btnEdit_Click(object sender, RoutedEventArgs e) { try { Car oCar = dtgCars.SelectedItem as Car; ucAddEditCars oucAddEditCars = new ucAddEditCars(oCar, true); winDialog oDialog = new winDialog(oucAddEditCars) { ShowInTaskbar = true, WindowTitle = "Edit a Car", Height = 235, Width = 510 }; oDialog.ShowDialog(); UpdateGrid(); } catch (Exception) { MessageBox.Show("Can not open window to edit car."); } }
private void btnAddCar_Click(object sender, RoutedEventArgs e) { try { Car oCar = new Car(); ucAddEditCars oucAddEditCars = new ucAddEditCars(oCar, false); winDialog oDialog = new winDialog(oucAddEditCars) { ShowInTaskbar = true, WindowTitle = "Add a new Car", Height = 235, Width = 510 }; oDialog.ShowDialog(); UpdateGrid(); } catch (Exception) { MessageBox.Show("Can not open window to add car."); } }