protected void Blogin_Click(object sender, EventArgs e) { if (TBNovaSenha.Text.Length < 5) { LResult.Text = "A nova senha precisa ter pelo menos 5 caracteres!"; return; } if (TBNovaSenha.Text.CompareTo(TBNovaSenha2.Text) == 0) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LResult.Text = "Resultado: " + cliente.alteraSenha(GlobalVar.EmailMembroAutenticado, TBSenha.Text, TBNovaSenha.Text); if (LResult.Text.CompareTo("Resultado: Senha alterada com sucesso!") == 0) { GlobalVar.MembroAutenticado = true; TBSenha.Text = ""; TBNovaSenha.Text = ""; TBNovaSenha2.Text = ""; } } else { LResult.Text = "Resultado: As novas senhas não conferem!"; } }
protected void btnExcluirMembro_click(object sender, EventArgs e) { Button btn = (Button)sender; WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LUltimaAcao.Text = "Última ação: " + cliente.retiraMembroTurma(btn.CommandArgument, GlobalVar.TurmaAAssociar); }
protected void BIncluirMembro_Click(object sender, EventArgs e) { if (TBTituloPesquisa.Text.Length < 5) { LResultado.Text = "Resultado: O título da pesquisa deve ter pelo menos 5 caracteres!"; return; } if (TBDescricaoPesquisa.Text.Length < 10) { LResultado.Text = "Resultado: A descrição (pergunta) deve ter pelo menos 10 caracteres!"; return; } WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string result = cliente.adicionaPesquisa(GlobalVar.TurmaAAssociar, TBTituloPesquisa.Text, TBDescricaoPesquisa.Text, TBData.Text); LResultado.Text = "Resultado: " + result; if (result.CompareTo("Pesquisa adicionada com sucesso!") == 0) { TBData.Text = ""; TBDescricaoPesquisa.Text = ""; TBTituloPesquisa.Text = ""; } }
public void autenticaMembroTest_Success() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); bool result = cliente.autenticaMembro("*****@*****.**", "123"); Assert.AreEqual(true, result); }
protected void btn_click(object sender, EventArgs e) { Button btn = (Button)sender; WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LUltimaAcao.Text = "Última ação: " + cliente.associaMembroTurma(btn.ID, GlobalVar.TurmaAAssociar); }
protected void btnNao_click(object sender, EventArgs e) { Button btn = (Button)sender; WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LResult.Text = cliente.adicionaVotoPesquisa(GlobalVar.TurmaAAssociar, btn.CommandArgument, GlobalVar.EmailMembroAutenticado, false); }
protected void BCriaTurma_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); if (TBTurma.Text.Length < 5) { LResultado.Text = "Resultado: A descrição da turma deve ter pelo menos 5 caracteres!"; return; } LResultado.Text = "Resultado: " + cliente.criarTurma(TBTurma.Text); }
protected void resultadoPesquisa() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); String result = cliente.resultadoPesquisa(GlobalVar.TurmaAAssociar, GlobalVar.idPesquisa); result = result.Replace(" ", "|"); result = result.Replace(":", ""); result = result.Replace("Não|votaram", "Não votaram"); string[] t = result.Split(new Char[] { '|' }); TPesquisa.BorderStyle = BorderStyle.Solid; TPesquisa.BorderWidth = 1; TableRow tRow = new TableRow(); TableCell tCell = new TableCell(); int cor = 0; for (int i = 0; i < t.Length; i += 2) { //a estrutra da linha é sempre Nome|senha|email|tipo if ((!String.IsNullOrEmpty(t[i])) & (t[i].CompareTo("\0") != 0)) { tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderColor = Color.Black; tRow.BackColor = (cor % 2 == 0 ? Color.White : Color.FromArgb(100, 196, 210)); tRow.BorderWidth = 1; TPesquisa.Rows.Add(tRow); tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; Label l = new Label { ID = "L" + t[i], Text = t[i] }; tCell.Controls.Add(l); tRow.Cells.Add(tCell); tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; l = new Label { ID = "L" + t[i + 1], Text = t[i + 1] }; tCell.Controls.Add(l); tRow.Cells.Add(tCell); cor++; } } }
protected void BBoletim_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string boletim = cliente.presencaBoletim(GlobalVar.TurmaAAssociar, Convert.ToInt32(DDLFiltro.SelectedValue)); if (!String.IsNullOrEmpty(boletim)) { boletim = boletim.Replace("&", "<br>"); boletim = boletim.Replace("-----", "<br>"); boletim = boletim.Replace("|F", " - Falta"); boletim = boletim.Replace("|P", " - Presença"); LBoletim.Text = boletim; } }
protected void BIncluirMembro_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); if (TBNomeMembro.Text.Length < 3) { LResultado.Text = "Resultado: Preencha o nome do membro!"; return; } if (TBEmailMembro.Text.Length < 3) { LResultado.Text = "Resultado: Preencha o e-mail do membro!"; return; } LResultado.Text = "Resultado: " + cliente.criarMembro(TBNomeMembro.Text, TBEmailMembro.Text, Convert.ToInt32(DDLTipoMembro.SelectedValue)); }
protected void Blogin_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); if (cliente.autenticaMembro(TBemail.Text, TBSenha.Text)) { GlobalVar.MembroAutenticado = true; string dados = cliente.dadosMembro(TBemail.Text); string[] d = dados.Split(new Char[] { '|' }); GlobalVar.TipoMembro = Convert.ToInt32(d[2]); GlobalVar.NomeMembroAutenticado = d[0]; GlobalVar.EmailMembroAutenticado = d[1]; //Indicar o nome do membro que se autenticou no form if (TBSenha.Text.CompareTo("password") == 0) { GlobalVar.MembroAutenticado = false; Server.Transfer("frmAlteraSenha.aspx", true); } //se for professor é direcionado para o form de turmas if (GlobalVar.TipoMembro == 0) { Server.Transfer("frmTurma.aspx", true); } //se for aluno deve ser direcionado para as minhas turmas if (GlobalVar.TipoMembro == 1) { Server.Transfer("frmTurmasMembro.aspx", true); } } else { GlobalVar.MembroAutenticado = false; GlobalVar.TipoMembro = 3; GlobalVar.NomeMembroAutenticado = ""; GlobalVar.EmailMembroAutenticado = ""; LResult.Text = "Resultado: Usuário e senha não conferem!"; } }
protected void BConfirmar_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LResult.Text = "Resultado: " + cliente.excluirPesquisa(GlobalVar.TurmaAAssociar, GlobalVar.idPesquisa); Server.Transfer("frmAssociaPesquisaTurma.aspx", true); }
protected void BConfirmar_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LResult.Text = "Resultado: " + cliente.exlcuirMembro(GlobalVar.emailMembroAExlcuir); LResult.Text = LResult.Text.Replace("|", "<br><br>"); }
protected void carregaPesquisas() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string pesquisas = cliente.listaPesquisasDaTurma(GlobalVar.TurmaAAssociar); if (pesquisas.CompareTo("Não existem pesquisas associados a esta turma!") != 0) { string[] p = pesquisas.Split(new Char[] { '&' }); TPesquisas.BorderStyle = BorderStyle.Solid; TPesquisas.BorderWidth = 1; TableRow tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderWidth = 1; tRow.BackColor = Color.FromArgb(16, 148, 171); TPesquisas.Rows.Add(tRow); TableCell tCell = new TableCell(); tCell.Text = "ID Pesquisa"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Título"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Descrição (pergunta)"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Data Final Para Votação"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Resultado"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Excluir Pesquisa"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); for (int i = 0; i < p.Length; i++) { if ((!String.IsNullOrEmpty(p[i])) & (p[i].CompareTo("\0") != 0)) { string[] pDados = p[i].Split(new Char[] { '|' }); tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderColor = Color.Black; tRow.BackColor = (i % 2 == 0 ? Color.White : Color.FromArgb(100, 196, 210)); tRow.BorderWidth = 1; //id da pesquisa TPesquisas.Rows.Add(tRow); tCell = new TableCell(); tCell.Text = pDados[0]; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); //titulo da pesquisa TPesquisas.Rows.Add(tRow); tCell = new TableCell(); tCell.Text = pDados[1]; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); //descricao da pesquisa tCell = new TableCell(); tCell.Text = pDados[2]; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); //data final para votação tCell = new TableCell(); tCell.Text = pDados[3]; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); //Botão para ver resultado tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; Button bresultado = new Button { ID = "BR" + pDados[0], Text = "Resultado", CommandArgument = pDados[0] }; bresultado.Click += new EventHandler(btnResultado_click); tCell.Controls.Add(bresultado); tRow.Cells.Add(tCell); //Botão para excluir pesquisa tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; Button bExlcuiPesq = new Button { ID = "BExlcuiPesquisa" + pDados[0], Text = "Excluir Pesquisa", CommandArgument = pDados[0] }; bExlcuiPesq.Click += new EventHandler(btnExcluiPesquisa_click); tCell.Controls.Add(bExlcuiPesq); tRow.Cells.Add(tCell); } } } }
protected void BPresenca_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LResult.Text = "Resultado: " + cliente.presencaAtualiza(GlobalVar.TurmaAAssociar, GlobalVar.EmailMembroAutenticado, TBCodigo.Text); }
protected void BCancelar_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LResult.Text = "Resultado: " + cliente.presencaFinaliza(GlobalVar.TurmaAAssociar); Server.Transfer("frmTurma.aspx", true); }
protected void BConfirmar_Click(object sender, EventArgs e) { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); LResult.Text = "Resultado: " + cliente.presencaInicia(GlobalVar.TurmaAAssociar); }
protected void carregaTurmas() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string turmas = cliente.listaTurmasPorMembro(GlobalVar.EmailMembroAutenticado); if (turmas.Length > 3) { string[] t = turmas.Split(new Char[] { '|' }); TTurmas.BorderStyle = BorderStyle.Solid; TTurmas.BorderWidth = 1; TableRow tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderWidth = 1; tRow.BackColor = Color.FromArgb(16, 148, 171); TTurmas.Rows.Add(tRow); TableCell tCell = new TableCell(); tCell.Text = "Turma"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Pesquisas"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Presença"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); for (int i = 0; i < t.Length; i++) { //a estrutra da linha é sempre Nome|senha|email|tipo if ((!String.IsNullOrEmpty(t[i])) & (t[i].CompareTo("\0") != 0)) { tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderColor = Color.Black; tRow.BackColor = (i % 2 == 0 ? Color.White : Color.FromArgb(100, 196, 210)); tRow.BorderWidth = 1; TTurmas.Rows.Add(tRow); //label da turma tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; Label l = new Label { ID = "L" + t[i], Text = t[i] }; tCell.Controls.Add(l); tRow.Cells.Add(tCell); //Botões acessar as pesquisas desta turma tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; Button b = new Button { ID = "AP" + t[i], Text = "Pesquisas", CommandArgument = t[i] }; b.Click += new EventHandler(btn_click); tCell.Controls.Add(b); tRow.Cells.Add(tCell); //Botões acessar as presencas tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; b = new Button { ID = "Presenca" + t[i], Text = "Presença", CommandArgument = t[i] }; b.Click += new EventHandler(btnPresenca_click); tCell.Controls.Add(b); tRow.Cells.Add(tCell); } } } }
protected void carregaPesquisas() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string listaPesquisas = cliente.listaPesquisaPorTurmaMembro(GlobalVar.TurmaAAssociar, GlobalVar.EmailMembroAutenticado); if (listaPesquisas.Length > 3) { string[] pesquisas = listaPesquisas.Split(new Char[] { '&' }); TPesquisas.BorderStyle = BorderStyle.Solid; TPesquisas.BorderWidth = 1; TableRow tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderWidth = 1; tRow.BackColor = Color.FromArgb(16, 148, 171); TPesquisas.Rows.Add(tRow); TableCell tCell = new TableCell(); tCell.Text = "ID Pesquisa"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Título da Pesquisa"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Descrição da Pesquisa (pergunta/enquete)"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Data Final Para Responder"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Resposta (Sim)"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Resposta (Não)"; tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); for (int i = 0; i < pesquisas.Length; i++) { //a estrutra da linha é sempre Nome|senha|email|tipo if ((!String.IsNullOrEmpty(pesquisas[i])) & (pesquisas[i].CompareTo("\0") != 0)) { string[] pesquisa = pesquisas[i].Split(new Char[] { '|' }); if (pesquisa.Length > 1) { tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderColor = Color.Black; tRow.BackColor = (i % 2 == 0 ? Color.White : Color.FromArgb(100, 196, 210)); tRow.BorderWidth = 1; TPesquisas.Rows.Add(tRow); //formato dos dados Ex: //1|Pesquisa 1|Pesquisa 1|2015-04-05 //ID da pesquisa tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = pesquisa[0]; tRow.Cells.Add(tCell); //Título da pesquisa tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = pesquisa[1]; tRow.Cells.Add(tCell); //Descricao da pesquisa tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = pesquisa[2]; tRow.Cells.Add(tCell); //Data da pesquisa tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = pesquisa[3]; tRow.Cells.Add(tCell); //Botão para votar sim tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; Button b = new Button { ID = "BVS" + pesquisa[0], Text = "SIM", CommandArgument = pesquisa[0] }; b.Click += new EventHandler(btnSim_click); tCell.Controls.Add(b); tRow.Cells.Add(tCell); //Botão para votar não tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; b = new Button { ID = "BVN" + pesquisa[0], Text = "NÃO", CommandArgument = pesquisa[0] }; b.Click += new EventHandler(btnNao_click); tCell.Controls.Add(b); tRow.Cells.Add(tCell); } } } } }
protected void todosMembrosTurma() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string membros = cliente.dadosTodosMembrosTurma(GlobalVar.TurmaAAssociar); if (membros.CompareTo("Não existem alunos associados a esta turma!") != 0) { string[] m = membros.Split(new Char[] { '&' }); TMembrosAssociados.BorderStyle = BorderStyle.Solid; TMembrosAssociados.BorderWidth = 1; TableRow tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderWidth = 1; tRow.BackColor = Color.FromArgb(16, 148, 171); TMembrosAssociados.Rows.Add(tRow); //nome do membro TableCell tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Nome do Membro"; tRow.Cells.Add(tCell); //email do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Email do Membro"; tRow.Cells.Add(tCell); //tipo do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Tipo do Membro"; tRow.Cells.Add(tCell); //botão de exlcuir membro desta turma tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Excluir Membro"; tRow.Cells.Add(tCell); for (int i = 0; i < m.Length; i++) { if ((!String.IsNullOrEmpty(m[i])) & (m[i].CompareTo("\0") != 0)) { string[] mIndividual = m[i].Split(new Char[] { '|' }); if (String.IsNullOrEmpty(tb_email1.Text)) { goto Inclui; } else if (mIndividual[1].IndexOf(tb_email1.Text) > -1) { goto Inclui; } else { goto Proximo; } Inclui: tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderColor = Color.Black; tRow.BackColor = (i % 2 == 0 ? Color.White : Color.FromArgb(100, 196, 210)); tRow.BorderWidth = 1; TMembrosAssociados.Rows.Add(tRow); //nome do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = mIndividual[0]; tRow.Cells.Add(tCell); //email do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = mIndividual[1]; tRow.Cells.Add(tCell); string tipoMembro = ""; if (mIndividual[2].CompareTo("0") == 0) { tipoMembro = "Professor(a)"; } else { tipoMembro = "Aluno(a)"; } //tipo do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = tipoMembro; tRow.Cells.Add(tCell); //botão para excluir membro da turma tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; Button b = new Button { ID = "ExCluirMembro" + mIndividual[1], Text = "Excluir Membro", CommandArgument = mIndividual[1] }; b.Click += new EventHandler(btnExcluirMembro_click); tCell.Controls.Add(b); tRow.Cells.Add(tCell); Proximo :; } } } }
protected void carregaTurmas() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string turmas = cliente.listaTurmas(); if (turmas.Length > 3) { string[] t = turmas.Split(new Char[] { '|' }); TTurmas.BorderStyle = BorderStyle.Solid; TTurmas.BorderWidth = 1; TableRow tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderWidth = 1; tRow.BackColor = Color.FromArgb(16, 148, 171); TTurmas.Rows.Add(tRow); TableCell tCell = new TableCell(); tCell.Text = "Turma"; //tCell.BorderStyle = BorderStyle.Solid; //tCell.BorderWidth = 1; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Membros"; //tCell.BorderStyle = BorderStyle.Solid; //tCell.BorderWidth = 1; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Pesquisas"; //tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Excluir Turma"; //tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Chamada"; //tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); tCell = new TableCell(); tCell.Text = "Frequência"; //tCell.BorderStyle = BorderStyle.None; tRow.Cells.Add(tCell); for (int i = 0; i < t.Length; i++) { //a estrutra da linha é sempre Nome|senha|email|tipo if ((!String.IsNullOrEmpty(t[i])) & (t[i].CompareTo("\0") != 0)) { if (String.IsNullOrEmpty(tb_filtro.Text)) { goto Inclui; } else if (t[i].IndexOf(tb_filtro.Text) > -1) { goto Inclui; } else { goto Proximo; } Inclui: tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderColor = Color.Black; tRow.BackColor = (i % 2 == 0 ? Color.White : Color.FromArgb(100, 196, 210)); tRow.BorderWidth = 1; TTurmas.Rows.Add(tRow); //label da turma tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; Label l = new Label { ID = "L" + t[i], Text = t[i] }; tCell.Controls.Add(l); tRow.Cells.Add(tCell); //Botões de associar membro com a turma tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; Button b = new Button { ID = "AM" + t[i], Text = "Membros", CommandArgument = t[i] }; b.Click += new EventHandler(btn_click); tCell.Controls.Add(b); tRow.Cells.Add(tCell); //Botôes de associar pesquisa com a turma tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; Button bpesq = new Button { ID = "AP" + t[i], Text = "Pesquisas", CommandArgument = t[i] }; bpesq.Click += new EventHandler(btnPesq_click); tCell.Controls.Add(bpesq); tRow.Cells.Add(tCell); //Botôes de exlcuir turma tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; Button bexlcuiTurma = new Button { ID = "ExcluirTurma" + t[i], Text = "Excluir Turma", CommandArgument = t[i] }; bexlcuiTurma.Click += new EventHandler(btnExcluiTurma_click); tCell.Controls.Add(bexlcuiTurma); tRow.Cells.Add(tCell); //Botôes de chamada tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; Button bchamada = new Button { ID = "Chamada" + t[i], Text = "Chamada", CommandArgument = t[i] }; bchamada.Click += new EventHandler(btnChamada_click); tCell.Controls.Add(bchamada); tRow.Cells.Add(tCell); //Botôes de chamada tCell = new TableCell(); //tCell.BorderStyle = BorderStyle.None; Button bboletim = new Button { ID = "Boletim" + t[i], Text = "Frequência", CommandArgument = t[i] }; bboletim.Click += new EventHandler(btnBoletimFaltas_click); tCell.Controls.Add(bboletim); tRow.Cells.Add(tCell); Proximo :; } } } }
protected void todosMembros() { WSAppTTSCP.WSAppTTSCPSoapClient cliente = new WSAppTTSCP.WSAppTTSCPSoapClient(); string membros = cliente.dadosTodosMembros(); if (membros.CompareTo("Não existem membros cadastrados!") != 0) { string[] m = membros.Split(new Char[] { '&' }); TTodosOsMembros.BorderStyle = BorderStyle.Solid; TTodosOsMembros.BorderWidth = 1; TableRow tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderWidth = 1; tRow.BackColor = Color.FromArgb(16, 148, 171); TTodosOsMembros.Rows.Add(tRow); //nome do membro TableCell tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Nome do Membro"; tRow.Cells.Add(tCell); //email do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Email do Membro"; tRow.Cells.Add(tCell); //tipo do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Tipo do Membro"; tRow.Cells.Add(tCell); //botão de adicionar membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = "Incluir Membro"; tRow.Cells.Add(tCell); for (int i = 0; i < m.Length; i++) { if ((!String.IsNullOrEmpty(m[i])) & (m[i].CompareTo("\0") != 0)) { string[] mIndividual = m[i].Split(new Char[] { '|' }); if (String.IsNullOrEmpty(tb_email2.Text)) { goto Inclui; } else if (mIndividual[1].IndexOf(tb_email2.Text) > -1) { goto Inclui; } else { goto Proximo; } Inclui: tRow = new TableRow(); tRow.BorderStyle = BorderStyle.Solid; tRow.BorderColor = Color.Black; tRow.BackColor = (i % 2 == 0 ? Color.White : Color.FromArgb(100, 196, 210)); tRow.BorderWidth = 1; TTodosOsMembros.Rows.Add(tRow); //nome do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = mIndividual[0]; tRow.Cells.Add(tCell); //email do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = mIndividual[1]; tRow.Cells.Add(tCell); //tipo do membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; tCell.Text = mIndividual[2]; tRow.Cells.Add(tCell); //botão para adicionar membro tCell = new TableCell(); tCell.BorderStyle = BorderStyle.None; Button b = new Button { ID = mIndividual[1], Text = "Incluir Membro" }; b.Click += new EventHandler(btn_click); tCell.Controls.Add(b); tRow.Cells.Add(tCell); Proximo :; } } } }