Advertisement
Guest User

Rotina do Botao Pesquisar

a guest
Jan 11th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. protected void cmdPesquisar_Click(object sender, EventArgs e)
  2. {
  3. ClienteNE clienteNE = new ClienteNE();
  4. Cliente cliente = new Cliente();
  5. string valorBusca = txtPesquisar.Text;
  6.  
  7. if (valorBusca != string.Empty)
  8. {
  9. bool isnumeric = Information.IsNumeric(valorBusca);
  10. if (isnumeric)
  11. {
  12. if (valorBusca.Length == 11 || valorBusca.Length == 14)
  13. {
  14. cliente.cpf = valorBusca;
  15.  
  16. /*
  17. AQUI COMO EXIBIR O RESULTADO NO GRID
  18. AXO QUE SERIA ALGO +/- ASSIM
  19. */
  20.  
  21. ObjectDataSource.Parametro = clienteNE.ListaCliente(cliente,idEmpresa);
  22. }
  23. else
  24. {
  25. ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "msgbox", "alert('CPF/CNPJ Invalido')", true);
  26. }
  27. }
  28. else
  29. {
  30.  
  31. cliente.razaoSocail = valorBusca;
  32.  
  33. /*
  34. AQUI COMO EXIBIR O RESULTADO NO GRID
  35. AXO QUE SERIA ALGO +/- ASSIM
  36. */
  37.  
  38. ObjectDataSource.Parametro = clienteNE.ListaCliente(cliente,idEmpresa);
  39. }
  40.  
  41.  
  42. cmdTodosClientes.CssClass = "button small orange";
  43. }
  44. else
  45. {
  46.  
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement