예제 #1
0
        private void ConsultarButton_Click(object sender, RoutedEventArgs e)
        {
            var listado = new List <Orden>();

            if (CriterioTextBox.Text.Trim().Length > 0)
            {
                switch (FiltroComboBox.SelectedIndex)
                {
                case 0:    //todo
                    listado = OrdenBLL.GetList(p => true);
                    break;

                case 1:    //ID
                    int id = Convert.ToInt32(CriterioTextBox.Text);
                    listado = OrdenBLL.GetList(p => p.OrdenId == id);
                    break;

                case 2:    //Fecha
                    DateTime fecha = Convert.ToDateTime(CriterioTextBox.Text);
                    listado = OrdenBLL.GetList(p => p.Fecha == fecha);
                    break;
                }
            }
            else
            {
                listado = OrdenBLL.GetList(p => true);
            }

            ConsultaDataGrid.ItemsSource = null;
            ConsultaDataGrid.ItemsSource = listado;
        }
예제 #2
0
        private void BucarButton_Click(object sender, RoutedEventArgs e)
        {
            var listado = new List <Orden>();

            if (CriterioTextBox.Text.Trim().Length > 0)
            {
                switch (FiltroComboBox.SelectedIndex)
                {
                case 0:
                    listado = OrdenBLL.GetList(x => true);
                    break;

                case 1:
                    int id;
                    id      = int.Parse(CriterioTextBox.Text);
                    listado = OrdenBLL.GetList(x => x.OrdenId == id);
                    break;

                case 2:
                    int clienteid;
                    clienteid = int.Parse(CriterioTextBox.Text);
                    listado   = OrdenBLL.GetList(x => x.ClienteId == clienteid);
                    break;
                }
            }
            else
            {
                listado = OrdenBLL.GetList(p => true);
            }
            ConsultarDataGrid.ItemsSource = null;
            ConsultarDataGrid.ItemsSource = listado;
        }
예제 #3
0
        public void GetListTest()
        {
            var lista = new List <Ordene>();

            lista = OrdenBLL.GetList(p => true);

            Assert.IsNotNull(lista);
        }
        public void GetListTest()
        {
            bool paso = false;

            List <Ordenes> ordenes = OrdenBLL.GetList(o => true);

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

            Assert.AreEqual(paso, true);
        }