protected void btnCarregar_Click(object sender, EventArgs e) { try { FuncionarioClient client = new FuncionarioClient(); GridViewfuncionario.DataSource = client.ListarFuncionario(); GridViewfuncionario.DataBind(); } catch (Exception ex) { } }
public void AddMensagens(Mensagem msn) { try { EndpointAddress address = new EndpointAddress(serverEndPont); Binding binding = new NetTcpBinding(); FuncionarioClient proxy = new FuncionarioClient(new InstanceContext(this), "tcpPentagoService"); proxy.Open(); proxy.AddMensagens(msn); proxy.Close(); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
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); } }