Пример #1
0
        private void BuscarSelecionComBox()
        {
            UtilidadesInt ut = new UtilidadesInt();


            if (FiltrarcomboBox.SelectedIndex == 0)
            {
                if (!String.IsNullOrEmpty(FiltrotextBox.Text))
                {
                    lista = CategoriaBLL.GetLista(ut.StringInt(FiltrotextBox.Text));
                }
                else
                {
                    lista = CategoriaBLL.GetLista();
                }

                ConsultaCategoriadataGridView.DataSource = lista;
            }
            if (FiltrarcomboBox.SelectedIndex == 1)
            {
                if (!String.IsNullOrEmpty(FiltrotextBox.Text))
                {
                    lista = CategoriaBLL.GetListaDescripcion(FiltrotextBox.Text);
                }
                else
                {
                    lista = CategoriaBLL.GetLista();
                }

                ConsultaCategoriadataGridView.DataSource = lista;
            }
        }
Пример #2
0
        private bool validar()
        {
            UtilidadesInt ut = new UtilidadesInt();



            if (string.IsNullOrEmpty(FiltrotextBox.Text))
            {
                BuscarerrorProvider.SetError(FiltrotextBox, "Ingresar el campo que desea filtar");
                return(false);
            }

            if (FiltrarcomboBox.SelectedIndex == 0 && CategoriaBLL.GetLista(ut.StringInt(FiltrotextBox.Text)).Count == 0)
            {
                MessageBox.Show("No hay registros que coincidan con este campo de filtro..." + "\n" + "\n" + "Intente con otro campo");
                return(false);
            }

            if (FiltrarcomboBox.SelectedIndex == 1 && CategoriaBLL.GetListaDescripcion(FiltrotextBox.Text).Count == 0)
            {
                MessageBox.Show("No hay registros que coincidan con este campo de filtro..." + "\n" + "\n" + "Intente con otro campo");
                return(false);
            }



            BuscarerrorProvider.Clear();


            return(true);
        }
 public void GetListaDescripcionTest()
 {
     Assert.IsNotNull(CategoriaBLL.GetListaDescripcion("Piezas").Count > 0);
 }