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) { if (IdQuestionario == -1) { PnlFundo.Visible = false; } else { if (FlObrigatorio) { this.LblTipo.Text = "Obrigatório"; this.BtnParticipar.Visible = false; } else { this.LblTipo.Text = "Opcional"; } this.LblNome.Text = LblTitulo; this.LblPorcentagem.Text = NuPorcentagem + " % Concluído"; this.BtnResponder.Attributes.Add("IdQuestionario", IdQuestionario.ToString()); this.BtnParticipar.Attributes.Add("IdQuestionario", IdQuestionario.ToString()); if (FlParticipa) { this.BtnParticipar.ImageUrl = "/Image/queroPreencher_selecionado.png"; this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaQuestionario.aspx?IdQuestionario=" + this.IdQuestionario + "&QueroParticipar=0"; EntQuestionarioEmpresa questionarioAberto = new BllQuestionarioEmpresa().ObterQuestionarioAberto(this.IdQuestionario, this.IdEmpCadastro, this.IdTurma); EntPergunta proximaPergunta = new BllPergunta().ObterProximaPerguntaQuestionario(questionarioAberto.IdQuestionarioEmpresa, this.IdQuestionario); this.BtnResponder.PostBackUrl = "~/Paginas/Empresa/RespondePerguntaQuestionario.aspx?IdQuestionario=" + this.IdQuestionario + "&IdQuestionarioEmpresa=" + questionarioAberto.IdQuestionarioEmpresa + "&IdEmpresaCadastro=" + IdEmpCadastro + "&IdTurma=" + IdTurma + "&IdPergunta=" + proximaPergunta.IdPergunta; } else { this.BtnParticipar.ImageUrl = "/Image/queroPreencher_nao_selecionado.png"; this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaQuestionario.aspx?IdQuestionario=" + this.IdQuestionario + "&QueroParticipar=1"; this.BtnResponder.Enabled = false; } if (FlObrigatorio) { this.BtnParticipar.Enabled = false; } if (!FlInscricaoAberta) { this.BtnResponder.Enabled = false; this.BtnResponder.Style.Add("cursor", "default"); this.BtnParticipar.Enabled = false; this.BtnParticipar.Style.Add("cursor", "default"); } } if (NuOrdem == 1) { this.LtrQuebraLinhaInicio.Text = "<tr>"; } else if (NuOrdem == 4) { this.LtrQuebraLinhaFim.Text = "</tr>"; } } }
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"); } } } }