Beispiel #1
0
 protected void btnCarregar_Click(object sender, EventArgs e)
 {
     try
     {
         FuncionarioClient client = new FuncionarioClient();
         GridViewfuncionario.DataSource = client.ListarFuncionario();
         GridViewfuncionario.DataBind();
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #2
0
        protected void btnSelecionar_Click(object sender, EventArgs e)
        {
            try
            {
                char[]        separators = { ',', '.', '!', '?', ';', ':', ' ' };
                List <string> lstr       = new List <string>();
                lstr.AddRange(txtBuscar.Text.Split(separators));
                var listFunc             = new List <Funcionario>();
                FuncionarioClient client = new FuncionarioClient();

                foreach (var item in lstr)
                {
                    listFunc.Add(client.SelecioarFuncionario(Convert.ToInt32(item)));
                }

                GridViewfuncionario.DataSource = listFunc;
                GridViewfuncionario.DataBind();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }