private async Task BuscarVehiculo() { Vehiculo = await VehiculoBLL.Buscar(Renta.VehiculoId); LlenarCamposVehiculo(); CalcularMontoRenta(); }
private async void InicializarVehiculo(int vehiculoId) { var _vehiculo = await VehiculoBLL.Buscar(vehiculoId); if (_vehiculo != null) { vehiculo = _vehiculo; } else { MessageBox.Show("Este cliente fue eliminado"); } }
public void BuscarTest() { Vehiculos vehiculo = new Vehiculos(); bool paso = false; vehiculo = VehiculoBLL.Buscar(1); if (vehiculo != null) { paso = true; } Assert.AreEqual(paso, true); }
private void buscarButton_Click(object sender, RoutedEventArgs e) { Vehiculos vehiculolocal = VehiculoBLL.Buscar(vehiculos.VehiculoId); if (vehiculolocal != null) { vehiculos = vehiculolocal; LLenar(); } else { LimpiarCampos(); MessageBox.Show("No Encontrado", "Salir", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
private async void InicializarSalidaVehiculo(int SalidaId) { var vehiculo = await VehiculoBLL.Buscar(ID); var _salida = await SalidasVehiculoBLL.Buscar(SalidaId); if (_salida != null) { salida = _salida; } else { MessageBox.Show("Esta salida fue eliminado"); } }
private async void BuscarButton_Click(object sender, RoutedEventArgs e) { if (int.TryParse(VehiculoIdTextBox.Text, out int vehiculoId)) { if (await VehiculoBLL.Existe(vehiculoId)) { vehiculo = await VehiculoBLL.Buscar(vehiculoId); MyPropertyChanged("vehiculo"); } else { MessageBox.Show("Este vehiculo no existe."); Limpiar(); } } else { MessageBox.Show("Este vehiculo id es invalido."); } }
private async Task <bool> Validar() { bool validados = true; string mensaje = "Errores: \n\n"; if (!int.TryParse(RentaIdTextBox.Text, out int RentaId)) { validados = false; mensaje += "\nRenta Id invalido."; } else { if (RentaId < 0) { validados = false; mensaje += "\nRenta Id invalido."; } } if (!int.TryParse(ClienteIdTextBox.Text, out int clienteId)) { validados = false; mensaje += "\nCliente Id invalido."; } else { Cliente cliente = await ClientesBLL.Buscar(clienteId); if (cliente == null) { validados = false; mensaje += "\nEste cliente no existe."; } } if (!int.TryParse(VehiculoIdTextBox.Text, out int vehiculoId)) { validados = false; mensaje += "\nVehículo Id invalido."; } else // TODO: Revisar { Vehiculo vehiculo = await VehiculoBLL.Buscar(vehiculoId); if (vehiculo == null) { validados = false; mensaje += "\nEste vehículo no existe."; } else { if (vehiculo.Estado == VehiculoEstado.Rentado) { validados = false; mensaje += "\nEste vehículo fue rentado."; } else if (vehiculo.Estado == VehiculoEstado.Rentado) { validados = false; mensaje += "\nEste vehículo fue Rentado."; } } } if (Renta.FechaInicial.Date < DateTime.Now.Date) { validados = false; mensaje += "\nLa fecha inicial debe ser mayor que la actual"; } if (Renta.FechaFinal.Date <= Renta.FechaInicial.Date) { validados = false; mensaje += "\nLa fecha final debe ser mayor que la inical"; } if (!validados) { MessageBox.Show(mensaje); } return(validados); }
private bool ExisteEnLaBaseDatos() { Vehiculos vehiculos = VehiculoBLL.Buscar((int)Convert.ToInt32(idTextBox.Text)); return(vehiculos != null); }
private async Task BuscarVehiculo() { Vehiculo = await VehiculoBLL.Buscar(salida.VehiculoId); LlenarCamposVehiculo(); }