Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["protocolo"] != null)
            {
                String estado    = null;
                String categoria = null;

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(Request["protocolo"]);

                new BllQuestionarioEmpresa().AlterarRelatorioGeradoPorProtocolo(Request["protocolo"], true);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, StringUtils.ToInt(Request["programaId"]));

                    if (listEmpresaCadastro != null)
                    {
                        Boolean comentarios = ObjectUtils.ToBoolean(Request["comentarios"]);
                        Int32   programaId  = ObjectUtils.ToInt(Request["programaId"]);
                        Int32   turmaId     = ObjectUtils.ToInt(Request["turmaId"]);
                        Int32   avaliador   = ObjectUtils.ToInt(Request["avaliacao"]);
                        Int32   intro       = ObjectUtils.ToInt(Request["intro"]);
                        gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), Request["protocolo"], estado, categoria, comentarios, programaId, turmaId, avaliador, intro, false, this.Page);
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
        private void DadosDaEmpresa(Int32 IdEmpresaCadastro, Int32 IdPrograma)
        {
            EntEmpresaCadastro objEmpresaCadastro = new BllEmpresaCadastro().ObterPorId(IdEmpresaCadastro);
            EntTurmaEmpresa    objTurmaEmpresa    = new BllTurmaEmpresa().ObterPorIdEmpresaIdPrograma(objEmpresaCadastro.IdEmpresaCadastro, IdPrograma);

            this.lblRazaoSocial.Text           = objEmpresaCadastro.RazaoSocial;
            this.lblNomeFantasia.Text          = objEmpresaCadastro.NomeFantasia;
            this.lblCategoria.Text             = objTurmaEmpresa.Categoria.Categoria;
            this.lblCNAE.Text                  = objTurmaEmpresa.AtividadeEconomica.AtividadeEconomica;
            this.lblAtividadeEconomicaTxt.Text = objTurmaEmpresa.AtividadeEconomicaComplemento;
            this.lblCPFCNPJ.Text               = objEmpresaCadastro.CPF_CNPJ;
            this.lblFaturamento.Text           = objTurmaEmpresa.Faturamento.Faturamento;
            this.lblEmpregados.Text            = IntUtils.ToString(objTurmaEmpresa.NumeroFuncionario);
            this.lblDataAbertura.Text          = objEmpresaCadastro.AberturaEmpresa.ToShortDateString();
            this.lblBairro.Text                = objTurmaEmpresa.Bairro.Bairro;
            this.lblEndereco.Text              = objTurmaEmpresa.Endereco;
            this.lblCEP.Text             = objTurmaEmpresa.CEP;
            this.lblCidade.Text          = objTurmaEmpresa.Cidade.Cidade;
            this.lblEstado.Text          = objTurmaEmpresa.Estado.Estado;
            this.lblContatoNome.Text     = objTurmaEmpresa.NomeContato;
            this.lblContatoCargo.Text    = objTurmaEmpresa.Cargo.Cargo;
            this.lblContatoTelefone.Text = objTurmaEmpresa.TelefoneContato;
            this.lblContatoCelular.Text  = objTurmaEmpresa.CelularContato;
            this.lblContatoEmail.Text    = objTurmaEmpresa.EmailContato;
            this.lblResposta1.Text       = BooleanUtils.ToString(objTurmaEmpresa.Pergunta1);
            this.lblResposta2.Text       = BooleanUtils.ToString(objTurmaEmpresa.Pergunta2);
            this.lblResposta3.Text       = BooleanUtils.ToString(objTurmaEmpresa.Pergunta3);
            this.lblResposta4.Text       = BooleanUtils.ToString(objTurmaEmpresa.Pergunta4);
        }
Exemplo n.º 3
0
        private void EnviarEmail(String Email)
        {
            Int32   RowIndex  = ObjectUtils.ToInt(hddRowIndex.Value);
            String  protocolo = ((Label)grdRelatorioRAA.Rows[RowIndex].Cells[15].Controls[1]).Text;
            Int32   programa  = StringUtils.ToInt(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[16].Controls[1]).Text);
            Boolean avaliador = StringUtils.ToBoolean(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[17].Controls[1]).Text);
            String  caminho   = "";

            if (protocolo != "")
            {
                String estado    = null;
                String categoria = null;

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programa);

                    if (listEmpresaCadastro != null)
                    {
                        caminho = gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, false, programa, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), 0, true, this.Page);
                    }
                }
                if (caminho != "")
                {
                    WebUtils.EnviaEmailRaa(Email, "", caminho);
                }
            }
            UCStatus1.UpdateControls();
        }
Exemplo n.º 4
0
        protected void btnValidar_Click(object sender, EventArgs e)
        {
            if (VerificaCamposCnpj())
            {
                EntEmpresaCadastro objEmpresa = new BllEmpresaCadastro().ValidarEmpresa(StringUtils.OnlyNumbers(this.TxtBxCNPJCPF.Text), objPrograma.IdPrograma);
                if (objEmpresa.IdEmpresaCadastro == 0)
                {
                    HabilitaCampos(true);
                    this.TxtBxCNPJCPFValido.Text = this.TxtBxCNPJCPF.Text;
                }
                else
                {
                    EntInscricoesEmpresa objInscricoesEmpresa = new BllInscricoesEmpresa().ObterPorIdEmpresaPrograma(objEmpresa.IdEmpresaCadastro, objPrograma.IdPrograma);
                    EntTurma             objTurma             = new BllTurma().ObterTurmaAtiva(objPrograma.IdPrograma);

                    if (objInscricoesEmpresa.TurmaEmpresa.Turma.IdTurma != objTurma.IdTurma)
                    {
                        this.HddnFldEmpresaCadastro.Value = IntUtils.ToString(objEmpresa.IdEmpresaCadastro);
                        this.ImportacaoOutrosProgramas    = true;
                        this.ObjectToPage(new BllInscricoesEmpresa().ObterPorIdEmpresaPrograma(objEmpresa.IdEmpresaCadastro, objPrograma.IdPrograma), this.ImportacaoOutrosProgramas);
                        HabilitaCampos(true);
                    }
                    else
                    {
                        MessageBox(this.Page, "Empresa já cadastrada.");
                        this.TxtBxCNPJCPF.Focus();
                    }
                }
            }
            else
            {
                MessageBox(this.Page, "Favor preencher o campo obrigatório (em destaque).");
            }
        }
Exemplo n.º 5
0
        private void ValidaEmpresa()
        {
            // Existe Empresa Cadastrada?
            EmpresaLogada = new BllEmpresaCadastro().ValidarEmpresa(StringUtils.OnlyNumbers(this.TxtBxLogin.Text), objPrograma.IdPrograma);


            if (EmpresaLogada.IdEmpresaCadastro == 0)
            {
                MessageBox(this, "Cadastro não encontrado!");
                FormsAuthentication.RedirectFromLoginPage("0", false);
                if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_MPE)
                {
                    objTurma           = new BllTurma().ObterTurmaAtiva(objPrograma.IdPrograma);
                    Session["CpfCnpj"] = StringUtils.OnlyNumbers(TxtBxLogin.Text);
                    //Response.Redirect("CadastroInscricoesEmpresa.aspx?IdEmpresaCadastro=0&CpfCnpj=" + StringUtils.OnlyNumbers(TxtBxLogin.Text) + "&acesso=" + 1);
                }
                else
                {
                    Response.Redirect("CadastroInscricoesEmpresaBasico.aspx?IdEmpresaCadastro=0&CpfCnpj=" + StringUtils.OnlyNumbers(TxtBxLogin.Text));
                }
            }
            else
            {
                this.ImgBttnConfirma1.Visible = false;
                this.ImgBttnConfirma2.Visible = true;
                this.divSenha.Visible         = true;
                TxtBxSenha.Focus();
                TxtBxLogin.Enabled           = false;
                LNKBttnTrocarUsuario.Visible = true;
                LnkBttnSenha.Visible         = true;
            }
        }
Exemplo n.º 6
0
        protected void grdSimplificado_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Index = ObjectUtils.ToInt(e.CommandArgument) - (grdSimplificado.PageIndex * grdSimplificado.PageSize);

            if (e.CommandName == "Download")
            {
                Boolean comentarios = false;
                Int32   intro       = 0;
                String  estado      = null;
                String  categoria   = null;
                String  protocolo   = ((Label)grdSimplificado.Rows[Index].Cells[2].Controls[1]).Text;
                Int32   programaId  = objPrograma.IdPrograma;
                Boolean avaliador   = false;
                String  caminho     = "";

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programaId);

                    if (listEmpresaCadastro != null)
                    {
                        caminho = new PaginaBase().gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, comentarios, programaId, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), intro, false, this.Page);
                        if (caminho != "")
                        {
                            NovaJanela(this.Page, caminho);
                        }
                    }
                }
            }
        }
Exemplo n.º 7
0
        protected void grdSimplificado_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Index = ObjectUtils.ToInt(e.CommandArgument) - (grdSimplificado.PageIndex * grdSimplificado.PageSize);

            if (e.CommandName == "Avaliar")
            {
                //Avaliar
                Label lblIdEmpresaCadastro = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEmpresaCadastro"));
                int   IdEmpresaCadastro    = StringUtils.ToInt(lblIdEmpresaCadastro.Text);
                Label lblIdEtapa           = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEtapa"));
                int   IdEtapa = StringUtils.ToInt(lblIdEtapa.Text);
                int   IdTurma = UCFiltroAvaliacao1.IdTurma();
                this.UCListaQuestionariosAvaliacao1.Editar(IdEmpresaCadastro, IdEtapa, IdTurma);
            }
            else if (e.CommandName == "Formulario")
            {
                //Formulario
                Boolean comentarios = false;
                Int32   intro       = 0;
                String  estado      = null;
                String  categoria   = null;
                String  protocolo   = ((Label)grdSimplificado.Rows[Index].FindControl("lblProtocolo")).Text;
                Int32   programaId  = objPrograma.IdPrograma;
                Boolean avaliador   = false;
                String  caminho     = "";

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programaId);

                    if (listEmpresaCadastro != null)
                    {
                        caminho = new PaginaBase().gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, comentarios, programaId, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), intro, false, this.Page);
                        if (caminho != "")
                        {
                            NovaJanela(this.Page, caminho);
                        }
                    }
                }
            }
            else if (e.CommandName == "Devolucao")
            {
                //Devolucao
                Label  labelIdQuestionarioEmpresa             = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa"));
                String motivoDevolucao                        = "";
                EntQuestionarioEmpresa objQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorId(int.Parse(labelIdQuestionarioEmpresa.Text));
                if (objQuestionarioEmpresa.MotivoExcluiu != null)
                {
                    motivoDevolucao = objQuestionarioEmpresa.MotivoExcluiu;
                }
                this.TxtDevolucao.Text = motivoDevolucao;

                this.divDevolucao.Style.Add("display", "block");
            }
        }
Exemplo n.º 8
0
        private void EfetuaLogin(String sLogin, String sSenha)
        {
            if (Regex.IsMatch(this.TxtBxLogin.Text.Substring(0, 1), "[A-Za-z]"))
            {
                // Administrativo
                UsuarioLogado = new BllAdmUsuario().ValidaUsuario(this.TxtBxLogin.Text);

                if (UsuarioLogado.Senha == StringUtils.EncryptPassword(sSenha))
                {
                    FormsAuthentication.RedirectFromLoginPage(UsuarioLogado.IdUsuario.ToString(), false);

                    UsuarioLogado = new BllAdmUsuario().ObterPorPermissoes(UsuarioLogado.IdUsuario, objPrograma.IdPrograma);
                    EmpresaLogada = null;
                    Response.Redirect("~/Paginas/Principal.aspx");
                }
                else
                {
                    MessageBox(this, "Senha não confere!");
                    this.TxtBxSenha.Focus();
                }
            }
            else
            {
                // Empresa
                this.UsuarioLogado = null;
                EmpresaLogada      = new BllEmpresaCadastro().ValidarEmpresa(StringUtils.OnlyNumbers(this.TxtBxLogin.Text), objPrograma.IdPrograma);

                if (EmpresaLogada.ProgramaEmpresa.Senha == StringUtils.EncryptPassword(sSenha))
                {
                    FormsAuthentication.RedirectFromLoginPage(EmpresaLogada.IdEmpresaCadastro.ToString(), false);
                    UsuarioLogado = null;

                    EntInscricoesEmpresa objInscricoesEmpresa = new BllInscricoesEmpresa().ObterPorIdEmpresaPrograma(EmpresaLogada.IdEmpresaCadastro, objPrograma.IdPrograma);

                    if (objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.IdEmpresaCadastro > 0 && objInscricoesEmpresa.TurmaEmpresa.Turma.IdTurma > 0)
                    {
                        this.EmpresaLogada = objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro;
                        this.objTurma      = objInscricoesEmpresa.TurmaEmpresa.Turma;
                        Response.Redirect("~/Paginas/Principal.aspx");
                    }
                }
                else
                {
                    MessageBox(this, "Senha não confere!");
                    this.TxtBxSenha.Focus();
                }
            }
        }
Exemplo n.º 9
0
        protected void LnkBttnSenha_Click(object sender, EventArgs e)
        {
            if (this.VerificaCamposObrigatoriosCadastro())
            {
                if (Regex.IsMatch(this.TxtBxLogin.Text.Substring(0, 1), "[A-Za-z]"))
                {
                    //  EntAdmUsuario objUsuario = new BllAdmUsuario().ValidaUsuario(this.TxtBxLogin.Text);

                    // Se o usuário não está cadastrado na base
                    if (UsuarioLogado.IdUsuario == 0)
                    {
                        MessageBox(this, "Usuário não encontrado!");
                    }
                    else
                    {
                        this.LblMsgEmail.Text       = "Sua solicitação será enviada para: " + UsuarioLogado.Email;
                        this.divEnviarEmail.Visible = true;


                        //   EnviaEmailAdm(objUsuario);
                    }
                }
                else
                {
                    String txCpfCnpj = StringUtils.OnlyNumbers(this.TxtBxLogin.Text);
                    EmpresaLogada = new BllEmpresaCadastro().ValidarEmpresa(txCpfCnpj, objPrograma.IdPrograma);


                    if (EmpresaLogada.IdEmpresaCadastro == 0)
                    {
                        MessageBox(this, "Empresa não cadastrada!");
                    }
                    else
                    {
                        this.LblMsgEmail.Text       = "Sua solicitação será enviada para: " + EmpresaLogada.ProgramaEmpresa.EmailResponsavel;
                        this.divEnviarEmail.Visible = true;

                        //EnviaEmailEmp(EmpresaLogada);
                    }
                }
            }
            else
            {
                MessageBox(this.Page, "Favor preencher os campos obrigatórios (em destaque).");
            }
        }
Exemplo n.º 10
0
        protected void grdRelatorioRAA_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Email")
            {
                hddRowIndex.Value = ObjectUtils.ToString(e.CommandArgument);
                this.UCConfirmaEmail1.Show();
            }
            else if (e.CommandName == "Download")
            {
                hddRowIndex.Value = ObjectUtils.ToString(e.CommandArgument);
                Boolean comentarios = false;
                Int32   intro       = 0;
                Int32   RowIndex    = ObjectUtils.ToInt(hddRowIndex.Value);
                String  estado      = null;
                String  categoria   = null;
                String  protocolo   = ((Label)grdRelatorioRAA.Rows[RowIndex].Cells[15].Controls[1]).Text;
                Int32   programaId  = StringUtils.ToInt(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[16].Controls[1]).Text);
                Boolean avaliador   = StringUtils.ToBoolean(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[17].Controls[1]).Text);
                String  caminho     = "";

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programaId);

                    if (listEmpresaCadastro != null)
                    {
                        caminho = new PaginaBase().gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, comentarios, programaId, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), intro, false, this.Page);
                        if (caminho != "")
                        {
                            NovaJanela(this.Page, caminho);
                        }
                    }
                }

                UCStatus1.UpdateControls();
//                Response.Redirect("~/FGA/Paginas/RelatorioRAA.aspx");
            }
        }
Exemplo n.º 11
0
        private void Gravar()
        {
            EntInscricoesEmpresa objInscricoesEmpresa = new EntInscricoesEmpresa();
            EntGrupoEmpresa      objGrupoEmpresa      = new EntGrupoEmpresa();

            this.PageToObject(objInscricoesEmpresa, objGrupoEmpresa);

            try
            {
                Boolean flNovoCadastro = false;
                objInscricoesEmpresa.TurmaEmpresa.ParticipaPrograma = true;
                objInscricoesEmpresa.TurmaEmpresa.Ativo             = true;
                objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.ParticipouMPE2011 = true;
                EntEmpresaCadastro empCadastro = new BllEmpresaCadastro().ObterPorCpfCnpj(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.CPF_CNPJ);

                if (empCadastro == null)
                {
                    flNovoCadastro = true;
                }
                objInscricoesEmpresa.ProgramaEmpresa.EmpresaCadastro = objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro;

                objInscricoesEmpresa = new BllInscricoesEmpresa().InserirAlterar(objInscricoesEmpresa);

                //Verifica se é Novo Cadastro ou não
                if (flNovoCadastro)
                {
                    this.EnviaEmail();
                    MessageBox(this.Page, "Inscrição de Empresa inserida com sucesso!");
                }
                else
                {
                    MessageBox(this.Page, "Inscrição de Empresa alterada com sucesso!");
                }
            }
            catch (Exception ex)
            {
                MessageBox(this.Page, "Erro ao tentar Gravar a Inscrição de Empresa!");
            }
        }
Exemplo n.º 12
0
        protected void grdRanking_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int index = ObjectUtils.ToInt(e.CommandArgument) - (grdRanking.PageIndex * grdRanking.PageSize);

            int  IdQuestionarioEmpresa = StringUtils.ToInt(((Label)this.grdRanking.Rows[index].Cells[0].FindControl("lblIdQuestionarioEmpresa")).Text);
            int  IdEmpresaCadastro     = StringUtils.ToInt(((Label)this.grdRanking.Rows[index].Cells[1].FindControl("lblIdEmpresaCadastro")).Text);
            int  IdEtapa             = StringUtils.ToInt(((Label)this.grdRanking.Rows[index].Cells[2].FindControl("lblIdEtapa")).Text);
            bool FlPassaProximaEtapa = StringUtils.ToBoolean(((Label)this.grdRanking.Rows[index].Cells[2].FindControl("lblFlPassaProximaEtapa")).Text);

            if (e.CommandName == "Devolver")
            {
                switch (objPrograma.IdPrograma)
                {
                case (int)EnumType.Programa.FGA:
                    this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaFga.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao);
                    break;

                case (int)EnumType.Programa.PEG:
                    this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaPeg.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao);
                    break;
                }
            }
            else if (e.CommandName == "FinalistaGestao")
            {
                if (FlPassaProximaEtapa)
                {
                    new BllRelatorioRanking().EncaminharEtapaAnterior(IdEmpresaCadastro, (int)EnumType.Questionario.Gestao, IdEtapa, false);
                }
                else
                {
                    new BllRelatorioRanking().EncaminharProximaEtapa(IdEmpresaCadastro, (int)EnumType.Questionario.Gestao, IdEtapa, false);
                }
            }
            else if (e.CommandName == "Desclassificar")
            {
                Label lblIdQuestionarioEmpresa = ((Label)grdRanking.Rows[index].FindControl("lblIdQuestionarioEmpresa"));
                Label lblFlDesclassificado     = ((Label)grdRanking.Rows[index].FindControl("lblFlDesclassificado"));

                if (lblFlDesclassificado.Text == "True")
                {
                    EntQuestionarioEmpresa objQuestionarioEmpresa = new EntQuestionarioEmpresa();
                    objQuestionarioEmpresa.IdQuestionarioEmpresa = int.Parse(lblIdQuestionarioEmpresa.Text);
                    objQuestionarioEmpresa.Excluido = false;
                    new BllQuestionarioEmpresa().AlterarSomenteDesclassificar(objQuestionarioEmpresa);
                }
                else if (lblFlDesclassificado.Text == "False")
                {
                    this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaFga.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao);
                }

                CheckBox ChckBxDesclassificar = ((CheckBox)grdRanking.Rows[index].FindControl("ChckBxDesclassificar"));
                CheckBox ChckBxClassificar    = ((CheckBox)grdRanking.Rows[index].FindControl("ChckBxClassificar"));

                ImageButton imgBttnDesclassificar = ((ImageButton)grdRanking.Rows[index].FindControl("imgBttnDesclassificar"));
                ImageButton ImgBttnClassificar    = ((ImageButton)grdRanking.Rows[index].FindControl("ImgBttnClassificar"));

                if (ChckBxDesclassificar.Checked)
                {
                    imgBttnDesclassificar.ImageUrl = "~/Image/unchecked.gif";
                    ChckBxDesclassificar.Checked   = false;
                    ImgBttnClassificar.Enabled     = true;
                }
                else
                {
                    imgBttnDesclassificar.ImageUrl = "~/Image/checked.gif";
                    ChckBxDesclassificar.Checked   = true;
                    ImgBttnClassificar.Enabled     = false;
                }
            }
            else if (e.CommandName == "Download")
            {
                Boolean comentarios = false;
                Int32   intro       = 0;
                String  estado      = null;
                String  categoria   = null;
                String  protocolo   = ((Label)grdRanking.Rows[index].Cells[7].Controls[1]).Text;
                Int32   programaId  = objPrograma.IdPrograma;
                Boolean avaliador   = false;
                String  caminho     = "";

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programaId);

                    if (listEmpresaCadastro != null)
                    {
                        caminho = new PaginaBase().gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, comentarios, programaId, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), intro, false, this.Page);
                        if (caminho != "")
                        {
                            NovaJanela(this.Page, caminho);
                        }
                    }
                }
            }
            else if (e.CommandName == "DownloadRa")
            {
                Boolean comentarios = false;
                Int32   intro       = 0;
                String  estado      = null;
                String  categoria   = null;
                String  protocolo   = ((Label)grdRanking.Rows[index].Cells[7].Controls[1]).Text;
                Int32   programaId  = objPrograma.IdPrograma;
                String  caminho     = "";

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programaId);

                    if (listEmpresaCadastro != null)
                    {
                        caminho = new PaginaBase().gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, comentarios, programaId, objTurma.IdTurma, 1, intro, false, this.Page);
                        if (caminho != "")
                        {
                            NovaJanela(this.Page, caminho);
                        }
                    }
                }
            }
            PopulaGridEmpresa();
        }
Exemplo n.º 13
0
        protected void ValidaEmpresa()
        {
            if (TxtCnpjCpf.Text.Trim() == "")
            {
                MessageBox(this.Page, "Informe um CPF/CNPJ!");
                return;
            }
            if (TxtNome.Text.Trim() == "")
            {
                MessageBox(this.Page, "Informe um Nome!");
                return;
            }
            if (this.ddlEstado.SelectedValue == "0")
            {
                MessageBox(this.Page, "Selecione um Estado!");
                return;
            }
            if (TxtEmail.Text.Trim() == "")
            {
                MessageBox(this.Page, "Informe um E-mail!");
                return;
            }

            if (StringUtils.OnlyNumbers(this.TxtCnpjCpf.Text).Length != this.TxtCnpjCpf.Text.Length)
            {
                MessageBox(this.Page, "CPF/CNPJ Invalido!");
                return;
            }
            else
            {
                if (StringUtils.OnlyNumbers(this.TxtCnpjCpf.Text).Length == 11)
                {
                    // CPF

                    if (!StringUtils.ValidaCPF(StringUtils.OnlyNumbers(this.TxtCnpjCpf.Text)))
                    {
                        MessageBox(this.Page, "CPF Inválido!");
                        return;
                    }
                }
                else
                {
                    // CNPJ

                    if (!StringUtils.ValidaCNPJ(StringUtils.OnlyNumbers(this.TxtCnpjCpf.Text)))
                    {
                        MessageBox(this.Page, "CNPJ Inválido!");
                        return;
                    }
                    PessoaJuridica = true;
                }
                // Existe Empresa Cadastrada?

                EntEmpresaCadastro EmpresaLogada = new BllEmpresaCadastro().ValidarEmpresa(this.TxtCnpjCpf.Text, objPrograma.IdPrograma);


                if (EmpresaLogada.IdEmpresaCadastro == 0)
                {
                    IncluirPreCadastro();
                }
                else
                {
                    MessageBox(this.Page, "Empresa ja cadastrada no sistema!");
                    return;
                }
            }
        }
Exemplo n.º 14
0
        private void IncluirPreCadastro()
        {
            EntEmpresaCadastro Empresa            = new EntEmpresaCadastro();
            EntTurmaEmpresa    TurmaEmpresa       = new EntTurmaEmpresa();
            EntProgramaEmpresa UsuarioResponsavel = new EntProgramaEmpresa();
            EntTurma           Turma = new EntTurma();
            string             Senha;

            try
            {
                Empresa.RazaoSocial     = TxtNome.Text.Trim();
                Empresa.NomeFantasia    = TxtNome.Text.Trim();
                Empresa.CPF_CNPJ        = TxtCnpjCpf.Text.Trim();
                Empresa.PessoaJuridica  = PessoaJuridica;
                Empresa.Ativo           = true;
                Empresa.Estado.IdEstado = StringUtils.ToInt(ddlEstado.SelectedValue.ToString());
                Empresa.AberturaEmpresa = new DateTime(1753, 1, 1);

                Empresa = new BllEmpresaCadastro().Inserir(Empresa);
                if (Empresa.IdEmpresaCadastro > 0)
                {
                    Turma = new BllTurma().ObterPorId(StringUtils.ToInt(this.HddnFldTurma.Value.ToString()));

                    TurmaEmpresa.Ativo             = true;
                    TurmaEmpresa.Turma             = Turma;
                    TurmaEmpresa.EmpresaCadastro   = Empresa;
                    TurmaEmpresa.Status            = 0;
                    TurmaEmpresa.ParticipaPrograma = true;
                    new BllTurmaEmpresa().Inserir(TurmaEmpresa);


                    UsuarioResponsavel.NomeResponsavel     = TxtNome.Text;
                    UsuarioResponsavel.Programa.IdPrograma = Turma.Programa.IdPrograma;
                    UsuarioResponsavel.EmpresaCadastro     = Empresa;
                    UsuarioResponsavel.EmailResponsavel    = TxtEmail.Text.Trim();
                    Senha = StringUtils.Random(4);
                    UsuarioResponsavel.Senha = StringUtils.EncryptPassword(Senha);

                    UsuarioResponsavel = new BllProgramaEmpresa().Inserir(UsuarioResponsavel);


                    // Enviar email alertando para confirmar a alteração da senha.
                    StringBuilder sMensagem = new StringBuilder();
                    String        titulo    = "";

                    sMensagem.AppendLine("Esta é uma Mensagem automática, não responda este e-mail.");
                    sMensagem.AppendLine();
                    if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_FGA)
                    {
                        sMensagem.AppendLine("Você foi convidado a participar da turma " + Turma.Turma + " do Programa FGA");
                    }
                    else if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_PEG)
                    {
                        sMensagem.AppendLine("Você foi convidado a participar da turma " + Turma.Turma + " do Programa PEG");
                    }
                    sMensagem.AppendLine("acesse o link  " + Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host + (Request.Url.IsDefaultPort ? "" : ":" + Request.Url.Port) + "/Paginas/Login.aspx ");
                    sMensagem.AppendLine("informe o seu CPF/CNPJ e sua senha temporaria que é " + Senha);
                    sMensagem.AppendLine("para terminar o seu cadastro e completar a sua inscrição.");
                    sMensagem.AppendLine();
                    if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_FGA)
                    {
                        sMensagem.AppendLine("Administração FGA.");
                        titulo = "Pré-Cadastro FGA";
                    }
                    else if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_PEG)
                    {
                        sMensagem.AppendLine("Administração PEG.");
                        titulo = "Pré-Cadastro PEG";
                    }

                    WebUtils.EnviaEmail(TxtEmail.Text.Trim(), titulo, sMensagem);

                    MessageBox(this.Page, "O convite de participação da Turma foi enviada para o responsável pela empresa: " + TxtEmail.Text.Trim() + "\\nSe o e-mail estiver incorreto, contate o Gestor do Programa no seu Estado.");

                    this.Clear();
                    this.Close();
                    AtualizaGridEmpresasDelegate();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 15
0
        private void PopulaPergunta()
        {
            EntQuestionario questionario = new BllQuestionario().ObterPorId(IdQuestionario);

            this.lblNomeQuestionario.Text = questionario.Questionario;
            if (IdUsuarioLogado > 0)
            {
                String cnpj = new BllEmpresaCadastro().ObterPorId(IdEmpresaCadastro).CPF_CNPJ;
                this.lblNomeQuestionario.Text = this.lblNomeQuestionario.Text + " - Empresa: " + cnpj;
            }

            if (questionario.PreenchimentoRapido || this.IdUsuarioLogado > 0)
            {
                switch (questionario.IdQuestionario)
                {
                case EntQuestionario.QUESTIONARIO_EMPREENDEDORISMO_2009:
                case EntQuestionario.QUESTIONARIO_EMPREENDEDORISMO_2011:
                    this.UCAdministrativoEmpreendedorismo1.IdQuestionario        = IdQuestionario;
                    this.UCAdministrativoEmpreendedorismo1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCAdministrativoEmpreendedorismo1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCAdministrativoEmpreendedorismo1.IdTurma = IdTurma;

                    this.UCAdministrativoEmpreendedorismo1.Visible = true;

                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntQuestionario.QUESTIONARIO_RESPONSABILIDADE_2009:
                    this.UCAdministrativoResponsabilidadeSocial1.IdQuestionario        = IdQuestionario;
                    this.UCAdministrativoResponsabilidadeSocial1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCAdministrativoResponsabilidadeSocial1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCAdministrativoResponsabilidadeSocial1.IdTurma = IdTurma;

                    this.UCAdministrativoResponsabilidadeSocial1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntQuestionario.QUESTIONARIO_RESPONSABILIDADE_2011:
                    this.UCAdministrativoResponsabilidadeSocial2011_1.IdQuestionario        = IdQuestionario;
                    this.UCAdministrativoResponsabilidadeSocial2011_1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCAdministrativoResponsabilidadeSocial2011_1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCAdministrativoResponsabilidadeSocial2011_1.IdTurma = IdTurma;

                    this.UCAdministrativoResponsabilidadeSocial2011_1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntQuestionario.QUESTIONARIO_GESTAO_2009:
                    this.UCAdministrativoGestao1.IdQuestionario        = IdQuestionario;
                    this.UCAdministrativoGestao1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCAdministrativoGestao1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCAdministrativoGestao1.IdTurma = IdTurma;

                    this.UCAdministrativoGestao1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntQuestionario.QUESTIONARIO_GESTAO_2011:
                    this.UCAdministrativoGestao2011_1.IdQuestionario        = IdQuestionario;
                    this.UCAdministrativoGestao2011_1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCAdministrativoGestao2011_1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCAdministrativoGestao2011_1.IdTurma = IdTurma;

                    this.UCAdministrativoGestao2011_1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntQuestionario.QUESTIONARIO_INOVACAO_2011:
                    this.UCAdministrativoInovacao1.IdQuestionario        = IdQuestionario;
                    this.UCAdministrativoInovacao1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCAdministrativoInovacao1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCAdministrativoGestao2011_1.IdTurma            = IdTurma;

                    this.UCAdministrativoInovacao1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;
                }
            }
            else
            {
                EntPergunta proximaPergunta = new BllPergunta().ObterPerguntaPorQuestionarioEmpresaPergunta(IdQuestionarioEmpresa, IdPergunta, false);

                switch (proximaPergunta.PerguntaTipo.IdPerguntaTipo)
                {
                case EntPerguntaTipo.PERGUNTA_TIPO_MULTIPLA_ESCOLHA_4_OPCOES:
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Pergunta              = proximaPergunta;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdTurma = IdTurma;

                    this.UCPerguntaMultiplaEscolha4Opcoes1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_MULTIPLA_ESCOLHA_3_OPCOES:
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Pergunta              = proximaPergunta;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaMultiplaEscolha4Opcoes1.IdTurma = IdTurma;

                    this.UCPerguntaMultiplaEscolha4Opcoes1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_TEXTO:
                    this.UCPerguntaTexto1.Pergunta              = proximaPergunta;
                    this.UCPerguntaTexto1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaTexto1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaTexto1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaTexto1.IdTurma = IdTurma;

                    this.UCPerguntaTexto1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_SIM_NAO:
                    this.UCPerguntaSimNao1.Pergunta              = proximaPergunta;
                    this.UCPerguntaSimNao1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaSimNao1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaSimNao1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaSimNao1.IdTurma = IdTurma;

                    this.UCPerguntaSimNao1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_31_QUESTIONARIO_GESTAO_2009_2010:
                    this.UCPerguntaEspecialGestao311.Pergunta              = proximaPergunta;
                    this.UCPerguntaEspecialGestao311.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaEspecialGestao311.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaEspecialGestao311.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaEspecialGestao311.IdTurma = IdTurma;

                    this.UCPerguntaEspecialGestao311.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_32_QUESTIONARIO_GESTAO_2011:
                    this.UCPerguntaEspecialGestao32_1.Pergunta              = proximaPergunta;
                    this.UCPerguntaEspecialGestao32_1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaEspecialGestao32_1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaEspecialGestao32_1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaEspecialGestao32_1.IdTurma = IdTurma;

                    this.UCPerguntaEspecialGestao32_1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_1_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2009_2010:
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Pergunta              = proximaPergunta;
                    this.UCPerguntaEspecialResponsabilidadeSocial11.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaEspecialResponsabilidadeSocial11.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaEspecialResponsabilidadeSocial11.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaEspecialResponsabilidadeSocial11.IdTurma = IdTurma;

                    this.UCPerguntaEspecialResponsabilidadeSocial11.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_6_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2009_2010:
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Pergunta              = proximaPergunta;
                    this.UCPerguntaEspecialResponsabilidadeSocial61.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaEspecialResponsabilidadeSocial61.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaEspecialResponsabilidadeSocial61.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaEspecialResponsabilidadeSocial61.IdTurma = IdTurma;

                    this.UCPerguntaEspecialResponsabilidadeSocial61.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_3_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2011:
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Pergunta              = proximaPergunta;
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.IdTurma = IdTurma;

                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_7A_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2011:
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Pergunta              = proximaPergunta;
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.IdTurma = IdTurma;

                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    break;

                case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_8B_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2011:
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Pergunta              = proximaPergunta;
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.IdQuestionario        = IdQuestionario;
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.IdEmpresaCadastro     = IdEmpresaCadastro;
                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.IdTurma = IdTurma;

                    this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Visible = true;

                    this.UCAdministrativoEmpreendedorismo1.Dispose();
                    this.UCAdministrativoGestao1.Dispose();
                    this.UCAdministrativoGestao2011_1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial1.Dispose();
                    this.UCAdministrativoInovacao1.Dispose();
                    this.UCAdministrativoResponsabilidadeSocial2011_1.Dispose();
                    this.UCPerguntaMultiplaEscolha4Opcoes1.Dispose();
                    this.UCPerguntaSimNao1.Dispose();
                    this.UCPerguntaTexto1.Dispose();
                    this.UCPerguntaEspecialGestao311.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial61.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial3_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Dispose();
                    this.UCPerguntaEspecialResponsabilidadeSocial11.Dispose();
                    this.UCPerguntaEspecialGestao32_1.Dispose();
                    break;
                }
            }
        }
Exemplo n.º 16
0
        protected void grdSimplificado_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Index = ObjectUtils.ToInt(e.CommandArgument) - (grdSimplificado.PageIndex * grdSimplificado.PageSize);

            if (e.CommandName == "Gravar")
            {
                //Gravar
                DropDownList DrpDwnLstSenior = ((DropDownList)grdSimplificado.Rows[Index].FindControl("DrpDwnLstSenior"));

                if (DrpDwnLstSenior.SelectedIndex == 0)
                {
                    MessageBox(this, "Selecione o Consultor!");
                }
                else
                {
                    Label       lblIdEmpresaCadastro     = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEmpresaCadastro"));
                    Label       lblIdQuestionarioEmpresa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa"));
                    ImageButton imgBtnSalvar             = ((ImageButton)grdSimplificado.Rows[Index].FindControl("ImgBttnGravar"));
                    int         IdEmpresaCadastro        = StringUtils.ToInt(((Label)this.grdSimplificado.Rows[Index].Cells[1].FindControl("lblIdEmpresaCadastro")).Text);
                    int         IdEtapa = StringUtils.ToInt(((Label)this.grdSimplificado.Rows[Index].Cells[1].FindControl("lblIdEtapa")).Text);

                    RelFiltroRanking objRelFiltroRanking = this.UCFiltroRanking1.GetFiltro(int.Parse(Request["TipoEtapaId"]));
                    foreach (EntQuestionarioEmpresa qe in new BllQuestionarioEmpresa().ObterQuestionarioEmpresaAtivoPorTurmaEmpresa(int.Parse(lblIdEmpresaCadastro.Text), objRelFiltroRanking.Turma))
                    {
                        EntQuestionarioEmpresaAvaliador objQuestionarioEmpresaAvaliador = new EntQuestionarioEmpresaAvaliador();

                        objQuestionarioEmpresaAvaliador.QuestionarioEmpresa.IdQuestionarioEmpresa = qe.IdQuestionarioEmpresa;
                        objQuestionarioEmpresaAvaliador.Usuario.IdUsuario = StringUtils.ToInt(DrpDwnLstSenior.SelectedValue);
                        objQuestionarioEmpresaAvaliador.Avaliado          = false;
                        objQuestionarioEmpresaAvaliador.Primario          = true;

                        new BllQuestionarioEmpresaAvaliador().Inserir(objQuestionarioEmpresaAvaliador);
                    }

                    new BllRelatorioRanking().EncaminharProximaEtapa(IdEmpresaCadastro, (int)EnumType.Questionario.Gestao, IdEtapa, false);

                    DrpDwnLstSenior.Enabled = false;
                    imgBtnSalvar.Visible    = false;
                }
            }
            else
            if (e.CommandName == "Desclassificar")
            {
                Label lblIdQuestionarioEmpresa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa"));
                Label lblFlDesclassificado     = ((Label)grdSimplificado.Rows[Index].FindControl("lblFlDesclassificado"));

                int IdQuestionarioEmpresa = StringUtils.ToInt(lblIdQuestionarioEmpresa.Text);

                if (lblFlDesclassificado.Text == "True")
                {
                    EntQuestionarioEmpresa objQuestionarioEmpresa = new EntQuestionarioEmpresa();
                    objQuestionarioEmpresa.IdQuestionarioEmpresa = int.Parse(lblIdQuestionarioEmpresa.Text);
                    objQuestionarioEmpresa.Excluido = false;
                    new BllQuestionarioEmpresa().AlterarSomenteDesclassificar(objQuestionarioEmpresa);
                }
                else if (lblFlDesclassificado.Text == "False")
                {
                    switch (objPrograma.IdPrograma)
                    {
                    case (int)EnumType.Programa.MPE:
                        this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaMpe.ClassificaçãoEstadual, EnumType.Questionario.Gestao);
                        break;

                    case (int)EnumType.Programa.FGA:
                        this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaFga.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao);
                        break;

                    case (int)EnumType.Programa.PEG:
                        this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaPeg.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao);
                        break;

                    default:
                        this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaMpe.ClassificaçãoEstadual, EnumType.Questionario.Gestao);
                        break;
                    }
                }

                CheckBox ChckBxDesclassificar = ((CheckBox)grdSimplificado.Rows[Index].FindControl("ChckBxDesclassificar"));
                CheckBox ChckBxClassificar    = ((CheckBox)grdSimplificado.Rows[Index].FindControl("ChckBxClassificar"));

                ImageButton imgBttnDesclassificar = ((ImageButton)grdSimplificado.Rows[Index].FindControl("imgBttnDesclassificar"));
                ImageButton ImgBttnClassificar    = ((ImageButton)grdSimplificado.Rows[Index].FindControl("ImgBttnClassificar"));

                if (ChckBxDesclassificar.Checked)
                {
                    imgBttnDesclassificar.ImageUrl = "~/Image/unchecked.gif";
                    ChckBxDesclassificar.Checked   = false;
                    HabilitaDesabilitaBotao(ImgBttnClassificar, true);
                }
                else
                {
                    imgBttnDesclassificar.ImageUrl = "~/Image/checked.gif";
                    ChckBxDesclassificar.Checked   = true;
                    HabilitaDesabilitaBotao(ImgBttnClassificar, false);
                }
            }
            else if (e.CommandName == "Visualizar")
            {
                RelFiltroRanking objRelFiltroRanking = this.UCFiltroRanking1.GetFiltro(int.Parse(Request["TipoEtapaId"]));
                int IdTurma           = objRelFiltroRanking.Turma;
                int IdEmpresaCadastro = StringUtils.ToInt(((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa")).Text);
                this.UCVisualizarAutodiagnosticoInicial1.Visualiar(IdEmpresaCadastro, IdTurma);
            }
            else if (e.CommandName == "Update")
            {
                CheckBox           ChckBxClassificar        = ((CheckBox)grdSimplificado.Rows[Index].FindControl("ChckBxClassificar"));
                Label              lblIdEmpresaCadastro     = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEmpresaCadastro"));
                Label              lblIdQuestionarioEmpresa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa"));
                Label              lblIdEstado         = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEstado"));
                Label              lblIdEtapa          = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEtapa"));
                RelFiltroRanking   objRelFiltroRanking = this.UCFiltroRanking1.GetFiltro(int.Parse(Request["TipoEtapaId"]));
                DropDownList       DrpDwnLstSenior     = ((DropDownList)grdSimplificado.Rows[Index].FindControl("DrpDwnLstSenior"));
                EntEmpresaCadastro objEmpresaCadastro  = new BllEmpresaCadastro().ObterPorId(int.Parse(lblIdEmpresaCadastro.Text));

                if (!ChckBxClassificar.Checked)
                {
                    List <EntAdmUsuario> ListaUser = new BllAdmUsuario().ObterPorFuncionalidade("Avaliações", objEmpresaCadastro.Estado.IdEstado, objPrograma.IdPrograma, objRelFiltroRanking.Turma);
                    DrpDwnLstSenior.Items.Clear();
                    DrpDwnLstSenior.DataSource = ListaUser;
                    DrpDwnLstSenior.DataBind();
                    DrpDwnLstSenior.Items.Insert(0, new ListItem("<< Selecionar >>", "0"));
                    DrpDwnLstSenior.SelectedValue = "0";
                }
                else
                {
                    EntEtapa objEtapa = new BllEtapa().ObterProximaEtapaPorEtapaEstadoOrdem(int.Parse(lblIdEtapa.Text));

                    new BllQuestionarioEmpresaAvaliador().RemoverPorQuestionarioEmpresa(int.Parse(lblIdQuestionarioEmpresa.Text));
                    new BllQuestionarioEmpresa().AlterarSomentePassaProximaEtapa(int.Parse(lblIdQuestionarioEmpresa.Text));
                    new BllQuestionarioEmpresa().DesabilitaAnteriores(int.Parse(lblIdEmpresaCadastro.Text), objEtapa.IdEtapa, EntQuestionario.QUESTIONARIO_GESTAO_2011);
                }
            }
            else if (e.CommandName == "Download")
            {
                Boolean comentarios = false;
                Int32   intro       = 0;
                String  estado      = null;
                String  categoria   = null;
                String  protocolo   = ((Label)grdSimplificado.Rows[Index].Cells[8].Controls[1]).Text;
                Int32   programaId  = objPrograma.IdPrograma;
                Boolean avaliador   = false;
                String  caminho     = "";

                List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo);

                if (listQuestionarioEmpresa != null)
                {
                    List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programaId);

                    if (listEmpresaCadastro != null)
                    {
                        caminho = new PaginaBase().gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, comentarios, programaId, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), intro, false, this.Page);
                        if (caminho != "")
                        {
                            NovaJanela(this.Page, caminho);
                        }
                    }
                }
            }
        }