public void Validar() { AddNotifications(new Contract <AdicionarAlunoCommand>() .Requires() .IsTrue((Nome.Length > 2) && (Nome.Length < 41), "Nome", "O nome do aluno deve ter de 3 à 40 caracteres!") .IsEmail(Email, "Email", "Email inválido!") .IsNotNullOrEmpty(DataNascimento.ToString(), "DataNascimento", "Data de nascimento inválida!") .IsTrue(CPF.Length == 11, "CPF", "CPF inválido!") .IsNotNullOrEmpty(IdTurma.ToString(), "IdTurma", "Id da turma inválido!") ); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.HdnIdQuestionario.Value = IdQuestionario.ToString(); this.HdnIdQuestionarioEmpresa.Value = IdQuestionarioEmpresa.ToString(); this.HdnIdEmpresaCadastro.Value = IdEmpresaCadastro.ToString(); this.HdnIdTurma.Value = IdTurma.ToString(); this.HdnIdPergunta.Value = Pergunta.IdPergunta.ToString(); this.lblPergunta.Text = this.Pergunta.Pergunta; this.lblNumeroPergunta.Text = this.Pergunta.NumeroQuestao; this.lblPerguntaAjuda.Text = this.Pergunta.SaibaMais; this.cmbCriterios.Items.Clear(); this.botaoJustificativa.Style.Add("display", "none"); EntQuestionario q = new BllQuestionario().ObterPorIdTurmaIdQuestionarioEmpresa(IdTurma, IdQuestionarioEmpresa); porcent.InnerHtml = q.PorcentagemPreenchida + "% preenchido"; barraPercent.Style.Value = "width:" + q.PorcentagemPreenchida + "%"; if (this.isUltimaPergunta(q.IdQuestionario, Pergunta.IdPergunta)) { this.BtnProximo.ImageUrl = "/Image/finalizar.gif"; } foreach (EntCriterio c in new BllCriterio().ObterPorQuestionarioComPerguntas(IdQuestionario)) { ListItem li = new ListItem(); li.Text = c.Criterio; li.Value = c.IdCriterio.ToString(); if (c.IdCriterio.Equals(this.Pergunta.Criterio.IdCriterio)) { li.Selected = true; this.lblCriterioAjuda.Text = c.Ajuda; } this.cmbCriterios.Items.Add(li); } this.respostaSim.Attributes.Add("onClick", "mostraAjuda('" + this.botaoJustificativa.ClientID + "')"); this.respostaNao.Attributes.Add("onClick", "escondeAjuda('" + this.botaoJustificativa.ClientID + "')"); this.TxtJustificativa.Text = this.Pergunta.QuestionarioEmpresaResposta.Justificativa; if (this.Pergunta.QuestionarioEmpresaResposta.RespostaBool) { this.respostaSim.Checked = true; this.botaoJustificativa.Style.Add("display", "block"); } else if (!this.Pergunta.QuestionarioEmpresaResposta.RespostaBool) { this.respostaNao.Checked = true; this.botaoJustificativa.Style.Add("display", "none"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.HdnIdQuestionario.Value = IdQuestionario.ToString(); this.HdnIdQuestionarioEmpresa.Value = IdQuestionarioEmpresa.ToString(); this.HdnIdEmpresaCadastro.Value = IdEmpresaCadastro.ToString(); this.HdnIdTurma.Value = IdTurma.ToString(); List <EntPergunta> lista = new BllPergunta().ObterPerguntasPorQuestionarioEmpresa(IdQuestionario, IdQuestionarioEmpresa, false); MontarQuestionario(lista); this.pergunta1respostaA.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.HdnIdQuestionario.Value = IdQuestionario.ToString(); this.HdnIdQuestionarioEmpresa.Value = IdQuestionarioEmpresa.ToString(); this.HdnIdEmpresaCadastro.Value = IdEmpresaCadastro.ToString(); this.HdnIdTurma.Value = IdTurma.ToString(); this.HdnIdPergunta.Value = Pergunta.IdPergunta.ToString(); this.lblPergunta.Text = this.Pergunta.Pergunta; this.lblNumeroPergunta.Text = this.Pergunta.NumeroQuestao; this.lblPerguntaAjuda.Text = this.Pergunta.SaibaMais; this.cmbCriterios.Items.Clear(); EntQuestionario q = new BllQuestionario().ObterPorIdTurmaIdQuestionarioEmpresa(IdTurma, IdQuestionarioEmpresa); porcent.InnerHtml = q.PorcentagemPreenchida + "% preenchido"; barraPercent.Style.Value = "width:" + q.PorcentagemPreenchida + "%"; if (this.isUltimaPergunta(q.IdQuestionario, Pergunta.IdPergunta)) { this.BtnProximo.ImageUrl = "/Image/finalizar.gif"; } foreach (EntCriterio c in new BllCriterio().ObterPorQuestionarioComPerguntas(IdQuestionario)) { ListItem li = new ListItem(); li.Text = c.Criterio; li.Value = c.IdCriterio.ToString(); if (c.IdCriterio.Equals(this.Pergunta.Criterio.IdCriterio)) { li.Selected = true; this.lblCriterioAjuda.Text = c.Ajuda; } this.cmbCriterios.Items.Add(li); } if (this.Pergunta.QuestionarioEmpresaResposta.RespostaTexto != null) { this.TxtResposta.Text = this.Pergunta.QuestionarioEmpresaResposta.RespostaTexto; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.HdnIdQuestionario.Value = IdQuestionario.ToString(); this.HdnIdQuestionarioEmpresa.Value = IdQuestionarioEmpresa.ToString(); this.HdnIdEmpresaCadastro.Value = IdEmpresaCadastro.ToString(); this.HdnIdTurma.Value = IdTurma.ToString(); if (UsuarioLogado.IdUsuario > 0) { lblEmpresa.Visible = false; } else { lblEmpresa.Visible = true; } MontarQuestionario(); this.pergunta1respostaA.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.HdnIdQuestionario.Value = IdQuestionario.ToString(); this.HdnIdQuestionarioEmpresa.Value = IdQuestionarioEmpresa.ToString(); this.HdnIdEmpresaCadastro.Value = IdEmpresaCadastro.ToString(); this.HdnIdTurma.Value = IdTurma.ToString(); this.HdnIdPergunta.Value = Pergunta.IdPergunta.ToString(); this.lblPergunta.Text = this.Pergunta.Pergunta; this.lblNumeroPergunta.Text = this.Pergunta.NumeroQuestao; this.lblPerguntaAjuda.Text = this.Pergunta.SaibaMais; this.lblRespostaA.Text = this.Pergunta.ListPerguntaResposta[0].PerguntaResposta; this.hdnRespostaA_Just.Value = this.Pergunta.ListPerguntaResposta[0].PossuiJustificativa.ToString(); this.tickRespA.Style.Add("display", "none"); this.lblRespostaB.Text = this.Pergunta.ListPerguntaResposta[1].PerguntaResposta; this.hdnRespostaB_Just.Value = this.Pergunta.ListPerguntaResposta[1].PossuiJustificativa.ToString(); this.tickRespB.Style.Add("display", "none"); this.lblRespostaC.Text = this.Pergunta.ListPerguntaResposta[2].PerguntaResposta; this.hdnRespostaC_Just.Value = this.Pergunta.ListPerguntaResposta[2].PossuiJustificativa.ToString(); this.tickRespC.Style.Add("display", "none"); this.lblRespostaD.Text = this.Pergunta.ListPerguntaResposta[3].PerguntaResposta; this.hdnRespostaD_Just.Value = this.Pergunta.ListPerguntaResposta[3].PossuiJustificativa.ToString(); this.tickRespD.Style.Add("display", "none"); this.cmbCriterios.Items.Clear(); this.botaoJustificativa.Style.Add("display", "none"); EntQuestionario q = new BllQuestionario().ObterPorIdTurmaIdQuestionarioEmpresa(IdTurma, IdQuestionarioEmpresa); porcent.InnerHtml = q.PorcentagemPreenchida + "% preenchido"; barraPercent.Style.Value = "width:" + q.PorcentagemPreenchida + "%"; if (this.isUltimaPergunta(q.IdQuestionario, Pergunta.IdPergunta)) { this.BtnProximo.ImageUrl = "/Image/finalizar.gif"; } foreach (EntCriterio c in new BllCriterio().ObterPorQuestionarioComPerguntas(IdQuestionario)) { ListItem li = new ListItem(); li.Text = c.Criterio; li.Value = c.IdCriterio.ToString(); if (c.IdCriterio.Equals(this.Pergunta.Criterio.IdCriterio)) { li.Selected = true; this.lblCriterioAjuda.Text = c.Ajuda; } this.cmbCriterios.Items.Add(li); } if (this.Pergunta.QuestionarioEmpresaResposta != null && this.Pergunta.QuestionarioEmpresaResposta.QuestionarioEmpresa != null) { if (this.Pergunta.QuestionarioEmpresaResposta.Resposta.PossuiJustificativa) { this.TxtJustificativa.Text = this.Pergunta.QuestionarioEmpresaResposta.Justificativa; this.HddnFldJustificativa.Value = this.Pergunta.QuestionarioEmpresaResposta.Justificativa; this.botaoJustificativa.Style.Add("display", "block"); } if (this.Pergunta.QuestionarioEmpresaResposta.Resposta.IdPerguntaResposta == this.Pergunta.ListPerguntaResposta[0].IdPerguntaResposta) { this.respostaSelecionada.Value = "A"; this.tickRespA.Style.Add("display", "block"); this.coluna1RespostaA.Style.Add("background-color", "#89AFF5"); this.coluna2RespostaA.Style.Add("background-color", "#89AFF5"); this.respostaA.Style.Add("background-color", "#89AFF5"); } else if (this.Pergunta.QuestionarioEmpresaResposta.Resposta.IdPerguntaResposta == this.Pergunta.ListPerguntaResposta[1].IdPerguntaResposta) { this.respostaSelecionada.Value = "B"; this.tickRespB.Style.Add("display", "block"); this.coluna1RespostaB.Style.Add("background-color", "#89AFF5"); this.coluna2RespostaB.Style.Add("background-color", "#89AFF5"); this.respostaB.Style.Add("background-color", "#89AFF5"); } else if (this.Pergunta.QuestionarioEmpresaResposta.Resposta.IdPerguntaResposta == this.Pergunta.ListPerguntaResposta[2].IdPerguntaResposta) { this.respostaSelecionada.Value = "C"; this.tickRespC.Style.Add("display", "block"); this.coluna1RespostaC.Style.Add("background-color", "#89AFF5"); this.coluna2RespostaC.Style.Add("background-color", "#89AFF5"); this.respostaC.Style.Add("background-color", "#89AFF5"); } else if (this.Pergunta.QuestionarioEmpresaResposta.Resposta.IdPerguntaResposta == this.Pergunta.ListPerguntaResposta[3].IdPerguntaResposta) { this.respostaSelecionada.Value = "D"; this.tickRespD.Style.Add("display", "block"); this.coluna1RespostaD.Style.Add("background-color", "#89AFF5"); this.coluna2RespostaD.Style.Add("background-color", "#89AFF5"); this.respostaD.Style.Add("background-color", "#89AFF5"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (IdTurma == -1) { PnlFundo.Visible = false; } else { if (FlPrivado) { this.LblTipo.Text = "Turma Privada"; } else { this.LblTipo.Text = "Turma Pública"; } this.LblNome.Text = LblTitulo; this.LblDescricao.Text = TxDescricao; this.BtnAcessar.Attributes.Add("IdTurma", IdTurma.ToString()); this.BtnParticipar.Attributes.Add("IdTurma", IdTurma.ToString()); if (FlParticipa) { this.BtnParticipar.ImageUrl = "/Image/queroParticipar_selecionado.png"; this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaTurma.aspx?IdTurma=" + this.IdTurma + "&QueroParticipar=0"; this.BtnAcessar.ImageUrl = "/Image/_file_AcessA.png"; if (new BllQuestionarioEmpresa().ObterQuestionarioPorTurmaEmpresa(EmpresaLogada.IdEmpresaCadastro, this.IdTurma) != null) { this.BtnAcessar.PostBackUrl = "~/Paginas/Empresa/SelecionaQuestionario.aspx?IdTurma=" + this.IdTurma; } else { this.BtnAcessar.PostBackUrl = "~/Paginas/CadastroInscricoesEmpresa.aspx?IdTurma=" + this.IdTurma + "&CpfCnpj=" + EmpresaLogada.CPF_CNPJ; } } else { this.BtnParticipar.ImageUrl = "/Image/queroParticipar_nao_selecionado.png"; this.BtnAcessar.ImageUrl = "/Image/_file_AcessI.png"; EntTurmaEmpresa objTurmaEmpresa = new EntTurmaEmpresa(); objTurmaEmpresa.EmpresaCadastro.IdEmpresaCadastro = EmpresaLogada.IdEmpresaCadastro; objTurmaEmpresa.Turma.IdTurma = this.IdTurma; objTurmaEmpresa = new BllTurmaEmpresa().ObterPorTurmaEmpresa(objTurmaEmpresa); if (objTurmaEmpresa != null && objTurmaEmpresa.ParticipaPrograma) { this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaTurma.aspx?IdTurma=" + this.IdTurma + "&QueroParticipar=0"; //this.BtnParticipar.PostBackUrl = "~/Paginas/Principal.aspx"; } else { this.EmpresaLogada = new BllEmpresaCadastro().ObterPorId(EmpresaLogada.IdEmpresaCadastro); this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaTurma.aspx?IdTurma=" + this.IdTurma + "&QueroParticipar=1"; } this.BtnAcessar.Enabled = false; } if (!FlInscricaoAberta) { this.BtnAcessar.Enabled = false; this.BtnParticipar.Enabled = false; } } if (NuOrdem == 1) { this.LtrQuebraLinhaInicio.Text = "<tr>"; } else if (NuOrdem == 4) { this.LtrQuebraLinhaFim.Text = "</tr>"; } } }