Exemplo n.º 1
0
 private void txtBuscar_KeyUp(object sender, KeyEventArgs e)
 {
     try
     {
         EventoAnimal_DescSubevento_Negocio eventoNegocio = new EventoAnimal_DescSubevento_Negocio();
         if (this.cbBuscar.SelectedIndex == -1)
         {
             this.txtBuscar.Enabled = false;
             //MessageBox.Show("Debe seleccionar un parámetro a buscar en el combo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else if (this.cbBuscar.SelectedItem.ToString() == "Nombre animal")
         {
             this.dgvEventos.DataSource = eventoNegocio.FiltrarPorNombreAnimal(this.txtBuscar.Text, idtambo);
         }
         else if (this.cbBuscar.SelectedItem.ToString() == "Evento")
         {
             this.dgvEventos.DataSource = eventoNegocio.FiltrarPorNombreEvento(this.txtBuscar.Text, idtambo);
         }
         else if (this.cbBuscar.SelectedItem.ToString() == "Caravana")
         {
             this.dgvEventos.DataSource = eventoNegocio.FiltrarPorCaravana(this.txtBuscar.Text, idtambo);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ocurrió un error", MessageBoxButtons.OK);
     }
 }
Exemplo n.º 2
0
 private void tstxtBuscar_KeyUp(object sender, KeyEventArgs e)
 {
     try
     {
         EventoAnimal_DescSubevento_Negocio eventoNegocio = new EventoAnimal_DescSubevento_Negocio();
         this.dgvEventos.DataSource = eventoNegocio.FiltrarPorNombreEvento(this.tstxtBuscar.Text, idtambo);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ocurrió un error", MessageBoxButtons.OK);
     }
 }