public void GetListTest() { bool paso = false; List <Vehiculos> lista = VehiculoBLL.GetList(l => true); if (lista != null) { paso = true; } Assert.AreEqual(paso, true); }
private void LlenaComboBox() { ArticuloBLL articulos = new ArticuloBLL(); ClienteBLL cliente = new ClienteBLL(); VehiculoBLL vehiculos = new VehiculoBLL(); articuloComboBox.ItemsSource = ArticuloBLL.GetList(a => true); articuloComboBox.DisplayMemberPath = "Articulo"; articuloComboBox.SelectedValuePath = "ArticuloId"; vehiculoComboBox.ItemsSource = VehiculoBLL.GetList(t => true); vehiculoComboBox.DisplayMemberPath = "Descripcion"; vehiculoComboBox.SelectedValuePath = "VehiculoId"; clienteComboBox.ItemsSource = ClienteBLL.GetList(v => true); clienteComboBox.DisplayMemberPath = "Nombre"; clienteComboBox.SelectedValuePath = "ClienteId"; }
private void consultar1Button_Click(object sender, RoutedEventArgs e) { var listado = new List <Vehiculos>(); if (criterioTextBox.Text.Trim().Length > 0) { switch (filtroComboBox.SelectedIndex) { case 0: listado = VehiculoBLL.GetList(p => true); break; case 1: int ID = Convert.ToInt32(criterioTextBox.Text); listado = VehiculoBLL.GetList(p => p.VehiculoId == ID); break; case 2: int Placa = Convert.ToInt32(criterioTextBox.Text); listado = VehiculoBLL.GetList(p => p.VehiculoId == Placa); break; case 3: int Año = Convert.ToInt32(criterioTextBox.Text); listado = VehiculoBLL.GetList(p => p.VehiculoId == Año); break; } listado = listado.Where(c => c.Fecha.Date >= desdeDatePicker.SelectedDate.Value && c.Fecha.Date <= hastaDatePicker.SelectedDate.Value).ToList(); } else { listado = VehiculoBLL.GetList(p => true); } consultarDataGrid.ItemsSource = listado; }