private void btn_AgregarVehiculo_Click(object sender, RoutedEventArgs e) { Vehiculo nuevoVehiculo = new Vehiculo(); AgregarVehiculo vehiculo = new AgregarVehiculo(this, true, nuevoVehiculo); vehiculo.Show(); }
private void btn_EditarVehiculo_Click(object sender, RoutedEventArgs e) { int index = dg_Vehiculos.SelectedIndex; if (index >= 0) { Vehiculo vehiculo = listVehiculo[index]; Boolean resultado = false; AgregarVehiculo av = new AgregarVehiculo(this, false, vehiculo); av.ShowDialog(); resultado = av.Resultado; if (resultado) { this.cargarTablaVehiculos(); } } else { MessageBox.Show("Seleccione un vehiculo"); } }