示例#1
0
        public void GetListTest()
        {
            bool paso = false;

            List <Vehiculos> lista = VehiculoBLL.GetList(l => true);

            if (lista != null)
            {
                paso = true;
            }

            Assert.AreEqual(paso, true);
        }
示例#2
0
        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";
        }
示例#3
0
        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;
        }