示例#1
0
        /// <summary>
        /// Valida dados necessários para salvar a entidade. Dispara um ValidationException caso não
        /// esteja válida.
        /// </summary>
        /// <param name="entity">Entidade a validar</param>
        /// <param name="banco">Transação com banco do Gestão - obrigatório</param>
        /// <param name="ent_id">Id da entidade do usuário logado.</param>
        private static void ValidaDados(ACA_AlunoCurriculo entity, TalkDBTransaction banco, Guid ent_id)
        {
            //Validação feita no BO devido a alteração de nome dos campos para os diferentes clientes
            if (entity.cur_id <= 0)
            {
                throw new ACA_AlunoCurriculo_ValidationException(GestaoEscolarUtilBO.nomePadraoCurso(ent_id) + " é obrigatório.");
            }

            if (entity.crr_id <= 0)
            {
                throw new ACA_AlunoCurriculo_ValidationException(GestaoEscolarUtilBO.nomePadraoCurso(ent_id) + " é obrigatório.");
            }

            if (entity.crp_id <= 0)
            {
                throw new ACA_AlunoCurriculo_ValidationException(GestaoEscolarUtilBO.nomePadraoPeriodo(ent_id) + " é obrigatório.");
            }

            if (!string.IsNullOrEmpty(entity.alc_matriculaEstadual) && entity.alc_matriculaEstadual.Length > 50)
            {
                throw new ACA_AlunoCurriculo_ValidationException(GestaoEscolarUtilBO.nomePadraoMatriculaEstadual(ent_id) + " pode conter até 50 caracteres.");
            }

            //Se for uma nova matrícula e se a situação dela for 'Ativa' ou 'Em matrícula'
            //Verifica se já existe uma matrícula cadastrada com os mesmos dados
            if (entity.IsNew &&
                (entity.alc_situacao == Convert.ToByte(ACA_AlunoCurriculoSituacao.Ativo) ||
                 entity.alc_situacao == Convert.ToByte(ACA_AlunoCurriculoSituacao.EmMatricula)))
            {
                if (Existe_AlunoCurriculo(entity.alu_id, entity.cur_id, entity.crr_id, entity.crp_id, banco))
                {
                    ESC_Escola esc = new ESC_Escola {
                        esc_id = entity.esc_id
                    };
                    ESC_EscolaBO.GetEntity(esc, banco);

                    ACA_Curso cur = new ACA_Curso {
                        cur_id = entity.cur_id
                    };
                    ACA_CursoBO.GetEntity(cur, banco);

                    ACA_CurriculoPeriodo crp = new ACA_CurriculoPeriodo {
                        cur_id = entity.cur_id, crr_id = entity.crr_id, crp_id = entity.crp_id
                    };
                    ACA_CurriculoPeriodoBO.GetEntity(crp, banco);

                    throw new ACA_AlunoCurriculo_ValidationException("Já existe uma matrícula 'Ativa' ou 'Em matrícula' cadastrada com os mesmos dados: <BR/>" +
                                                                     "Escola: " + esc.esc_nome + "<BR/>" +
                                                                     GestaoEscolarUtilBO.nomePadraoCurso(ent_id) + ": " + cur.cur_nome + "<BR/>" +
                                                                     GestaoEscolarUtilBO.nomePadraoPeriodo(ent_id) + ": " + crp.crp_descricao);
                }
            }
        }
示例#2
0
    protected void Page_Init(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!String.IsNullOrEmpty(ACA_ParametroAcademicoBO.ParametroValorPorEntidade(eChaveAcademico.MATRICULA_ESTADUAL, __SessionWEB.__UsuarioWEB.Usuario.ent_id)))
            {
                _dgvAlunos.Columns[_dgvAlunos_ColunaNumeroMatricula].HeaderText = GestaoEscolarUtilBO.nomePadraoMatriculaEstadual(__SessionWEB.__UsuarioWEB.Usuario.ent_id);
            }

            HtmlTableCell cell = tbLegenda.Rows[0].Cells[0];
            if (cell != null)
            {
                cell.BgColor = ApplicationWEB.AlunoInativo;
            }
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (__SessionWEB.__UsuarioWEB.Grupo.vis_id == SysVisaoID.Individual)
                {
                    if (__SessionWEB.__UsuarioWEB.Docente.doc_id > 0)
                    {
                        UCComboUAEscola1.Visible = false;
                    }
                }
                else
                {
                    UCComboUAEscola1.Inicializar();
                }

                ConfiguraBusca();
            }

            //atualiza parametro academico TIPO_EDUCACAO_ESPECIAL_ALUNO_DEFICIENCIA
            Atualiza_param_TIPO_EDUCACAO_ESPECIAL_ALUNO_DEFICIENCIA();

            grvAluno.Columns[INDEX_COLUMN_ESCOLA_RECURSO].Visible = grvAluno.Columns[INDEX_COLUMN_TURMA_RECURSO].Visible = false;
            grvAluno.Columns[INDEX_COLUMN_PERIODO].Visible        = grvAluno.Columns[INDEX_COLUMN_CURSO].Visible = true;

            switch (TipoBusca)
            {
            case eTipoBuscaAluno.AlunosAtivosSalaRecurso:
                odsAluno.SelectMethod = "SelecionaAlunosMatriculadosSalaRecurso";
                grvAluno.Columns[INDEX_COLUMN_ESCOLA_RECURSO].Visible = grvAluno.Columns[INDEX_COLUMN_TURMA_RECURSO].Visible = true;
                grvAluno.Columns[INDEX_COLUMN_PERIODO].Visible        = grvAluno.Columns[INDEX_COLUMN_CURSO].Visible = false;
                break;

            case eTipoBuscaAluno.AlunosAtivosClasseEspecial:
                odsAluno.SelectMethod = "SelecionaAlunosMatriculadosClasseEspecial";
                break;

            case eTipoBuscaAluno.TodosAlunosEducacaoEspecial:
                odsAluno.SelectMethod = "SelecionaTodosAlunosEducacaoEspecial";
                grvAluno.Columns[INDEX_COLUMN_ESCOLA_RECURSO].Visible = grvAluno.Columns[INDEX_COLUMN_TURMA_RECURSO].Visible = true;
                grvAluno.Columns[INDEX_COLUMN_PERIODO].Visible        = grvAluno.Columns[INDEX_COLUMN_CURSO].Visible = false;
                break;

            case eTipoBuscaAluno.AlunosComDeficiencia:
                odsAluno.SelectMethod = "SelecionaAlunosMatriculadosDeficiencia";
                break;
            }

            // Seta nomes padrões para os clientes
            grvAluno.Columns[INDEX_COLUMN_MATRICULA].HeaderText = lblMatricula.Text = GestaoEscolarUtilBO.nomePadraoMatriculaEstadual(__SessionWEB.__UsuarioWEB.Usuario.ent_id);
            grvAluno.Columns[INDEX_COLUMN_CURSO].HeaderText     = GestaoEscolarUtilBO.nomePadraoCurso(__SessionWEB.__UsuarioWEB.Usuario.ent_id);
            grvAluno.Columns[INDEX_COLUMN_PERIODO].HeaderText   = GestaoEscolarUtilBO.nomePadraoPeriodo(__SessionWEB.__UsuarioWEB.Usuario.ent_id);
        }
示例#4
0
    /// <summary>
    /// Metodo atribui a label informações sobre aluno(nome, escola, curso, ano, matricula, turma, avaliação, nºchamada).
    /// </summary>
    /// <param name="alu_id">ID do aluno</param>
    /// <param name="dtCurriculo">Último currículo do aluno (parâmetro opcional)</param>
    public void InformacaoComplementarAluno(long alu_id, DataTable dtCurriculo = null, bool documentoOficial = false)
    {
        try
        {
            if (alu_id > 0)
            {
                ACA_Aluno  entityAluno  = new ACA_Aluno();
                PES_Pessoa entityPessoa = new PES_Pessoa();

                // Carrega entidade ACA_Aluno
                entityAluno.alu_id = alu_id;
                ACA_AlunoBO.GetEntity(entityAluno);

                // Carrega entidade PES_Pessoa
                entityPessoa.pes_id = entityAluno.pes_id;
                PES_PessoaBO.GetEntity(entityPessoa);

                eExibicaoNomePessoa exibicaoNome = documentoOficial ? eExibicaoNomePessoa.NomeSocial | eExibicaoNomePessoa.NomeRegistro : eExibicaoNomePessoa.NomeSocial;

                string nomeAluno = entityPessoa.NomeFormatado(exibicaoNome);
                string turno     = string.Empty;
                Guid   ent_id    = __SessionWEB.__UsuarioWEB.Usuario.ent_id;

                bool paramOrdenar = ACA_ParametroAcademicoBO.ParametroValorBooleanoPorEntidade(eChaveAcademico.ORDENAR_ESCOLAS_POR_CODIGO, ent_id);

                //Nome
                lblInformacaoAluno.Text = "<b>Nome do aluno: </b>" + nomeAluno + "<br/>";

                //Idade
                if (entityPessoa.pes_dataNascimento != new DateTime() && entityPessoa.pes_dataNascimento < DateTime.Today)
                {
                    string dataExtenso = GestaoEscolarUtilBO.DiferencaDataExtenso(entityPessoa.pes_dataNascimento, DateTime.Today);
                    if (!string.IsNullOrEmpty(dataExtenso))
                    {
                        lblInformacaoAluno.Text += "<b>Idade: </b>" + dataExtenso + "<br/>";
                    }
                }

                // Caso estiver sendo chamada da tela de cadastro de aluno, o datatable com a ultima matricula já virá preenchido
                if (dtCurriculo == null)
                {
                    dtCurriculo = ACA_AlunoCurriculoBO.SelecionaDadosUltimaMatricula(alu_id);
                }

                if (dtCurriculo.Rows.Count > 0)
                {
                    #region Carrega os dados

                    Esc_id = (string.IsNullOrEmpty(dtCurriculo.Rows[0]["esc_id"].ToString())) ? -1 : Convert.ToInt32(dtCurriculo.Rows[0]["esc_id"]);
                    string nomeEscola        = dtCurriculo.Rows[0]["esc_nome"].ToString();
                    string codigoEscola      = dtCurriculo.Rows[0]["esc_codigo"].ToString();
                    string cursoNome         = dtCurriculo.Rows[0]["cur_nome"].ToString();
                    string descricaoPeriodo  = dtCurriculo.Rows[0]["crp_descricao"].ToString();
                    string matriculaEstadual = dtCurriculo.Rows[0]["alc_matriculaEstadual"].ToString();
                    string numeroMatricula   = dtCurriculo.Rows[0]["alc_matricula"].ToString();
                    string turmaCodigo       = dtCurriculo.Rows[0]["tur_codigo"].ToString();
                    string mtu_numeroChamada = dtCurriculo.Rows[0]["mtu_numeroChamada"].ToString();
                    string nomeAvaliacao     = dtCurriculo.Rows[0]["crp_nomeAvaliacao"].ToString();
                    string numeroAvaliacao   = dtCurriculo.Rows[0]["tca_numeroAvaliacao"].ToString();
                    string cal_ano           = dtCurriculo.Rows[0]["cal_ano"].ToString();
                    turno = dtCurriculo.Rows[0]["ttn_nome"].ToString();

                    #endregion Carrega os dados

                    //Escola

                    lblInformacaoAluno.Text += "<b>Escola: </b>";
                    lblInformacaoAluno.Text += (paramOrdenar ? codigoEscola + " - " : "") + nomeEscola + "<br/>";

                    if (!HistoricoEscolar)
                    {
                        //Curso
                        lblInformacaoAluno.Text += " <b>" + GestaoEscolarUtilBO.nomePadraoCurso(ent_id) + ": </b>" + cursoNome;


                        //Periodo
                        lblInformacaoAluno.Text += "&nbsp;&nbsp;&nbsp;<b>" + GestaoEscolarUtilBO.nomePadraoPeriodo(ent_id) + ": </b>" + descricaoPeriodo + "<br/>";

                        //Matricula
                        if (!string.IsNullOrEmpty(ACA_ParametroAcademicoBO.ParametroValorPorEntidade(eChaveAcademico.MATRICULA_ESTADUAL, ent_id)))
                        {
                            if (!string.IsNullOrEmpty(matriculaEstadual))
                            {
                                lblInformacaoAluno.Text += " <b>" + GestaoEscolarUtilBO.nomePadraoMatriculaEstadual(ent_id) + ": " + "</b>" + matriculaEstadual + "&nbsp;&nbsp;&nbsp;";
                            }
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(numeroMatricula))
                            {
                                lblInformacaoAluno.Text += "<b> " + GetGlobalResourceObject("Mensagens", "MSG_NUMEROMATRICULA") + ": " + "</b>" + numeroMatricula + "&nbsp;&nbsp;&nbsp;";
                            }
                        }

                        //Turma
                        lblInformacaoAluno.Text += "<b>Turma: </b>" + turmaCodigo;

                        if (!string.IsNullOrEmpty(turno))
                        {
                            //Turno
                            lblInformacaoAluno.Text += "&nbsp;&nbsp;&nbsp;<b>Turno: </b>" + turno;
                        }

                        //Avaliação
                        if (!string.IsNullOrEmpty(nomeAvaliacao) && !string.IsNullOrEmpty(numeroAvaliacao))
                        {
                            lblInformacaoAluno.Text += "&nbsp;&nbsp;&nbsp;<b>" + nomeAvaliacao + ": </b>" + numeroAvaliacao;
                        }
                    }
                    else
                    {
                        //Turma
                        lblInformacaoAluno.Text += "<b>Ciclo de alfabetização: </b>" + turmaCodigo + "<br/>";

                        //Ano
                        lblInformacaoAluno.Text += "<b>Ano: </b>" + cal_ano;
                    }

                    //Número de chamada
                    int numeroChamada;
                    Int32.TryParse(mtu_numeroChamada, out numeroChamada);

                    if (numeroChamada > 0)
                    {
                        lblInformacaoAluno.Text += "&nbsp;&nbsp;&nbsp;<b>Nº chamada: </b>" + mtu_numeroChamada;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            __SessionWEB.PostMessages = UtilBO.GetErroMessage("Erro ao tentar carregar as informações do aluno.", UtilBO.TipoMensagem.Erro);
        }
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager sm = ScriptManager.GetCurrent(this);

        if (sm != null)
        {
            sm.Scripts.Add(new ScriptReference(ArquivoJS.UiAriaTabs));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.Tabs));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.JqueryMask));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.MascarasCampos));
            sm.Scripts.Add(new ScriptReference("~/Includes/jsCadastroPessoa.js"));
            sm.Scripts.Add(new ScriptReference("~/Includes/jsUCCadastroEndereco.js"));
            sm.Scripts.Add(new ScriptReference("~/Includes/jsCadastroCertidaoCivil.js"));
            sm.Services.Add(new ServiceReference("~/WSServicos.asmx"));
        }

        if (!IsPostBack)
        {
            cvDataNascimento.ErrorMessage = GestaoEscolarUtilBO.RetornaMsgValidacaoData("Data de nascimento do aluno");
            CustomValidator1.ErrorMessage = GestaoEscolarUtilBO.RetornaMsgValidacaoData("Data de emissão da certidão de nascimento");

            string message = __SessionWEB.PostMessages;
            if (!String.IsNullOrEmpty(message))
            {
                lblMessage.Text = message;
            }

            lblMatriculaEstadual.Text         = GestaoEscolarUtilBO.nomePadraoMatriculaEstadual() + " *";
            rfvMatriculaEstadual.ErrorMessage = GestaoEscolarUtilBO.nomePadraoMatriculaEstadual() + " é obrigatório.";

            UCComboTipoDeficiencia1._MostrarMessageSelecione = true;
            UCComboTipoDeficiencia1._Load(Guid.Empty, 0);

            UCEnderecos1.Inicializar(false, true, string.Empty);

            UCFiltroEscolas1.SelecionaCombosAutomatico             = false;
            UCFiltroEscolas1.UnidadeAdministrativaCampoObrigatorio = true;
            UCFiltroEscolas1.EscolaCampoObrigatorio = true;
            UCFiltroEscolas1._LoadInicial();

            UCComboCursoCurriculo1.Obrigatorio = true;
            UCComboCursoCurriculo1.CarregarCursoCurriculo();
            UCComboCursoCurriculo1.PermiteEditar = false;

            UCComboCurriculoPeriodo1._Label.Text += " *";
            UCComboCurriculoPeriodo1._MostrarMessageSelecione = true;
            UCComboCurriculoPeriodo1._Load(-1, -1);
            UCComboCurriculoPeriodo1._Combo.Enabled      = false;
            UCComboCurriculoPeriodo1.ExibeFormatoPeriodo = true;
            cvCurriculoPeriodo.ErrorMessage = GestaoEscolarUtilBO.nomePadraoPeriodo() + " é obrigatório.";

            try
            {
                if (__SessionWEB._cid_id != Guid.Empty)
                {
                    END_Cidade cid = new END_Cidade {
                        cid_id = __SessionWEB._cid_id
                    };
                    END_CidadeBO.GetEntity(cid);

                    _txtCid_id.Value     = cid.cid_id.ToString();
                    txtNaturalidade.Text = cid.cid_nome;

                    _txtCid_idCertidao.Value = cid.cid_id.ToString();
                    txtCidadeCertidao.Text   = cid.cid_nome;
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
            }

            UCGridContato1._CarregarContato();

            UCComboTipoDeficiencia1._Label.Text = "Necessidade educacional especial";
            UCComboEstadoCivil1._Label.Text     = "Estado civil *";
            UCComboRacaCor1._Label.Text         = "Raça / cor *";
            UCComboSexo1._Label.Text            = "Sexo *";

            UCComboEstadoCivil1._Combo.SelectedValue = "1";
            _ddlSituacao.SelectedValue = "1";

            Page.Form.DefaultFocus  = txtMatriculaEstadual.ClientID;
            Page.Form.DefaultButton = btnSalvarNovo.UniqueID;
            btnSalvarNovo.Visible   = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir;
        }

        UCFiltroEscolas1._Selecionar        += UCFiltroEscolas1__Selecionar;
        UCFiltroEscolas1._SelecionarEscola  += UCFiltroEscolas1__SelecionarEscola;
        UCComboCursoCurriculo1.IndexChanged += UCComboCursoCurriculo1_IndexChanged;
    }
示例#6
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <author>juliano.real</author>
        /// <datetime>12/10/2013-09:20</datetime>
        /// <exception cref="System.ComponentModel.DataAnnotations.ValidationException">Usuário não autorizado a exibir o area aluno.</exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                String sMensagemLog = "";

                divResponsavel.Visible = __SessionWEB.__UsuarioWEB.responsavel;

                Int64 alu_id     = 0;
                long  arq_idFoto = 0;
                if (__SessionWEB.__UsuarioWEB.responsavel && __SessionWEB.__UsuarioWEB.alu_id > 0)
                {
                    alu_id = __SessionWEB.__UsuarioWEB.alu_id;
                    PES_Pessoa pesAluno = new PES_Pessoa {
                        pes_id = __SessionWEB.__UsuarioWEB.pes_idAluno
                    };
                    PES_PessoaBO.GetEntity(pesAluno);
                    arq_idFoto = pesAluno.arq_idFoto;
                }
                else if (__SessionWEB.__UsuarioWEB.responsavel)
                {
                    alu_id = ACA_AlunoBO.SelectAlunoby_pes_id(__SessionWEB.__UsuarioWEB.pes_idAluno);
                    PES_Pessoa pesAluno = new PES_Pessoa {
                        pes_id = __SessionWEB.__UsuarioWEB.pes_idAluno
                    };
                    PES_PessoaBO.GetEntity(pesAluno);
                    arq_idFoto = pesAluno.arq_idFoto;
                }
                else
                {
                    alu_id = ACA_AlunoBO.SelectAlunoby_pes_id(__SessionWEB.__UsuarioWEB.Usuario.pes_id);
                    PES_Pessoa pesAluno = new PES_Pessoa {
                        pes_id = __SessionWEB.__UsuarioWEB.Usuario.pes_id
                    };
                    PES_PessoaBO.GetEntity(pesAluno);
                    arq_idFoto = pesAluno.arq_idFoto;
                }

                if (alu_id <= 0)
                {
                    sMensagemLog = "Usuário não autorizado a exibir Area do Aluno: usu_id: " + __SessionWEB.__UsuarioWEB.Usuario.usu_id.ToString();
                    throw new ValidationException("Usuário não autorizado a exibir o Area do Aluno.");
                }

                ACA_Aluno entityAluno = ACA_AlunoBO.GetEntity(new ACA_Aluno {
                    alu_id = alu_id
                });
                bool boletimBloqueado           = false;
                bool compromissoEstudoBloqueado = !ACA_TipoCicloBO.VerificaSeExibeCompromissoAluno(alu_id);

                if (entityAluno.alu_possuiInformacaoSigilosa && entityAluno.alu_bloqueioBoletimOnline)
                {
                    if (__SessionWEB.__UsuarioWEB.responsavel)
                    {
                        Fieldset2.Visible            = true;
                        lblBoletimNaoDisponivel.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("AreaAluno", "Index.lblBoletimNaoDisponivel.Text").ToString(), UtilBO.TipoMensagem.Informacao);
                        Fieldset1.Visible            = false;
                        return;
                    }
                    else
                    {
                        boletimBloqueado = true;
                    }
                }

                if (arq_idFoto > 0)
                {
                    string      imagem  = "";
                    CFG_Arquivo arquivo = new CFG_Arquivo {
                        arq_id = arq_idFoto
                    };
                    CFG_ArquivoBO.GetEntity(arquivo);
                    byte[] bufferData = arquivo.arq_data;

                    using (MemoryStream stream = new MemoryStream(bufferData))
                    {
                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
                        imagem = Convert.ToBase64String(stream.ToArray());
                    }

                    imgFotoAluno.ImageUrl = "data:" + arquivo.arq_typeMime + ";base64," + imagem;
                }

                DataTable dtCurriculo = ACA_AlunoCurriculoBO.SelecionaDadosUltimaMatricula(alu_id);

                if (dtCurriculo.Rows.Count <= 0)
                {
                    sMensagemLog = "Aluno não possui dados para a Area do Aluno: alu_id: " + alu_id.ToString();
                    throw new ValidationException("Aluno não possui dados para a Area do Aluno.");
                }

                string nomeAluno         = dtCurriculo.Rows[0]["pes_nome"].ToString();
                string matriculaEstadual = dtCurriculo.Rows[0]["alc_matriculaEstadual"].ToString();
                string numeroMatricula   = dtCurriculo.Rows[0]["alc_matricula"].ToString();

                //Nome Aluno
                lblInformacaoAluno.Text = "Aluno: <b>" + nomeAluno + "</b><br/>";

                //Matricula
                if (!string.IsNullOrEmpty(ACA_ParametroAcademicoBO.ParametroValorPorEntidade(eChaveAcademico.MATRICULA_ESTADUAL, __SessionWEB.__UsuarioWEB.Usuario.ent_id)))
                {
                    if (!string.IsNullOrEmpty(matriculaEstadual))
                    {
                        lblInformacaoAluno.Text += " <b>" + GestaoEscolarUtilBO.nomePadraoMatriculaEstadual(__SessionWEB.__UsuarioWEB.Usuario.ent_id) + ": " + "</b>" + matriculaEstadual + "&nbsp;&nbsp;&nbsp;";
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(numeroMatricula))
                    {
                        lblInformacaoAluno.Text += GetGlobalResourceObject("Mensagens", "MSG_NUMEROMATRICULA") + ": <b>" + numeroMatricula + "</b>" + "&nbsp;&nbsp;&nbsp;";
                    }
                }

                __SessionWEB.__UsuarioWEB.alu_id = Convert.ToInt64(dtCurriculo.Rows[0]["alu_id"].ToString());
                __SessionWEB.__UsuarioWEB.esc_id = Convert.ToInt32(dtCurriculo.Rows[0]["esc_id"].ToString());
                __SessionWEB.__UsuarioWEB.uni_id = Convert.ToInt32(dtCurriculo.Rows[0]["uni_id"].ToString());
                __SessionWEB.__UsuarioWEB.mtu_id = Convert.ToInt32(dtCurriculo.Rows[0]["mtu_id"].ToString());
                __SessionWEB.__UsuarioWEB.tpc_id = Convert.ToInt32(string.IsNullOrEmpty(dtCurriculo.Rows[0]["tpc_id"].ToString()) ? "-1" : dtCurriculo.Rows[0]["tpc_id"].ToString());

                int mod_id = GetModuloId;

                string menuXml = SYS_ModuloBO.CarregarSiteMapXML2(
                    __SessionWEB.__UsuarioWEB.Grupo.gru_id,
                    __SessionWEB.__UsuarioWEB.Grupo.sis_id,
                    __SessionWEB.__UsuarioWEB.Grupo.vis_id,
                    mod_id
                    );
                if (String.IsNullOrEmpty(menuXml))
                {
                    menuXml = "<menus/>";
                }
                menuXml = menuXml.Replace("url=\"~/", String.Concat("url=\"", ApplicationWEB._DiretorioVirtual));

                // Verifica se o aluno está com o boletim bloqueado. Se estiver, retiro do menu.
                int indiceBoletim = menuXml.IndexOf("<menu id=\"Boletim");
                if (boletimBloqueado && indiceBoletim >= 0)
                {
                    menuXml = menuXml.Remove(indiceBoletim, menuXml.IndexOf("/>", indiceBoletim) - indiceBoletim + 2);
                }

                IDictionary <string, ICFG_Configuracao> configuracao;
                MSTech.GestaoEscolar.BLL.CFG_ConfiguracaoBO.Consultar(eConfig.Academico, out configuracao);
                if (configuracao.ContainsKey("AppURLAreaAlunoInfantil") && !string.IsNullOrEmpty(configuracao["AppURLAreaAlunoInfantil"].cfg_valor))
                {
                    string url            = HttpContext.Current.Request.Url.AbsoluteUri;
                    string configInfantil = configuracao["AppURLAreaAlunoInfantil"].cfg_valor;

                    if (url.Contains(configInfantil))
                    {
                        menuXml = menuXml.Replace("menu id=\"Boletim Online\"", "menu id=\"" + (string)GetGlobalResourceObject("AreaAluno.MasterPageAluno", "MenuBoletimInfantil") + "\"");
                    }
                }

                // Verifica se o aluno está com o compromisso estudo bloqueado. Se estiver, retiro do menu.
                int indiceCompromissoEstudo = menuXml.IndexOf("<menu id=\"Compromisso de Estudo");
                if (compromissoEstudoBloqueado && indiceCompromissoEstudo >= 0)
                {
                    menuXml = menuXml.Remove(indiceCompromissoEstudo, menuXml.IndexOf("/>", indiceCompromissoEstudo) - indiceCompromissoEstudo + 2);
                }

                XmlTextReader        reader  = new XmlTextReader(new StringReader(menuXml));
                XPathDocument        treeDoc = new XPathDocument(reader);
                XslCompiledTransform siteMap = new XslCompiledTransform();

                if (__SessionWEB.__UsuarioWEB.responsavel)
                {
                    siteMap.Load(String.Concat(__SessionWEB._AreaAtual._DiretorioIncludes, "SiteMapResponsavel.xslt"));
                }
                else
                {
                    siteMap.Load(String.Concat(__SessionWEB._AreaAtual._DiretorioIncludes, "SiteMap.xslt"));
                }

                StringWriter sw = new StringWriter();
                siteMap.Transform(treeDoc, null, sw);
                string result = sw.ToString();

                List <CFG_ModuloClasse> lstModClasse = CFG_ModuloClasseBO.SelecionaAtivos(ApplicationWEB.AreaAlunoSistemaID);

                if (lstModClasse.Any())
                {
                    //Carrega a lista de link e moduloId
                    Dictionary <string, string> linkModulo = new Dictionary <string, string>();
                    string[] linkMenusXml = menuXml.Split(new[] { "<menu id=\"" }, StringSplitOptions.None);
                    if (linkMenusXml.Length > 0)
                    {
                        bool primeiroItem = true;
                        foreach (string item in linkMenusXml)
                        {
                            if (!primeiroItem)
                            {
                                string link   = item.Substring(item.IndexOf("url=\"") + 5, item.Substring(item.IndexOf("url=\"") + 5).IndexOf("\""));
                                string modulo = item.Substring(0, item.IndexOf("\""));
                                linkModulo.Add(link, modulo);
                            }
                            primeiroItem = false;
                        }
                    }

                    //Carrega a lista de link e classe css atual
                    Dictionary <string, string> linkClasse = new Dictionary <string, string>();
                    string[] linkMenus = result.Split(new[] { "<li class=\"txtSubMenu\"><a " }, StringSplitOptions.None);
                    if (linkMenus.Length > 0)
                    {
                        bool primeiroItem = true;
                        foreach (string item in linkMenus)
                        {
                            if (!primeiroItem)
                            {
                                string link   = item.Substring(item.IndexOf("href=\"") + 6, item.Substring(item.IndexOf("href=\"") + 6).IndexOf("\""));
                                string classe = item.Substring(item.IndexOf("class=\"") + 7, item.Substring(item.IndexOf("class=\"") + 7).IndexOf("\""));
                                linkClasse.Add(link, "class=\"" + classe + "\" " + "href=\"" + link);
                            }
                            primeiroItem = false;
                        }
                    }

                    //Troca a classe css atual do link conforme o que está configurado na tabela filtrando pelo modulo
                    if (linkModulo.Count > 0 && linkClasse.Count > 0)
                    {
                        foreach (var item in linkClasse)
                        {
                            string modulo = linkModulo[item.Key];
                            if (!string.IsNullOrEmpty(modulo) && lstModClasse.Any(p => p.mod_nome == modulo))
                            {
                                string classeCfg = lstModClasse.Where(p => p.mod_nome == modulo).FirstOrDefault().mdc_classe;
                                if (!string.IsNullOrEmpty(classeCfg))
                                {
                                    result = result.Replace(item.Value, "class=\"link " + classeCfg + "\" " + "href=\"" + item.Key);
                                }
                            }
                        }
                    }
                }

                //Control ctrl = Page.ParseControl(result);
                _lblSiteMap.Text = result;

                if (!string.IsNullOrEmpty(ApplicationWEB.UrlAcessoExternoBoletimOnline))
                {
                    string[] crp_ordem = ApplicationWEB.Crp_ordem_AcessoExternoBoletimOnline;
                    // Só exibe o ícone caso o aluno esteja em alguma das séries parametrizadas.
                    if (crp_ordem.Contains(dtCurriculo.Rows[0]["crp_ordem"].ToString()))
                    {
                        // Seta um nó de menu para acesso ao site externo.
                        ulItemAcessoExterno.Visible     = true;
                        lblAcessoExterno.Text           = GetGlobalResourceObject("AreaAluno", "Index.lblAcessoExternoNome").ToString();
                        lnkAcessoExterno.HRef           = ApplicationWEB.UrlAcessoExternoBoletimOnline;
                        h2TituloAcessoExterno.InnerHtml = GetGlobalResourceObject("AreaAluno", "Index.lblAcessoExternoNome").ToString();
                    }
                }

                sMensagemLog = "Area do Aluno exibida para aluno: alu_id: " + alu_id.ToString();
                ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Query, sMensagemLog);
            }
            catch (ValidationException ex)
            {
                lblMessage.Text       = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
                btnVoltar.PostBackUrl = __SessionWEB.UrlCoreSSO + "/Sistema.aspx";
                btnVoltar.Visible     = true;
                divInformacao.Visible = false;
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text       = UtilBO.GetErroMessage("Erro ao exibir a Area do aluno", UtilBO.TipoMensagem.Erro);
                btnVoltar.PostBackUrl = __SessionWEB.UrlCoreSSO + "/Sistema.aspx";
                btnVoltar.Visible     = true;
                divInformacao.Visible = false;
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
        }