Exemplo n.º 1
0
        private bool validar()
        {
            if (FiltrocomboBox.SelectedIndex == 3)
            {
                if (DesdeDateTimePicke.Value == HastadateTimePicker.Value)
                {
                    MessageBox.Show("Favor colocar un intervalo entre las dos fechas");
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            if (string.IsNullOrEmpty(FiltrotextBox.Text))
            {
                BuscarerrorProvider.SetError(FiltrotextBox, "Ingresar el campo que desea filtar");
                return(false);
            }

            if (FiltrocomboBox.SelectedIndex == 1 && FacturasBLL.GetListClienteId(StringToInt(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 (FiltrocomboBox.SelectedIndex == 0 && FacturasBLL.GetListId(StringToInt(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);
        }
Exemplo n.º 2
0
 private void BuscarSeleccion()
 {
     if (FiltrocomboBox.SelectedIndex == 0)
     {
         FacturadataGridView.DataSource = FacturasBLL.GetListId(StringToInt(FiltrotextBox.Text));
     }
     if (FiltrocomboBox.SelectedIndex == 1)
     {
         FacturadataGridView.DataSource = FacturasBLL.GetListClienteId(StringToInt(FiltrotextBox.Text));
     }
     if (FiltrocomboBox.SelectedIndex == 2)
     {
         FacturadataGridView.DataSource = FacturasBLL.GetListFecha(DesdeDateTimePicke.Value, HastadateTimePicker.Value);
     }
 }