internal async void Nuevo() { //if (ListaVehiculos.Exists(x => x.Matricula == VehiculoSelected.Matricula)) //{ // MessageBox.Show("Coche existente"); //} //else //{ try { VehiculoDTO v = await _webApiClient.CreateVehiculo(VehiculoSelected); //Si el coche devuelto !=null es porque se creo y lo añadimos a la collection observable if (v != null) { ListaVehiculos.Add(v); } else { MessageBox.Show("Coche existente"); } } catch (WebApiException e) { MessageBox.Show(e.Message); } }
public void LimpiarCampos() { LblMarca.Text = ""; LblModelo.Text = ""; LblPrecio.Text = ""; LblCantidad.Text = ""; TxtIdentificacion.Text = ""; ListaVehiculos.SelectedIndex = 0; ListaVehiculos.Dispose(); }
public void GetListadoVehiculos() { if (!string.IsNullOrEmpty(Vehiculo.IDVehiculo)) { var item = ListaVehiculos.FirstOrDefault(v => v.IDVehiculo == Vehiculo.IDVehiculo); if (item == null) { ListaVehiculos.Add(Vehiculo); ListaVehiculos = ListaVehiculos.OrderBy(v => v.nombreMarca).ToList(); } } CatVehiculoModels vPredeterminado = new CatVehiculoModels { IDVehiculo = string.Empty, nombreMarca = "SELECCIONE UN VEHICULOS", Modelo = "GRUPO OCAMPO" }; ListaVehiculos.Insert(0, vPredeterminado); }