Beispiel #1
0
 private void btnBuscarEmpresas_Click(object sender, RoutedEventArgs e)
 {
     if (rdbCuit.IsChecked.Value)
     {
         if (VerificarCampos.Verificarnum(txbBuscarEmpresas.Text))
         {
             lbEmpresas.ItemsSource = EmpresaABM.EmpresasPorAtributo("cuit", txbBuscarEmpresas.Text);
         }
         else
         {
             lblNoticia.Content = "Dni debe contener sólo numeros.";
         }
     }
     else
     {
         if (Helpers.VerificarCampos.Verificarcaracteres(txbBuscarEmpresas.Text) == true)
         {
             lbEmpresas.ItemsSource = EmpresaABM.EmpresasPorAtributo("nombre", txbBuscarEmpresas.Text);
         }
         else
         {
             lblNoticia.Content = "Usuario debe contener sólo letras.";
         }
     }
     if (txbBuscarEmpresas.Text == "")
     {
         Refresh();
     }
     lblNoticia.Content = "Se han encontrado " + lbEmpresas.Items.Count + " Empresas.";
 }
Beispiel #2
0
        private void btnBuscarEmpresas_Click(object sender, RoutedEventArgs e)
        {
            if (Helpers.VerificarCampos.Verificarcaracteres(txbBuscarEmpresas.Text) == true || Helpers.VerificarCampos.Verificarnum(txbBuscarEmpresas.Text) == true || txbBuscarEmpresas.Text == "")
            {
                if (rdbCuit.IsChecked == true)
                {
                    lbEmpresas.ItemsSource = EmpresaABM.EmpresasPorAtributo("cuit", txbBuscarEmpresas.Text);
                }
                else
                {
                    lbEmpresas.ItemsSource = EmpresaABM.EmpresasPorAtributo("nombre", txbBuscarEmpresas.Text);
                }
            }
            else
            {
                lbNoticiaEmpresa.Content = "Dni sólo numero y Nombre sólo letras.";
            }

            if (lbEmpresas.Items.Count == 0)
            {
                lbNoticiaEmpresa.Content = "No Match.";
            }
            else
            {
                lbNoticiaEmpresa.Content = "Se han encontrado " + lbEmpresas.Items.Count + " Coincidencias.";
            }
        }