예제 #1
0
        /// <summary>
        /// Load da pagina
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager sm = ScriptManager.GetCurrent(Page);

            if (sm != null)
            {
                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/redactor/redactor.js"));
                sm.Scripts.Add(new ScriptReference("~/Includes/ckeditor/ckeditor.js"));
                sm.Scripts.Add(new ScriptReference("~/Includes/jsAvisosTextosGerais.js"));
            }

            txtDescricao.config.toolbar = new object[]
            {
                new object[]
                {
                    "Cut", "Copy", "-", "Paste", "PasteText", "PasteFromWord", "-", "Undo",
                    "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat", "-",
                    "Table", "-", "Templates"
                },
                new object[]
                {
                    "Image", "Smiley", "SpecialChar", "-", "_dataAtual", "_diasAtraso",
                    "_nome", "_valorDivida", "-", "Bold", "Italic", "Underline", "Strike",
                    "TextColor", "BGColor", "-", "Subscript", "Superscript", "-",
                    "NumberedList", "BulletedList", "-", "Link", "Unlink", "Anchor",
                    "HorizontalRule"
                },
                "/",
                new object[] { "Format", "Font", "FontSize" },
                new object[]
                {
                    "Outdent", "Indent", "-", "JustifyLeft", "JustifyCenter",
                    "JustifyRight", "JustifyBlock", "-", "Preview", "-", "About"
                },
            };


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

                    if (TipoAvisotextoGerais == (int)ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.Cabecalho ||
                        TipoAvisotextoGerais == (int)ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.CabecalhoRelatorio)
                    {
                        TrataFiltrosCabecalho();
                        CarregarCabecalho();
                    }
                    else if (TipoAvisotextoGerais == (int)ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.Declaracao)//Cadastro/Edicao de declaracao
                    {
                        CarregarRLT();
                        TrataFiltrosDeclaracao();
                    }
                    else
                    {
                        UCComboUAEscola1.Inicializar();

                        if (VS_atg_id > 0)//Edicao de aviso
                        {
                            Carregar();
                            TrataFiltrosAviso();
                        }
                        else//Cadastro de aviso
                        {
                            //Inicializa os campos de busca
                            InicializaCamposBusca();
                        }
                    }

                    divCampoAuxiliar.Visible = TipoAvisotextoGerais != 6;

                    Page.Form.DefaultFocus  = UCComboUAEscola1.VisibleUA ? UCComboUAEscola1.ComboUA_ClientID : UCComboUAEscola1.ComboEscola_ClientID;
                    Page.Form.DefaultButton = btnSalvar.UniqueID;
                    UCComboCampoAuxiliar1.Focus();

                    btnSalvar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir || __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_alterar;
                }
                catch (Exception ex)
                {
                    ApplicationWEB._GravaErro(ex);
                    lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro);
                }
            }
        }
예제 #2
0
    protected void _grvParametroIntegracao_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridView grv = ((GridView)sender);

        try
        {
            ACA_ParametroIntegracao entityParametroIntegracao = new ACA_ParametroIntegracao()
            {
                IsNew = Boolean.Parse(grv.DataKeys[e.RowIndex]["IsNew"].ToString())
                ,
                pri_id = Convert.ToInt32(grv.DataKeys[e.RowIndex]["pri_id"])
                ,
                pri_situacao = Byte.Parse(grv.DataKeys[e.RowIndex]["pri_situacao"].ToString())
            };

            TextBox txtChave = (TextBox)_grvParametroIntegracao.Rows[e.RowIndex].FindControl("_txtChave");
            if (txtChave != null)
            {
                entityParametroIntegracao.pri_chave = txtChave.Text;
            }
            TextBox txtDescricao = (TextBox)_grvParametroIntegracao.Rows[e.RowIndex].FindControl("_txtDescricao");
            if (txtDescricao != null)
            {
                entityParametroIntegracao.pri_descricao = txtDescricao.Text;
            }

            if (entityParametroIntegracao.pri_chave == eChaveIntegracao.HABILITA_INTEG_COLAB_DOCENTES.ToString())
            {
                DropDownList ddlValor = (DropDownList)_grvParametroIntegracao.Rows[e.RowIndex].FindControl("_ddlValor");
                if (ddlValor != null)
                {
                    entityParametroIntegracao.pri_valor = ddlValor.SelectedItem.Text;
                }
            }
            else
            {
                TextBox txtValor = (TextBox)_grvParametroIntegracao.Rows[e.RowIndex].FindControl("_txtValor");
                if (txtValor != null)
                {
                    entityParametroIntegracao.pri_valor = txtValor.Text;
                }
            }

            if (ACA_ParametroIntegracaoBO.Salvar(entityParametroIntegracao))
            {
                ACA_ParametroIntegracaoBO.RecarregaParametrosAtivos();

                if (Boolean.Parse(grv.DataKeys[e.RowIndex]["IsNew"].ToString()))
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "pri_id: " + entityParametroIntegracao.pri_id);
                    _lblMessage.Text = UtilBO.GetErroMessage("Parâmetro de integração incluído com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }
                else
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "pri_id: " + entityParametroIntegracao.pri_id);
                    _lblMessage.Text = UtilBO.GetErroMessage("Parâmetro de integração alterado com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }
                ApplicationWEB.RecarregarConfiguracoes();
                grv.EditIndex = -1;
                grv.DataBind();
            }
        }
        catch (ValidationException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (DuplicateNameException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar parâmetro de integração.", UtilBO.TipoMensagem.Erro);
        }
        finally
        {
            _updMessage.Update();
        }
    }
예제 #3
0
    private void _Carregar(Guid dnu_id)
    {
        try
        {
            SYS_DiaNaoUtil _DiaNaoUtil = new SYS_DiaNaoUtil()
            {
                dnu_id = dnu_id
            };
            SYS_DiaNaoUtilBO.GetEntity(_DiaNaoUtil);

            this._VS_dnu_id    = _DiaNaoUtil.dnu_id;
            this._txtNome.Text = _DiaNaoUtil.dnu_nome;
            if (_DiaNaoUtil.dnu_recorrencia == true)
            {
                this.Page.Form.DefaultFocus           = this._txtVigenciaFim.ClientID;
                this._AlteraTela_DiaNaoUtilRecorrente = true;
                this._chkRecorrenciaAnual.Checked     = true;
                if (_DiaNaoUtil.dnu_data.Day > 0 && _DiaNaoUtil.dnu_data.Day < 10)
                {
                    this._txtDataDia.Text = "0" + Convert.ToString(_DiaNaoUtil.dnu_data.Day);
                }
                else
                {
                    this._txtDataDia.Text = Convert.ToString(_DiaNaoUtil.dnu_data.Day);
                }
                if (_DiaNaoUtil.dnu_data.Month > 0 && _DiaNaoUtil.dnu_data.Month < 10)
                {
                    this._txtDataMes.Text = "0" + Convert.ToString(_DiaNaoUtil.dnu_data.Month);
                }
                else
                {
                    this._txtDataMes.Text = Convert.ToString(_DiaNaoUtil.dnu_data.Month);
                }
            }
            else
            {
                this.Page.Form.DefaultFocus           = this._txtDescricao.ClientID;
                this._AlteraTela_DiaNaoUtilRecorrente = false;
                this._chkRecorrenciaAnual.Checked     = false;
                this._txtData.Text = _DiaNaoUtil.dnu_data.ToString("dd/MM/yyyy");
            }
            this._ddlAbrangencia.SelectedValue = Convert.ToString(_DiaNaoUtil.dnu_abrangencia);
            this._AlteraTela_Abrangencia       = _DiaNaoUtil.dnu_abrangencia;

            if (_DiaNaoUtil.unf_id != Guid.Empty)
            {
                this._UCComboUnidadeFederativa._Combo.SelectedValue = Convert.ToString(_DiaNaoUtil.unf_id);
            }
            if (_DiaNaoUtil.cid_id != Guid.Empty)
            {
                this._UCComboCidade._CarregaPorEstado(_DiaNaoUtil.unf_id);
                this._UCComboCidade._Combo.SelectedValue = Convert.ToString(_DiaNaoUtil.cid_id);
            }
            this._txtVigenciaIni.Text = _DiaNaoUtil.dnu_vigenciaInicio.ToString("dd/MM/yyyy");
            this._txtVigenciaFim.Text = (_DiaNaoUtil.dnu_vigenciaFim == new DateTime()) ? null : _DiaNaoUtil.dnu_vigenciaFim.ToString("dd/MM/yyyy");
            this._txtDescricao.Text   = _DiaNaoUtil.dnu_descricao;

            this._txtNome.Enabled                         = false;
            this._chkRecorrenciaAnual.Enabled             = false;
            this._txtData.Enabled                         = false;
            this._txtDataDia.Enabled                      = false;
            this._txtDataMes.Enabled                      = false;
            this._ddlAbrangencia.Enabled                  = false;
            this._UCComboUnidadeFederativa._Combo.Enabled = false;
            this._UCComboCidade._Combo.Enabled            = false;
            this._txtVigenciaIni.Enabled                  = !(_DiaNaoUtil.dnu_vigenciaInicio <= DateTime.Now);
            this._VerificaVigenciaInicio                  = !(_DiaNaoUtil.dnu_vigenciaInicio <= DateTime.Now);

            this.UpdatePanel1.Update();
        }
        catch (Exception e)
        {
            ApplicationWEB._GravaErro(e);
            this._lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar a dia não útil.", UtilBO.TipoMensagem.Erro);
        }
    }
예제 #4
0
    protected void grvConfig_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridView grv = ((GridView)sender);

        try
        {
            CFG_ConfiguracaoAcademico entityConfiguracao = new CFG_ConfiguracaoAcademico()
            {
                IsNew = Boolean.Parse(grv.DataKeys[e.RowIndex]["IsNew"].ToString())
                ,
                cfg_id = new Guid(grv.DataKeys[e.RowIndex]["cfg_id"].ToString())
                ,
                cfg_situacao = Byte.Parse(grv.DataKeys[e.RowIndex]["cfg_situacao"].ToString())
            };

            TextBox txtValor = (TextBox)grvConfig.Rows[e.RowIndex].FindControl("txtValor");
            if (txtValor != null)
            {
                entityConfiguracao.cfg_valor = txtValor.Text;
            }
            TextBox txtDescricao = (TextBox)grvConfig.Rows[e.RowIndex].FindControl("txtDescricao");
            if (txtDescricao != null)
            {
                entityConfiguracao.cfg_descricao = txtDescricao.Text;
            }
            TextBox txtChave = (TextBox)grvConfig.Rows[e.RowIndex].FindControl("txtChave");
            if (txtChave != null)
            {
                entityConfiguracao.cfg_chave = txtChave.Text;
            }

            if (CFG_ConfiguracaoAcademicoBO.Salvar(entityConfiguracao))
            {
                if (Boolean.Parse(grv.DataKeys[e.RowIndex]["IsNew"].ToString()))
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "cfg_id: " + entityConfiguracao.cfg_id);
                    lblMessage.Text = UtilBO.GetErroMessage("Configuração incluída com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }
                else
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "cfg_id: " + entityConfiguracao.cfg_id);
                    lblMessage.Text = UtilBO.GetErroMessage("Configuração alterada com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }
                ApplicationWEB.RecarregarConfiguracoes();
                grv.EditIndex = -1;
                grv.DataBind();
            }
        }
        catch (MSTech.Validation.Exceptions.ValidationException ex)
        {
            lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (DuplicateNameException ex)
        {
            lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar configuração.", UtilBO.TipoMensagem.Erro);
        }
        finally
        {
            updMessage.Update();
        }
    }
예제 #5
0
        protected void _grvParametros_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridView grv = ((GridView)sender);

            try
            {
                CFG_ParametroDocumentoAluno entity = new CFG_ParametroDocumentoAluno
                {
                    IsNew = Boolean.Parse(grv.DataKeys[e.RowIndex]["IsNew"].ToString())
                    ,
                    pda_id = Convert.ToInt32(grv.DataKeys[e.RowIndex]["pda_id"])
                    ,
                    pda_situacao = Byte.Parse(grv.DataKeys[e.RowIndex]["pda_situacao"].ToString())
                    ,
                    ent_id = __SessionWEB.__UsuarioWEB.Usuario.ent_id
                };

                DropDownList _ddlRelatorio = (DropDownList)_grvParametros.Rows[e.RowIndex].FindControl("_ddlRelatorio");
                if (_ddlRelatorio != null)
                {
                    entity.rlt_id = Convert.ToByte(_ddlRelatorio.SelectedValue);
                }

                DropDownList _ddlChave = (DropDownList)_grvParametros.Rows[e.RowIndex].FindControl("_ddlChave");
                if (_ddlChave != null)
                {
                    entity.pda_chave = _ddlChave.SelectedItem.Text;
                }

                TextBox txtDescricao = (TextBox)_grvParametros.Rows[e.RowIndex].FindControl("_txtDescricao");
                if (txtDescricao != null)
                {
                    entity.pda_descricao = txtDescricao.Text;
                }

                TextBox txtValor = (TextBox)_grvParametros.Rows[e.RowIndex].FindControl("_txtValor");
                if (txtValor.Text.Length > 1000)
                {
                    _lblMessage.Text = UtilBO.GetErroMessage(
                        "O tamanho do campo Valor não pode ser maior que 1000.",
                        UtilBO.TipoMensagem.Alerta);
                    return;
                }
                if (txtValor != null)
                {
                    entity.pda_valor = HttpUtility.HtmlEncode(txtValor.Text);
                }

                if (CFG_ParametroDocumentoAlunoBO.Save(entity))
                {
                    CFG_ParametroDocumentoAlunoBO.RecarregaParametrosAtivos();

                    if (Boolean.Parse(grv.DataKeys[e.RowIndex]["IsNew"].ToString()))
                    {
                        ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "pda_id: " + entity.pda_id + ", rlt_id: " + entity.rlt_id + ", ent_id: " + entity.ent_id);
                        _lblMessage.Text = UtilBO.GetErroMessage("Parâmetro de documentos do aluno incluído com sucesso.", UtilBO.TipoMensagem.Sucesso);
                    }
                    else
                    {
                        ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "pda_id: " + entity.pda_id + ", rlt_id: " + entity.rlt_id + ", ent_id: " + entity.ent_id);
                        _lblMessage.Text = UtilBO.GetErroMessage("Parâmetro de documentos do aluno alterado com sucesso.", UtilBO.TipoMensagem.Sucesso);
                    }
                    ApplicationWEB.RecarregarConfiguracoes();
                    grv.EditIndex = -1;
                    grv.DataBind();
                }
            }
            catch (ValidationException ex)
            {
                _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (DuplicateNameException ex)
            {
                _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar parâmetro.", UtilBO.TipoMensagem.Erro);
            }
            finally
            {
                _updMessage.Update();
            }
        }
예제 #6
0
        /// <summary>
        /// Realiza a busca com os filtros informados na tela.
        /// </summary>
        private void Pesquisar()
        {
            DateTime dt_inicio;
            DateTime dt_fim;

            try
            {
                DateTime.TryParse(txtDataInicio.Text, out dt_inicio);
                DateTime.TryParse(txtDataFim.Text, out dt_fim);
                // verifico se a data inicial e final estao com 00/00/0000
                if (dt_inicio == new DateTime() && dt_fim == new DateTime())
                {
                    if (String.IsNullOrEmpty(txtDataInicio.Text.Trim()) || String.IsNullOrEmpty(txtDataFim.Text.Trim()))
                    {
                        throw new ValidationException("Data início e data fim são campos obrigatórios.");
                    }
                    else
                    {
                        throw new ValidationException("Data início e data fim são inválidas.");
                    }
                }
                else if (dt_inicio == new DateTime())
                {
                    throw new ValidationException("Data início é inválida.");
                }
                else if (dt_fim == new DateTime())
                {
                    throw new ValidationException("Data fim é inválida.");
                }

                if (_dataInicio > _dataFim)
                {
                    throw new ValidationException("Data inicial não pode ser maior que a data final.");
                }
                else
                {
                    Int16 status        = 0;
                    Int16 tipoProtocolo = 0;
                    if (Convert.ToInt16(ddlStatus.SelectedValue) > 0)
                    {
                        status = Convert.ToInt16(ddlStatus.SelectedValue);
                    }

                    if (Convert.ToInt16(ddlTipoProtocolo.SelectedValue) > 0)
                    {
                        tipoProtocolo = Convert.ToInt16(ddlTipoProtocolo.SelectedValue);
                    }

                    odsProtocolos.SelectParameters.Clear();
                    odsProtocolos.SelectParameters.Add("ent_id", __SessionWEB.__UsuarioWEB.Usuario.ent_id.ToString());
                    odsProtocolos.SelectParameters.Add("dtInicio", Convert.ToDateTime(txtDataInicio.Text).ToString("yyyy/MM/dd"));
                    odsProtocolos.SelectParameters.Add("dtFim", Convert.ToDateTime(txtDataFim.Text).ToString("yyyy/MM/dd"));
                    odsProtocolos.SelectParameters.Add("status", status.ToString());

                    odsProtocolos.SelectParameters.Add("tipoProtocolo", tipoProtocolo.ToString());

                    grvProtocolos.Sort("DataCriacaoOrdenar", SortDirection.Descending);

                    grvProtocolos.PageIndex = 0;
                    grvProtocolos.DataBind();

                    fsResultados.Visible = true;
                }
            }
            catch (ValidationException ex)
            {
                lblMensagemErro.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMensagemErro.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os protocolos.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #7
0
        /// <summary>
        /// Salva a avaliação.
        /// </summary>
        public bool SalvarNovaAtividade(TUR_Turma turma
                                        , int tpc_id
                                        , byte tdt_posicao
                                        , DateTime tur_dataEncerramento
                                        , DateTime cal_dataInicio
                                        , DateTime cal_dataFim
                                        , DateTime cap_dataInicio
                                        , DateTime cap_dataFim
                                        , bool fav_permiteRecuperacaoForaPeriodo
                                        , byte origemLogNota      = 0
                                        , bool sucessoSalvarNotas = true)
        {
            try
            {
                if (!sucessoSalvarNotas)
                {
                    throw new ValidationException(GetGlobalResourceObject("UserControl", "LancamentoAvaliacao.UCCadastroAvaliacao.lblMessageAtividade.ErroSalvarNotasAlunos").ToString());
                }

                DateTime dataAtividade = new DateTime();
                if (!String.IsNullOrEmpty(txtData.Text))
                {
                    dataAtividade = Convert.ToDateTime(txtData.Text);
                    if (tur_dataEncerramento != new DateTime() && dataAtividade > tur_dataEncerramento)
                    {
                        throw new ValidationException(GetGlobalResourceObject("UserControl", "LancamentoAvaliacao.UCCadastroAvaliacao.lblMessageAtividade.ErroSalvarData").ToString());
                    }
                }

                CLS_TurmaNota entity;
                if (VS_tnt_id > 0)
                {
                    entity = new CLS_TurmaNota
                    {
                        tnt_id = VS_tnt_id,
                        tud_id = ddlComponenteAtAvaliativa.Visible ? ddlComponenteAtAvaliativa_Tud_Id_Selecionado : VS_tud_id
                    };
                    CLS_TurmaNotaBO.GetEntity(entity);
                }
                else
                {
                    entity        = new CLS_TurmaNota();
                    entity.tud_id = ddlComponenteAtAvaliativa.Visible ? ddlComponenteAtAvaliativa_Tud_Id_Selecionado : VS_tud_id;
                    entity.tur_id = turma.tur_id;
                    entity.usu_id = __SessionWEB.__UsuarioWEB.Usuario.usu_id;
                    entity.usu_idDocenteAlteracao = __SessionWEB.__UsuarioWEB.Usuario.usu_id;
                }

                entity.tpc_id        = tpc_id;
                entity.tau_id        = -1;
                entity.tnt_nome      = txtNomeAtividade.Text;
                entity.tnt_descricao = txtConteudoAtividade.Text;
                entity.tnt_situacao  = 1;
                entity.tav_id        = UCComboTipoAtividadeAvaliativa.Valor;
                entity.tnt_data      = dataAtividade;
                entity.tdt_posicao   = tdt_posicao;
                entity.tnt_exclusiva = chkAtividadeExclusiva.Visible ? chkAtividadeExclusiva.Checked : false;

                if (CLS_TurmaNotaBO.Save(
                        entity
                        , turma
                        , cal_dataInicio
                        , cal_dataFim
                        , cap_dataInicio
                        , cap_dataFim
                        , __SessionWEB.__UsuarioWEB.Usuario.ent_id
                        , UCHabilidades.RetornaListaHabilidades()
                        , fav_permiteRecuperacaoForaPeriodo
                        , null
                        , null
                        , false
                        , __SessionWEB.__UsuarioWEB.Usuario.usu_id
                        , origemLogNota
                        , (byte)LOG_TurmaNota_Alteracao_Tipo.AlteracaoAtividade
                        ))
                {
                    ApplicationWEB._GravaLogSistema(VS_tnt_id > 0 ? LOG_SistemaTipo.Update : LOG_SistemaTipo.Insert
                                                    , "Atividade"
                                                    + " | tpc_id: " + entity.tpc_id
                                                    + " | tud_id: " + entity.tud_id
                                                    + " | tnt_id: " + entity.tnt_id);
                    return(true);
                }
            }
            catch (ValidationException ex)
            {
                lblMessageAtividade.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (ArgumentException ex)
            {
                lblMessageAtividade.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessageAtividade.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("UserControl", "LancamentoAvaliacao.UCCadastroAvaliacao.lblMessageAtividade.ErroSalvar").ToString(), UtilBO.TipoMensagem.Erro);
            }
            return(false);
        }
예제 #8
0
    /// <summary>
    /// Metodo para carregar Turno e Turnos Horarios referente a este Turno
    /// </summary>
    /// <param name="trn_id">ID do turno</param>
    private void _Carregar(int trn_id)
    {
        try
        {
            // Carrega turno
            ACA_Turno _Turno = new ACA_Turno {
                trn_id = trn_id
            };
            ACA_TurnoBO.GetEntity(_Turno);

            if (_Turno.ent_id != __SessionWEB.__UsuarioWEB.Usuario.ent_id)
            {
                __SessionWEB.PostMessages = UtilBO.GetErroMessage("O turno não pertence à entidade na qual você está logado.", UtilBO.TipoMensagem.Alerta);
                Response.Redirect("~/Academico/Turno/Busca.aspx", false);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }

            _VS_trn_id         = _Turno.trn_id;
            _txtDescricao.Text = _Turno.trn_descricao;

            _UCComboTipoTurno.Valor = _Turno.ttn_id;

            if (_Turno.trn_situacao == 2)
            {
                _ckbBloqueado.Checked = true;
            }

            ddlcontroleTempo.SelectedValue = Convert.ToString(_Turno.trn_controleTempo);
            if (_Turno.trn_controleTempo == 2)
            {
                MostraHorasTurno(true);
                txtHoraFim.Text    = _Turno.trn_horaFim.ToString();
                txtHoraInicio.Text = _Turno.trn_horaInicio.ToString();
            }
            else
            {
                MostraHorasTurno(false);
            }

            CarregarHorariosDoBanco(trn_id);

            DataTable dt = ACA_TurnoHorarioBO.GetSelectDiasSemana(_VS_trn_id);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                foreach (ListItem chk in chkDiasSemana.Items)
                {
                    if (chk.Value == dt.Rows[i]["trh_diaSemana"].ToString())
                    {
                        chk.Selected = true;
                        break;
                    }
                }
            }

            _UCComboTipoTurno.PermiteEditar = false;
            _UCComboTipoTurno.Obrigatorio   = false;

            ddlcontroleTempo.Enabled = false;

            if (TUR_TurmaBO.VerificaTurmaAssociada(trn_id))
            {
                HabilitaControles(_rptHorarios.Controls, false);
                txtHoraInicio.Enabled = false;
                txtHoraFim.Enabled    = false;
                rfvHoraFim.Enabled    = false;
                rfvHoraInicio.Enabled = false;
                chkDiasSemana.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o turno.", UtilBO.TipoMensagem.Erro);
        }
    }
예제 #9
0
    /// <summary>
    /// Insere ou altera um tipo de atividade avaliativa
    /// </summary>
    private void Salvar()
    {
        try
        {
            CLS_TipoAtividadeAvaliativa entity = new CLS_TipoAtividadeAvaliativa();
            entity.tav_id   = _VS_tav_id;
            entity          = CLS_TipoAtividadeAvaliativaBO.GetEntity(entity);
            entity.tav_nome = txtTipoAtividadeAvaliativa.Text;
            entity.qat_id   = Int32.Parse(ddlQualificador.SelectedValue);

            if (_VS_tav_id > 0)
            {
                entity.IsNew             = false;
                entity.tav_dataAlteracao = DateTime.Now;
            }
            else
            {
                entity.IsNew             = true;
                entity.tav_situacao      = 1;
                entity.tav_dataAlteracao = DateTime.Now;
                entity.tav_dataCriacao   = DateTime.Now;
            }

            if (CLS_TipoAtividadeAvaliativaBO.Save(entity))
            {
                if (_VS_tav_id <= 0)
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "tav_id: " + entity.tav_id);
                    __SessionWEB.PostMessages = UtilBO.GetErroMessage("Tipo de atividade avaliativa incluído com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }
                else
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "tav_id: " + entity.tav_id);
                    __SessionWEB.PostMessages = UtilBO.GetErroMessage("Tipo de atividade avaliativa alterado com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }

                Response.Redirect(__SessionWEB._AreaAtual._Diretorio + "Configuracao/TipoAtividadeAvaliativa/Busca.aspx", false);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
            else
            {
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar o tipo de atividade avaliativa.", UtilBO.TipoMensagem.Erro);
            }
        }
        catch (MSTech.Validation.Exceptions.ValidationException e)
        {
            lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (DuplicateNameException e)
        {
            lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (ArgumentException e)
        {
            lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (Exception e)
        {
            ApplicationWEB._GravaErro(e);
            lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar o tipo de atividade avaliativa.", UtilBO.TipoMensagem.Erro);
        }
    }
예제 #10
0
    /// <summary>
    /// Método para salvar uma justificativa de pendência.
    /// </summary>
    private void Salvar()
    {
        try
        {
            List <int> periodosCalendario;
            if (!VerificarPeriodoCalendarioSelecionado(out periodosCalendario))
            {
                throw new MSTech.Validation.Exceptions.ValidationException(GetGlobalResourceObject("Academico", "JustificativaPendencia.Cadastro.ValidaPeriodoCalendarioObrigatorio").ToString());
            }

            List <CLS_FechamentoJustificativaPendencia> lstFechamentoJustificativaPendenciaBanco = CLS_FechamentoJustificativaPendenciaBO.GetSelectBy_TurmaDisciplina(comboTurmaDisciplina.Valor);

            int    fjpId   = Convert.ToInt32(hdnFjpId.Value);
            bool   sucesso = true;
            string tpcId   = string.Empty;
            List <CLS_FechamentoJustificativaPendencia> lstFechamentoJustificativaPendencia = new List <CLS_FechamentoJustificativaPendencia>();
            foreach (int periodoCalendario in periodosCalendario)
            {
                // Verifica se ja existe uma justificativa cadastrada para a turma disciplina no mesmo período do calendário.
                if (lstFechamentoJustificativaPendenciaBanco.Any(p => p.tpc_id == periodoCalendario && p.fjp_id != fjpId))
                {
                    throw new MSTech.Validation.Exceptions.ValidationException(GetGlobalResourceObject("Academico", "JustificativaPendencia.Cadastro.ValidaExisteJustificativa").ToString());
                }

                CLS_FechamentoJustificativaPendencia justificativaPendencia = new CLS_FechamentoJustificativaPendencia();
                justificativaPendencia.tud_id            = comboTurmaDisciplina.Valor;
                justificativaPendencia.cal_id            = comboCalendario.Valor;
                justificativaPendencia.tpc_id            = periodoCalendario;
                justificativaPendencia.fjp_id            = fjpId;
                justificativaPendencia.fjp_justificativa = txtJustificativa.Text;
                justificativaPendencia.usu_id            = __SessionWEB.__UsuarioWEB.Usuario.usu_id;
                justificativaPendencia.usu_idAlteracao   = __SessionWEB.__UsuarioWEB.Usuario.usu_id;
                justificativaPendencia.fjp_situacao      = (byte)CLS_FechamentoJustificativaPendenciaSituacao.Ativo;
                lstFechamentoJustificativaPendencia.Add(justificativaPendencia);
                tpcId += string.IsNullOrEmpty(tpcId) ? periodoCalendario.ToString() : "," + periodoCalendario.ToString();
            }
            if (lstFechamentoJustificativaPendencia.Count > 0)
            {
                sucesso = CLS_FechamentoJustificativaPendenciaBO.SalvarEmLote(lstFechamentoJustificativaPendencia);
            }

            if (sucesso)
            {
                if (fjpId > 0)
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "fjp_id: " + fjpId + ", tud_id: " + comboTurmaDisciplina.Valor + ", cal_id: " + comboCalendario.Valor + ", tpc_id: " + tpcId);
                }
                else
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "tud_id: " + comboTurmaDisciplina.Valor + ", cal_id: " + comboCalendario.Valor + ", tpc_id: " + tpcId);
                }
                __SessionWEB.PostMessages = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "JustificativaPendencia.Cadastro.SucessoSalvar").ToString(), UtilBO.TipoMensagem.Sucesso);
                Response.Redirect(__SessionWEB._AreaAtual._Diretorio + "Academico/JustificativaPendencia/Busca.aspx", false);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
            else
            {
                lblMessage.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "JustificativaPendencia.Cadastro.ErroSalvar").ToString(), UtilBO.TipoMensagem.Erro);
            }
        }
        catch (ValidationException e)
        {
            lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (ArgumentException e)
        {
            lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            lblMessage.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "JustificativaPendencia.Cadastro.ErroSalvar").ToString(), UtilBO.TipoMensagem.Erro);
        }
    }
예제 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Exibe o título no navegador
            Page.Title = __SessionWEB.TituloGeral;

            #region Adiciona links de favicon

            HtmlLink link = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon.ico");
            link.Attributes["rel"]   = "shortcut icon";
            link.Attributes["sizes"] = "";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-57x57.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "57x57";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-114x114.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "114x114";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-72x72.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "72x72";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-144x144.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "144x144";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-60x60.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "60x60";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-120x120.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "120x120";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-76x76.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "76x76";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-152x152.png");
            link.Attributes["rel"]   = "apple-touch-icon";
            link.Attributes["sizes"] = "152x152";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-196x196.png");
            link.Attributes["rel"]   = "icon";
            link.Attributes["sizes"] = "196x196";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-160x160.png");
            link.Attributes["rel"]   = "icon";
            link.Attributes["sizes"] = "160x160";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-96x96.png");
            link.Attributes["rel"]   = "icon";
            link.Attributes["sizes"] = "96x96";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-16x16.png");
            link.Attributes["rel"]   = "icon";
            link.Attributes["sizes"] = "16x16";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-32x32.png");
            link.Attributes["rel"]   = "icon";
            link.Attributes["sizes"] = "32x32";
            Page.Header.Controls.Add(link);

            link      = new HtmlLink();
            link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-32x32.png");
            link.Attributes["rel"]   = "icon";
            link.Attributes["sizes"] = "32x32";
            Page.Header.Controls.Add(link);

            HtmlMeta meta = new HtmlMeta();
            meta.Name    = "msapplication-TileImage";
            meta.Content = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/mstile-144x144.png");
            Page.Header.Controls.Add(meta);

            meta         = new HtmlMeta();
            meta.Name    = "msapplication-config";
            meta.Content = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/browserconfig.xml");
            Page.Header.Controls.Add(meta);

            #endregion Adiciona links de favicon


            if (ACA_ParametroAcademicoBO.ParametroValorBooleanoPorEntidade(eChaveAcademico.EXIBIR_LISTA_SISTEMAS_AREA_ALUNO, __SessionWEB.__UsuarioWEB.Usuario.ent_id) &&
                !ApplicationWEB.LoginProprioDoSistema)
            {
                //Carrega logo geral do sistema
                imgGeral.ImageUrl        = UtilBO.UrlImagemGestao(__SessionWEB.UrlCoreSSO, __SessionWEB.UrlLogoGeral);
                imgGeral.ToolTip         = __SessionWEB.TituloGeral;
                imgGeral.AlternateText   = __SessionWEB.TituloGeral;
                ImgLogoGeral.ToolTip     = __SessionWEB.TituloGeral;
                ImgLogoGeral.NavigateUrl = __SessionWEB.UrlCoreSSO + "/Sistema.aspx";
            }
            else
            {
                h1Logo.Visible = ImgLogoGeral.Visible = false;
                if (UCSistemas1 != null)
                {
                    UCSistemas1.Visible = false;
                }
            }

            //Atribui o caminho do logo do sistema atual, caso ele exista no Sistema Administrativo
            if (string.IsNullOrEmpty(__SessionWEB.UrlLogoSistema))
            {
                ImgLogoSistemaAtual.Visible = false;
            }
            else
            {
                //Carrega logo do sistema atual
                imgSistemaAtual.ImageUrl        = UtilBO.UrlImagemGestao(__SessionWEB.UrlCoreSSO, __SessionWEB.UrlLogoSistema);
                imgSistemaAtual.AlternateText   = __SessionWEB.TituloSistema;
                imgSistemaAtual.ToolTip         = __SessionWEB.TituloSistema;
                ImgLogoSistemaAtual.ToolTip     = __SessionWEB.TituloSistema;
                ImgLogoSistemaAtual.NavigateUrl = "~/Index.aspx";
            }

            try
            {
                // Busca dados do aluno

                Int64 alu_id = 0;
                if (__SessionWEB.__UsuarioWEB.responsavel && __SessionWEB.__UsuarioWEB.alu_id > 0)
                {
                    alu_id = __SessionWEB.__UsuarioWEB.alu_id;
                }
                else if (__SessionWEB.__UsuarioWEB.responsavel)
                {
                    alu_id = ACA_AlunoBO.SelectAlunoby_pes_id(__SessionWEB.__UsuarioWEB.pes_idAluno);
                }
                else
                {
                    alu_id = ACA_AlunoBO.SelectAlunoby_pes_id(__SessionWEB.__UsuarioWEB.Usuario.pes_id);
                }

                bool boletimBloqueado           = false;
                bool compromissoEstudoBloqueado = false;
                if (alu_id > 0)
                {
                    compromissoEstudoBloqueado = !ACA_TipoCicloBO.VerificaSeExibeCompromissoAluno(alu_id);
                    DataTable dtCurriculo = ACA_AlunoCurriculoBO.SelecionaDadosUltimaMatricula(alu_id);
                    if (dtCurriculo.Rows.Count > 0)
                    {
                        string nomeAluno = dtCurriculo.Rows[0]["pes_nome"].ToString();
                        string parametroMatriculaEstadual = ACA_ParametroAcademicoBO.ParametroValorPorEntidade(eChaveAcademico.MATRICULA_ESTADUAL, __SessionWEB.__UsuarioWEB.Usuario.ent_id);
                        string matriculaEstadual          = dtCurriculo.Rows[0]["alc_matriculaEstadual"].ToString();
                        string numeroMatricula            = dtCurriculo.Rows[0]["alc_matricula"].ToString();

                        litNomeAluno.Text    = __SessionWEB.__UsuarioWEB.responsavel ? (string)GetGlobalResourceObject("AreaAluno.MasterPageAluno", "litNomeAluno.Text.Responsavel") : (string)GetGlobalResourceObject("AreaAluno.MasterPageAluno", "litNomeAluno.Text.Aluno");
                        lblNomeAluno.Text    = nomeAluno;
                        lblMatricula.Text    = string.IsNullOrEmpty(parametroMatriculaEstadual) ? numeroMatricula : matriculaEstadual;
                        lblNroMatricula.Text = string.IsNullOrEmpty(parametroMatriculaEstadual)
                            ? GetGlobalResourceObject("AreaAluno", "MasterPageAluno.lblNroMatricula.Text").ToString()
                            : parametroMatriculaEstadual + ":";
                    }

                    ACA_Aluno entityAluno = ACA_AlunoBO.GetEntity(new ACA_Aluno {
                        alu_id = alu_id
                    });
                    if (entityAluno.alu_possuiInformacaoSigilosa && entityAluno.alu_bloqueioBoletimOnline)
                    {
                        boletimBloqueado = true;
                    }
                }

                if (__SessionWEB.__UsuarioWEB.responsavel && boletimBloqueado)
                {
                    Response.Redirect("~/Index.aspx", false);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }

                // Se ja tiver logado mostra o linkbutton pra selecionar o aluno, senão esconde
                if (Session["Pes_Id_Responsavel"] != null)
                {
                    if (Convert.ToInt32(Session["Qtde_Filhos_Responsavel"]) > 1)
                    {
                        lbSelecaoAlunos.Visible = true;
                    }
                    else
                    {
                        lbSelecaoAlunos.Visible = false;
                    }
                    imgLogoAreaAluno.Visible = false;
                    imgLogoAreaResp.Visible  = true;
                }
                else
                {
                    lbSelecaoAlunos.Visible  = false;
                    imgLogoAreaAluno.Visible = true;
                    imgLogoAreaResp.Visible  = false;
                }

                // Busca dados do menu

                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, "SiteMapPagesResponsavel.xslt"));
                }
                else
                {
                    siteMap.Load(String.Concat(__SessionWEB._AreaAtual._DiretorioIncludes, "SiteMapPages.xslt"));
                }

                string page = Page.Request.Url.ToString();

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

                string result = sw.ToString();


                //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 link2  = item.Substring(item.IndexOf("url=\"") + 5, item.Substring(item.IndexOf("url=\"") + 5).IndexOf("\""));
                            string modulo = item.Substring(0, item.IndexOf("\""));
                            linkModulo.Add(link2, 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 link2  = 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(link2, "class=\"" + classe + "\" " + "href=\"" + link2);
                        }
                        primeiroItem = false;
                    }
                }

                //Troca a classe css atual do link conforme o que está configurado na tabela filtrando pelo modulo
                List <CFG_ModuloClasse> lstModClasse = new List <CFG_ModuloClasse>();
                if (linkModulo.Count > 0 && linkClasse.Count > 0)
                {
                    lstModClasse = CFG_ModuloClasseBO.SelecionaAtivos(ApplicationWEB.AreaAlunoSistemaID);
                    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);
                            }
                        }
                    }
                }


                int indexPagina = result.IndexOf(Page.Request.Url.ToString()) > 0 ? result.IndexOf(Page.Request.Url.ToString()) : result.IndexOf(Page.Request.UrlReferrer.ToString());
                int indexClasse = 0;
                if (indexPagina > 0)
                {
                    indexClasse = result.IndexOf("txtSubMenu", (indexPagina - 60), result.Length - indexPagina);
                }

                string resultClasse = result.Substring(indexClasse);

                // Busca menu que está sendo chamado, para adicionar a classe ativo para a aba selecionada
                if (indexClasse > 0)
                {
                    result = result.Replace(resultClasse, "ativo " + resultClasse);
                }

                Control ctrl = Page.ParseControl(result);
                menuAreaAlunoComponentes.Controls.Add(ctrl);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
            }
        }
예제 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager sm = ScriptManager.GetCurrent(this);

        if (sm != null)
        {
            sm.Scripts.Add(new ScriptReference(ArquivoJS.MsgConfirmExclusao));
        }

        if (!IsPostBack)
        {
            string message = __SessionWEB.PostMessages;
            if (!String.IsNullOrEmpty(message))
            {
                _lblMessage.Text = message;
            }
            _grvCidade.PageSize = ApplicationWEB._Paginacao;

            try
            {
                UCComboPais.Inicialize("País");
                UCComboPais._EnableValidator = false;
                UCComboPais._Load(0);

                UCComboUnidadeFederativa.Inicialize("Estado");
                UCComboUnidadeFederativa._EnableValidator = false;

                string pais_padrao = SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.PAIS_PADRAO_BRASIL);

                if (!string.IsNullOrEmpty(pais_padrao))
                {
                    UCComboPais.SetaEventoSource();
                    UCComboPais._Combo.DataBind();
                    UCComboPais._Combo.SelectedValue = pais_padrao;

                    UCComboUnidadeFederativa._Load(new Guid(pais_padrao), 0);
                    UCComboUnidadeFederativa._Combo.Enabled = true;
                }
                else
                {
                    UCComboUnidadeFederativa._Load(Guid.Empty, 0);
                    UCComboUnidadeFederativa._Combo.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
            }

            VerificaBusca();

            Page.Form.DefaultButton = _btnPesquisar.UniqueID;
            Page.Form.DefaultFocus  = UCComboPais._Combo.ClientID;

            _divPesquisa.Visible  = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar;
            _btnPesquisar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar;
        }

        UCComboPais.OnSelectedIndexChange = UCComboPais__IndexChanged;
    }
예제 #13
0
        /// <summary>
        /// Método para salvar um aviso texto geral.
        /// </summary>
        private void Salvar()
        {
            try
            {
                ACA_AvisoTextoGeral entAviso = new ACA_AvisoTextoGeral();

                if (TipoAvisotextoGerais == (int)ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.Cabecalho)
                {
                    entAviso.atg_titulo          = "Cabeçalho";
                    entAviso.atg_timbreCabecalho = false;
                    entAviso.atg_anotacaoAula    = false;
                    entAviso.atg_tipo            = Convert.ToByte(ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.Cabecalho);
                }
                else if (TipoAvisotextoGerais == (int)ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.Declaracao)
                {
                    entAviso.atg_titulo          = "Declaração";
                    entAviso.atg_timbreCabecalho = false;
                    entAviso.atg_anotacaoAula    = false;
                    entAviso.atg_tipo            = Convert.ToByte(ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.Declaracao);
                }
                else if (TipoAvisotextoGerais == (int)ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.CabecalhoRelatorio)
                {
                    entAviso.atg_titulo          = "Cabeçalho Relatório";
                    entAviso.atg_timbreCabecalho = false;
                    entAviso.atg_anotacaoAula    = false;
                    entAviso.atg_tipo            = Convert.ToByte(ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.CabecalhoRelatorio);
                }
                else
                {
                    entAviso.uni_id              = UCComboUAEscola1.Uni_ID;
                    entAviso.esc_id              = UCComboUAEscola1.Esc_ID;
                    entAviso.cur_id              = UCComboCursoCurriculo.Valor[0];
                    entAviso.crr_id              = UCComboCursoCurriculo.Valor[1];
                    entAviso.atg_titulo          = txtTitulo.Text;
                    entAviso.atg_tipo            = Convert.ToByte(UCComboCampoAuxiliar1.ValorComboTipo);
                    entAviso.atg_timbreCabecalho = chkTimbre.Checked;
                }

                entAviso.atg_anotacaoAula = false;
                entAviso.IsNew            = VS_atg_id <= 0;
                //entAviso.atg_descricao = HttpUtility.HtmlEncode(redactor_content.InnerText);
                entAviso.atg_descricao = txtDescricao.Text; // HttpUtility.HtmlEncode(txtDescricao.Text);
                entAviso.atg_id        = VS_atg_id;
                entAviso.atg_situacao  = byte.Parse(cmbSituacao.SelectedValue);

                if (ACA_AvisoTextoGeralBO.Save(entAviso))
                {
                    ApplicationWEB._GravaLogSistema(VS_atg_id > 0 ? LOG_SistemaTipo.Update : LOG_SistemaTipo.Insert, "atg_id: " + entAviso.atg_id);
                    __SessionWEB.PostMessages = UtilBO.GetErroMessage(entAviso.atg_titulo + (VS_atg_id > 0 ? " alterado" : " incluído") + " com sucesso.", UtilBO.TipoMensagem.Sucesso);

                    if (TipoAvisotextoGerais == (int)ACA_AvisoTextoGeralBO.eTiposAvisosTextosGerais.Declaracao && VS_atg_id <= 0)//Adiciona atg_id na declaracao
                    {
                        CFG_RelatorioDocumentoAluno entRlt = CarregaEntRelatorio();
                        entRlt.atg_id = entAviso.atg_id;
                        entRlt.IsNew  = false;

                        if (CFG_RelatorioDocumentoAlunoBO.Save(entRlt))
                        {
                            ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "rda_id: " + entRlt.rda_id);
                            __SessionWEB.PostMessages = UtilBO.GetErroMessage(entAviso.atg_titulo + " alterada com sucesso.", UtilBO.TipoMensagem.Sucesso);
                        }
                    }

                    VoltarPagina();
                }
            }
            catch (ValidationException e)
            {
                lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (ArgumentException e)
            {
                lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar aviso texto geral.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #14
0
        /// <summary>
        /// Método para carregar um registro de aviso texto geral, a fim de atualizar suas informações.
        /// Recebe dados referente ao aviso texto geral para realizar busca.
        /// </summary>
        /// <param name="atg_id">ID do aviso texto geral</param>
        public void Carregar()
        {
            try
            {
                // Busca da SAAI – Sala de apoio e acompanhamento a inclusão baseado no ID da SAAI – Sala de apoio e acompanhamento a inclusão.
                ACA_AvisoTextoGeral entAviso = new ACA_AvisoTextoGeral {
                    atg_id = VS_atg_id
                };
                ACA_AvisoTextoGeralBO.GetEntity(entAviso);

                ESC_Escola entEscola = new ESC_Escola {
                    esc_id = entAviso.esc_id
                };
                ESC_EscolaBO.GetEntity(entEscola);

                if (UCComboUAEscola1.VisibleUA)
                {
                    // Buscar Unidade Administrativa Superior.
                    SYS_UnidadeAdministrativa entUA = new SYS_UnidadeAdministrativa {
                        ent_id = entEscola.ent_id, uad_id = entEscola.uad_id
                    };
                    SYS_UnidadeAdministrativaBO.GetEntity(entUA);

                    Guid uad_idSuperior = entEscola.uad_idSuperiorGestao.Equals(Guid.Empty) ? entUA.uad_idSuperior : entEscola.uad_idSuperiorGestao;

                    UCComboUAEscola1.Uad_ID = uad_idSuperior;

                    // Recarrega o combo de escolas com a uad_idSuperior.
                    UCComboUAEscola1.CarregaEscolaPorUASuperiorSelecionada();
                }

                //Carrega Escolas
                UCComboUAEscola1.MostraApenasAtivas   = true;
                UCComboUAEscola1.SelectedValueEscolas = new[] { entEscola.esc_id, entAviso.uni_id };
                UCComboUAEscola1.PermiteAlterarCombos = true;

                //Carrega curso
                UCComboCursoCurriculo.CarregarPorEscolaSituacaoCurso(UCComboUAEscola1.Esc_ID, UCComboUAEscola1.Uni_ID, 1);
                UCComboCursoCurriculo.Valor = new int[] { entAviso.cur_id, entAviso.crr_id };

                //Carrega situacao
                cmbSituacao.SelectedValue = entAviso.atg_situacao.ToString();

                //Carrega titulo
                txtTitulo.Text = entAviso.atg_titulo;

                //Carrega check do cabecalho
                chkTimbre.Checked = entAviso.atg_timbreCabecalho;

                //Carrega tipo de aviso e campos auxiliares
                UCComboCampoAuxiliar1.ValorComboTipo = entAviso.atg_tipo;

                //Carrega text cin descricao
                txtDescricao.Text = HttpUtility.HtmlDecode(entAviso.atg_descricao);
                //redactor_content.InnerText = HttpUtility.HtmlDecode(entAviso.atg_descricao);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os avisos textos gerais.", UtilBO.TipoMensagem.Erro);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        //Exibe o título no navegador
        Page.Title = __SessionWEB.TituloGeral + " - " + __SessionWEB.TituloSistema;

        #region Adiciona links de favicon

        string TemaAtual = __SessionWEB.TemaPadraoLogado.tep_nome;

        HtmlLink link = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon.ico");
        link.Attributes["rel"]   = "shortcut icon";
        link.Attributes["sizes"] = "";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-57x57.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "57x57";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-114x114.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "114x114";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-72x72.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "72x72";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-144x144.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "144x144";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-60x60.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "60x60";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-120x120.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "120x120";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-76x76.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "76x76";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/apple-touch-icon-152x152.png");
        link.Attributes["rel"]   = "apple-touch-icon";
        link.Attributes["sizes"] = "152x152";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-196x196.png");
        link.Attributes["rel"]   = "icon";
        link.Attributes["sizes"] = "196x196";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-160x160.png");
        link.Attributes["rel"]   = "icon";
        link.Attributes["sizes"] = "160x160";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-96x96.png");
        link.Attributes["rel"]   = "icon";
        link.Attributes["sizes"] = "96x96";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-16x16.png");
        link.Attributes["rel"]   = "icon";
        link.Attributes["sizes"] = "16x16";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-32x32.png");
        link.Attributes["rel"]   = "icon";
        link.Attributes["sizes"] = "32x32";
        Page.Header.Controls.Add(link);

        link      = new HtmlLink();
        link.Href = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/favicon-32x32.png");
        link.Attributes["rel"]   = "icon";
        link.Attributes["sizes"] = "32x32";
        Page.Header.Controls.Add(link);

        HtmlMeta meta = new HtmlMeta();
        meta.Name    = "msapplication-TileImage";
        meta.Content = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/mstile-144x144.png");
        Page.Header.Controls.Add(meta);

        meta         = new HtmlMeta();
        meta.Name    = "msapplication-config";
        meta.Content = ResolveUrl("~/App_Themes/" + TemaAtual + "/images/favicons/browserconfig.xml");
        Page.Header.Controls.Add(meta);

        #endregion

        if (!IsPostBack)
        {
            try
            {
                //Exibe o contato do help desk do cliente
                spnHelpDesk.InnerHtml = __SessionWEB.HelpDeskContato;

                if (__SessionWEB.__UsuarioWEB.Grupo != null)
                {
                    string menuXml = SYS_ModuloBO.CarregarMenuXML(
                        __SessionWEB.__UsuarioWEB.Grupo.gru_id
                        , __SessionWEB.__UsuarioWEB.Grupo.sis_id
                        , __SessionWEB.__UsuarioWEB.Grupo.vis_id
                        );
                    if (String.IsNullOrEmpty(menuXml))
                    {
                        menuXml = "<menus/>";
                    }
                    XmlDataSource1.Data = menuXml;
                    XmlDataSource1.DataBind();

                    //LoadMenuTipo2();

                    //Carrrega nome do usuario logado no sistema e exibe na pagina na mensagem de Bem-vindo.
                    lblUsuario.Text = RetornaLoginFormatado(__SessionWEB.UsuarioLogado);

                    //Exibe a mensagem de copyright no rodapé.
                    //lblCopyright.Text = "<span class='tituloGeral'>" + __SessionWEB.TituloGeral + " - " + __SessionWEB.TituloSistema + "</span><span class='sep'> - </span><span class='versao'>" + _VS_versao + "</span><span class='sep'> - </span><span class='mensagem'>" + __SessionWEB.MensagemCopyright + "</span>";
                    lblCopyright.Text = "<span class='tituloGeral'>Desenvolvido no Brasil</span> | <span class='mensagem'>" + __SessionWEB.MensagemCopyright + "</span> | <span class='versao'>" + _VS_versao + "</span>";

                    //Atribui o caminho do logo geral do sistema, caso ele exista no Sistema Administrativo
                    if (string.IsNullOrEmpty(__SessionWEB.UrlLogoGeral))
                    {
                        ImgLogoGeral.Visible = false;
                    }
                    else
                    {
                        //Carrega logo geral do sistema
                        imgGeral.ImageUrl        = UtilBO.UrlImagem(__SessionWEB.UrlLogoGeral);
                        imgGeral.ToolTip         = __SessionWEB.TituloGeral;
                        imgGeral.AlternateText   = __SessionWEB.TituloGeral;
                        ImgLogoGeral.ToolTip     = __SessionWEB.TituloGeral;
                        ImgLogoGeral.NavigateUrl = __SessionWEB.UrlSistemaAutenticador + "/Sistema.aspx";
                    }

                    //Atribui o caminho do logo do sistema atual, caso ele exista no Sistema Administrativo
                    if (string.IsNullOrEmpty(__SessionWEB.UrlLogoSistema))
                    {
                        ImgLogoSistemaAtual.Visible = false;
                    }
                    else
                    {
                        //Carrega logo do sistema atual
                        imgSistemaAtual.ImageUrl        = UtilBO.UrlImagem(__SessionWEB.UrlLogoSistema);
                        imgSistemaAtual.AlternateText   = __SessionWEB.TituloSistema;
                        imgSistemaAtual.ToolTip         = __SessionWEB.TituloSistema;
                        ImgLogoSistemaAtual.ToolTip     = __SessionWEB.TituloSistema;
                        ImgLogoSistemaAtual.NavigateUrl = "~/Index.aspx";
                    }

                    //TODO: Descomentar codigo abaixo.
                    imgImagemInstituicao.Visible = false;
                    ImgLogoInstitiuicao.Visible  = false;

                    ////Atribui o caminho do logo cliente, caso ele exista no Sistema Administrativo
                    //if (string.IsNullOrEmpty(__SessionWEB.UrlInstituicao.Trim()))
                    //    ImgLogoInstitiuicao.Visible = false;
                    //else
                    //{
                    //    //Carrega logo do cliente
                    //    ImgLogoInstitiuicao.ImageUrl = UtilBO.UrlImagem(__SessionWEB.UrlLogoInstituicao);
                    //    ImgLogoInstitiuicao.ToolTip = string.Empty;
                    //    ImgLogoInstitiuicao.NavigateUrl = __SessionWEB.UrlInstituicao;
                    //}

                    //imgImageInstituicao.Visible = !ImgLogoInstitiuicao.Visible;
                    //imgImageInstituicao.ImageUrl = UtilBO.UrlImagem(__SessionWEB.UrlLogoInstituicao);

                    string urlHelp = SYS_ModuloSiteMapBO.SelecionaUrlHelpByUrl(__SessionWEB.__UsuarioWEB.Grupo.gru_id, Request.AppRelativeCurrentExecutionFilePath);

                    if (!string.IsNullOrEmpty(urlHelp))
                    {
                        hplHelp.Visible     = true;
                        hplHelp.NavigateUrl = urlHelp;
                        hplHelp.ToolTip     = SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.MENSAGEM_ICONE_HELP);
                    }
                    else
                    {
                        hplHelp.Visible = false;
                    }
                }
                else
                {
                    Response.Redirect("~/logout.ashx");
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);

                if ((__SessionWEB.__UsuarioWEB != null) && (__SessionWEB.__UsuarioWEB.Usuario != null))
                {
                    lblUsuario.Text = RetornaLoginFormatado(__SessionWEB.__UsuarioWEB.Usuario.usu_login ?? "");
                }
            }
        }
    }
예제 #16
0
        /// <summary>
        /// Pesquisa os alunos
        /// </summary>
        /// <param name="pageIndex"></param>
        private void Pesquisar(int pageIndex)
        {
            try
            {
                string dataCriacao   = new DateTime().ToString("yyyy-MM-dd");
                string dataAlteracao = new DateTime().ToString("yyyy-MM-dd");

                bool podeVisualizarTodos = __SessionWEB.__UsuarioWEB.Grupo.vis_id != SysVisaoID.Administracao;

                // quantidade de itens por página
                string qtItensPagina = SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.QT_ITENS_PAGINACAO);
                int    itensPagina   = string.IsNullOrEmpty(qtItensPagina) ? ApplicationWEB._Paginacao : Convert.ToInt32(qtItensPagina);

                _grvAluno.DataSource = ACA_AlunoBO.BuscaAlunos_PorFiltroPreferencial
                                       (
                    UCComboUAEscola1.Uad_ID,
                    UCComboUAEscola1.Esc_ID,
                    UCComboUAEscola1.Uni_ID,
                    _txtNome.Text,
                    Convert.ToByte(_rblEscolhaBusca.SelectedValue),
                    _txtDataNascimento.Text,
                    _txtMae.Text,
                    _txtMatricula.Text,
                    _txtMatriculaEstadual.Text,
                    Convert.ToByte(_ddlSituacao.SelectedValue),
                    dataCriacao,
                    dataAlteracao,
                    __SessionWEB.__UsuarioWEB.Grupo.vis_id == SysVisaoID.Administracao,
                    podeVisualizarTodos,
                    __SessionWEB.__UsuarioWEB.Usuario.usu_id,
                    __SessionWEB.__UsuarioWEB.Grupo.gru_id,
                    __SessionWEB.__UsuarioWEB.Usuario.ent_id,
                    false,
                    false,
                    itensPagina,
                    pageIndex,
                    (int)VS_SortDirection,
                    VS_Ordenacao,
                    VS_DocumentoOficial
                                       );

                _grvAluno.PageIndex        = pageIndex;
                _grvAluno.PageSize         = itensPagina;
                _grvAluno.VirtualItemCount = ACA_AlunoBO.GetTotalRecords();

                _grvAluno.DataBind();

                fdsResultado.Visible = true;

                if (_ddlSituacao.Visible)
                {
                    divLegenda.Visible = _grvAluno.Rows.Count > 0;
                }
            }
            catch (ValidationException ex)
            {
                lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os alunos.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #17
0
        protected void rptDocumentos_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Excluir")
            {
                try
                {
                    int          indice = Convert.ToInt32(e.CommandArgument);
                    RepeaterItem item   = rptDocumentos.Items[indice];
                    Label        lblId  = (Label)item.FindControl("lblId");
                    RemoverLinhaRepeater(new Guid(lblId.Text));
                }
                catch (Exception ex)
                {
                    lblMensagem.Text = UtilBO.GetErroMessage(RetornaResource("ErroExcluir"), UtilBO.TipoMensagem.Erro);
                    ApplicationWEB._GravaErro(ex);
                }
            }

            if (e.CommandName == "Adicionar")
            {
                try
                {
                    bool ValidarArquivo = false;

                    RadioButtonList rblLinkArquivo   = (RadioButtonList)rptDocumentos.Items[rptDocumentos.Items.Count - 1].FindControl("rblLinkArquivo");
                    TextBox         txtDescricao     = (TextBox)rptDocumentos.Items[rptDocumentos.Items.Count - 1].FindControl("txtDescricao");
                    Label           lblErroDescricao = (Label)rptDocumentos.Items[rptDocumentos.Items.Count - 1].FindControl("lblErroDescricao");
                    Label           lblErroLink      = (Label)rptDocumentos.Items[rptDocumentos.Items.Count - 1].FindControl("lblErroLink");

                    if (lblErroDescricao != null)
                    {
                        lblErroDescricao.Visible = false;
                    }
                    if (lblErroLink != null)
                    {
                        lblErroLink.Visible = false;
                    }

                    string msg = "";

                    if (string.IsNullOrEmpty(txtDescricao.Text))
                    {
                        ValidarArquivo = true;
                        msg            = RetornaResource("DescricaoObrigatorio");
                        if (lblErroDescricao != null)
                        {
                            lblErroDescricao.Visible = true;
                        }
                    }

                    if (rblLinkArquivo.SelectedIndex == -1)
                    {
                        ValidarArquivo = true;
                        msg           += (!string.IsNullOrEmpty(msg) ? "<br/>" : "") + RetornaResource("TipoObrigatorio");
                    }

                    if (rblLinkArquivo.SelectedValue == ((byte)ACA_ArquivoAreaBO.eTipoDocumento.Arquivo).ToString())
                    {
                        Label lblArqId = (Label)rptDocumentos.Items[rptDocumentos.Items.Count - 1].FindControl("lblArqId");
                        long  arq_id   = 0;
                        if (!Int64.TryParse(lblArqId.Text, out arq_id) || arq_id <= 0)
                        {
                            ValidarArquivo = true;
                            msg           += (!string.IsNullOrEmpty(msg) ? "<br/>" : "") + RetornaResource("ArquivoObrigatorio");
                            if (lblErroLink != null)
                            {
                                lblErroLink.Visible = true;
                            }
                        }
                    }
                    else
                    {
                        TextBox txtLink = (TextBox)rptDocumentos.Items[rptDocumentos.Items.Count - 1].FindControl("txtLink");
                        if (string.IsNullOrEmpty(txtLink.Text))
                        {
                            ValidarArquivo = true;
                            msg           += (!string.IsNullOrEmpty(msg) ? "<br/>" : "") + RetornaResource("LinkObrigatorio");
                            if (lblErroLink != null)
                            {
                                lblErroLink.Visible = true;
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(msg))
                    {
                        lblMensagemDocumentos.Text = UtilBO.GetErroMessage(msg, UtilBO.TipoMensagem.Alerta);
                    }

                    if (!ValidarArquivo)
                    {
                        AdicionarLinhaRepeater();
                    }
                }
                catch (Exception ex)
                {
                    lblMensagem.Text = UtilBO.GetErroMessage(RetornaResource("ErroAdicionarNovo"), UtilBO.TipoMensagem.Erro);
                    ApplicationWEB._GravaErro(ex);
                }
            }

            if (e.CommandName == "Upload")
            {
                try
                {
                    VS_indiceArquivo = e.Item.ItemIndex;
                    //Abre o popup
                    ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Upload", "$('#divUpload').dialog('open');", true);
                    fupArquivo.Focus();
                }
                catch (ValidationException ex)
                {
                    lblMensagem.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
                }
                catch (Exception ex)
                {
                    ApplicationWEB._GravaErro(ex);
                    lblMensagem.Text = UtilBO.GetErroMessage(RetornaResource("ErroAdicionarArquivo"), UtilBO.TipoMensagem.Erro);
                }
            }
        }
예제 #18
0
        /// <summary>
        /// O método gera o relatório de Análise de Sondagem abaixo da frequência
        /// </summary>
        private void GerarRelatorio()
        {
            try
            {
                string report, parametros;

                DateTime dataInicio = new DateTime();
                DateTime dataFim    = new DateTime();

                if (string.IsNullOrEmpty(txtDataInicio.Text) || !DateTime.TryParse(txtDataInicio.Text, out dataInicio))
                {
                    throw new ValidationException(GetGlobalResourceObject("Documentos", "AnaliseSondagem.Busca.DataInicioInvalida").ToString());
                }

                if (dataInicio > DateTime.Today)
                {
                    throw new ValidationException(GetGlobalResourceObject("Documentos", "AnaliseSondagem.Busca.DataInicioMaiorHoje").ToString());
                }

                if (string.IsNullOrEmpty(txtDataFim.Text) || !DateTime.TryParse(txtDataFim.Text, out dataFim))
                {
                    throw new ValidationException(GetGlobalResourceObject("Documentos", "AnaliseSondagem.Busca.DataFimInvalida").ToString());
                }

                if (dataFim > DateTime.Today)
                {
                    throw new ValidationException(GetGlobalResourceObject("Documentos", "AnaliseSondagem.Busca.DataFimMaiorHoje").ToString());
                }

                if (dataInicio > dataFim)
                {
                    throw new ValidationException(GetGlobalResourceObject("Documentos", "AnaliseSondagem.Busca.DataFimMenorInicio").ToString());
                }

                SalvaBusca();

                report     = ((int)MSTech.GestaoEscolar.BLL.ReportNameGestaoAcademica.AnaliseSondagemConsolidada).ToString();
                parametros = "uad_idSuperiorGestao=" + UCComboUAEscola.Uad_ID +
                             "&cal_id=" + UCCCalendario.Valor +
                             "&cal_ano=" + UCCCalendario.Cal_ano.ToString() +
                             "&cur_id=" + UCCCursoCurriculo.Valor[0] +
                             "&crr_id=" + UCCCursoCurriculo.Valor[1] +
                             "&crp_id=" + UCComboCurriculoPeriodo.Valor[2] +
                             "&snd_id=" + UCComboSondagem.Valor +
                             "&dataInicio=" + txtDataInicio.Text +
                             "&dataFim=" + txtDataFim.Text +
                             "&suprimirPercentual=" + chkSuprimirPercentual.Checked +
                             "&dre=" + UCComboUAEscola.TextoComboUA +
                             "&escola=" + (UCComboUAEscola.Esc_ID > 0 ? UCComboUAEscola.TextoComboEscola : "") +
                             "&logo=" + String.Concat(MSTech.GestaoEscolar.BLL.CFG_ServidorRelatorioBO.CarregarServidorRelatorioPorEntidade(__SessionWEB.__UsuarioWEB.Usuario.ent_id, ApplicationWEB.AppMinutosCacheLongo).srr_pastaRelatorios.ToString()
                                                      , ApplicationWEB.LogoRelatorioSSRS) +
                             "&nomeMunicipio=" + GetGlobalResourceObject("Reporting", "Reporting.DocDctSubCabecalhoRetrato.Municipio") +
                             "&nomeSecretaria=" + GetGlobalResourceObject("Reporting", "Reporting.DocDctSubCabecalhoRetrato.Secretaria");

                CFG_RelatorioBO.CallReport("Relatorios", report, parametros, HttpContext.Current);
            }
            catch (ValidationException ex)
            {
                lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar gerar o relatório.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #19
0
        /// <summary>
        /// Carrega uma nova avaliação ou uma avaliação para edição.
        /// </summary>
        /// <param name="tur_id"></param>
        /// <param name="tud_id"></param>
        /// <param name="tnt_id"></param>
        /// <param name="tud_tipo"></param>
        /// <param name="permiteEditar"></param>
        /// <param name="tpc_id"></param>
        /// <param name="cal_id"></param>
        /// <param name="tdt_posicao"></param>
        /// <param name="cur_id"></param>
        /// <param name="crr_id"></param>
        /// <param name="crp_id"></param>
        public void CarregarAvaliacao(long tur_id
                                      , long tud_id
                                      , int tnt_id
                                      , byte tur_tipo
                                      , byte tud_tipo
                                      , bool permiteEditar
                                      , int tpc_id
                                      , int cal_id
                                      , byte tdt_posicao
                                      , int cur_id
                                      , int crr_id
                                      , int crp_id)
        {
            try
            {
                VS_tud_id = tud_id;
                VS_tnt_id = tnt_id;

                LimparCampos();
                HabilitarCampos(permiteEditar);
                lblComponenteAtAvaliativa.Visible  = ddlComponenteAtAvaliativa.Visible = tud_tipo == (byte)ACA_CurriculoDisciplinaTipo.Regencia || tud_tipo == (byte)ACA_CurriculoDisciplinaTipo.ComponenteRegencia;
                chkAtividadeExclusiva.Visible      = ACA_ParametroAcademicoBO.ParametroValorBooleanoPorEntidade(eChaveAcademico.PERMITIR_ATIVIDADES_AVALIATIVAS_EXCLUSIVAS, __SessionWEB.__UsuarioWEB.Usuario.ent_id);
                fdsHabilidadesRelacionadas.Visible = tur_tipo != (byte)TUR_TurmaTipo.EletivaAluno && ACA_ParametroAcademicoBO.ParametroValorBooleanoPorEntidade(eChaveAcademico.RELACIONAR_HABILIDADES_AVALIACAO, __SessionWEB.__UsuarioWEB.Usuario.ent_id);
                CarregarHabilidadesAvaliacao(tur_id, tpc_id, cal_id, tdt_posicao, cur_id, crr_id, crp_id);
                UCComboTipoAtividadeAvaliativa.MostrarMessageOutros = false;

                if (tnt_id > 0)
                {
                    CLS_TurmaNota entity = new CLS_TurmaNota
                    {
                        tud_id = Convert.ToInt64(VS_tud_id),
                        tnt_id = Convert.ToInt32(VS_tnt_id)
                    };
                    CLS_TurmaNotaBO.GetEntity(entity);

                    UCComboTipoAtividadeAvaliativa.CarregaTipoAtividadeAvaliativaAtivosMaisInativo(true, entity.tav_id, VS_tud_id);
                    UCComboTipoAtividadeAvaliativa.PermiteEditar = false;

                    if (tud_tipo == (byte)ACA_CurriculoDisciplinaTipo.ComponenteRegencia)
                    {
                        if (entity.tud_id > 0)
                        {
                            IEnumerable <string> x = from ListItem lItem in ddlComponenteAtAvaliativa.Items
                                                     where lItem.Value.Split(';')[0].Equals(tur_id.ToString()) &&
                                                     lItem.Value.Split(';')[1].Equals(entity.tud_id.ToString())
                                                     select lItem.Value;
                            if (x.Count() > 0)
                            {
                                ddlComponenteAtAvaliativa.SelectedValue = x.First();
                            }
                        }
                        ddlComponenteAtAvaliativa.Enabled = false;
                    }

                    txtData.Text = entity.tnt_data == new DateTime() ? string.Empty : entity.tnt_data.ToString();
                    UCComboTipoAtividadeAvaliativa.Valor = entity.tav_id;
                    txtNomeAtividade.Text         = entity.tnt_nome;
                    txtConteudoAtividade.Text     = entity.tnt_descricao;
                    chkAtividadeExclusiva.Checked = entity.tnt_exclusiva;
                }
                else
                {
                    UCComboTipoAtividadeAvaliativa.CarregarTipoAtividadeAvaliativa(true, VS_tud_id);
                    UCComboTipoAtividadeAvaliativa.Valor = -1;
                }
                updAtividade.Update();

                if (txtData.Visible)
                {
                    txtData.Focus();
                }
                else if (ddlComponenteAtAvaliativa.Visible)
                {
                    ddlComponenteAtAvaliativa.Focus();
                }
                else
                {
                    UCComboTipoAtividadeAvaliativa.Focus();
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessageAtividade.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("UserControl", "LancamentoAvaliacao.UCCadastroAvaliacao.lblMessageAtividade.ErroCarregar").ToString(), UtilBO.TipoMensagem.Erro);
            }
        }
예제 #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager sm = ScriptManager.GetCurrent(this);

            if (sm != null)
            {
                sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation));
                sm.Scripts.Add(new ScriptReference(ArquivoJS.JqueryMask));
                sm.Scripts.Add(new ScriptReference(ArquivoJS.MascarasCampos));
            }

            // Seta o metodo criado no delegate ao evento do componente
            UCComboUAEscola.IndexChangedUnidadeEscola += UCComboUAEscola_IndexChangedUnidadeEscola;
            UCComboUAEscola.IndexChangedUA            += UCComboUAEscola_IndexChangedUA;
            UCComboCalendario.IndexChanged            += UCComboCalendario_IndexChanged;
            UCCCursoCurriculo.IndexChanged            += UCCCursoCurriculo_IndexChanged;
            UCCTurmaDisciplina1.IndexChanged          += UCComboTurmaDisciplina_IndexChanged;
            UCCPeriodoCalendario.IndexChanged         += UCCPeriodoCalendario_IndexChanged;

            if (!IsPostBack)
            {
                try
                {
                    ddlTurma.Items.Insert(0, new ListItem("-- Selecione uma turma --", "-1", true));
                    //Esconde o botão salvar
                    btnSalvar.Visible = false;

                    if (__SessionWEB.__UsuarioWEB.Grupo.vis_id == SysVisaoID.Individual)
                    {
                        // Busca o doc_id do usuário logado.
                        if (__SessionWEB.__UsuarioWEB.Docente.doc_id > 0)
                        {
                            //Seta o docente
                            _VS_doc_id = __SessionWEB.__UsuarioWEB.Docente.doc_id;

                            //Esconde os campos não visíveis para docentes
                            UCCCursoCurriculo.Visible = false;
                            ddlTurma.Enabled          = false;

                            //Carrega as escolas no combo
                            UCComboUAEscola.InicializarVisaoIndividual(_VS_doc_id, __SessionWEB.__UsuarioWEB.Usuario.ent_id);

                            if (UCComboUAEscola.QuantidadeItemsComboEscolas == 2)
                            {
                                ddlTurma.Enabled = true;
                                InicializaCamposCadastroVisaoIndividual(UCComboUAEscola.Esc_ID);
                            }
                            else
                            {
                                InicializaCamposCadastroVisaoIndividual(0);
                            }
                        }
                        else
                        {
                            divPesquisa.Visible = false;
                            lblMessage.Text     = UtilBO.GetErroMessage("Essa tela é exclusiva para docentes.", UtilBO.TipoMensagem.Alerta);
                        }
                    }
                    else
                    {
                        //Inicializa os campos de cadastro
                        InicializaCamposCadastro();
                    }

                    bool docente = _VS_doc_id > 0;

                    if (PreviousPage != null && PreviousPage.IsCrossPagePostBack)
                    {
                        long[] pp = PreviousPage.Edit_cpa_id;
                        Carregar(pp[0], pp[1]);
                        //Exibe o botão salvar nas alterações
                        btnSalvar.Visible = (__SessionWEB.__UsuarioWEB.GrupoPermissao.grp_alterar ||
                                             __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir) && mostraSalvar;
                    }
                    else if (Session["PaginaRetorno_CompensacaoAusencia"] != null)
                    {
                        VS_PaginaRetorno = Session["PaginaRetorno_CompensacaoAusencia"].ToString();
                        Session.Remove("PaginaRetorno_CompensacaoAusencia");
                        VS_DadosPaginaRetorno = Session["DadosPaginaRetorno"];
                        Session.Remove("DadosPaginaRetorno");

                        VS_DadosPaginaRetorno_MinhasTurmas = Session["VS_DadosTurmas"];
                        Session.Remove("VS_DadosTurmas");

                        if (docente)
                        {
                            Dictionary <string, string> dadosPaginaRetorno = (Dictionary <string, string>)VS_DadosPaginaRetorno;

                            if (UCComboUAEscola.QuantidadeItemsComboEscolas != 2)
                            {
                                UCComboUAEscola.SelectedValueEscolas = new int[] { Convert.ToInt32(dadosPaginaRetorno["Edit_esc_id"]), Convert.ToInt32(dadosPaginaRetorno["Edit_uni_id"]) };
                                InicializaCamposCadastroVisaoIndividual(UCComboUAEscola.Esc_ID);
                                UCComboUAEscola_IndexChangedUnidadeEscola();
                            }

                            UCComboCalendario.Valor = Convert.ToInt32(dadosPaginaRetorno["Edit_cal_id"]);
                            UCComboCalendario_IndexChanged();
                            UCComboCalendario.PermiteEditar = false;

                            ddlTurma.SelectedValue = dadosPaginaRetorno["Edit_tur_id"];
                            ddlTurma_SelectedIndexChanged(null, null);
                            ddlTurma.Enabled = false;

                            if (UCComboUAEscola.Esc_ID == -1)
                            {
                                TUR_Turma tur = TUR_TurmaBO.GetEntity(new TUR_Turma {
                                    tur_id = Convert.ToInt64(dadosPaginaRetorno["Edit_tur_id"])
                                });
                                UCComboUAEscola.SelectedValueEscolas = new[] { tur.esc_id, tur.uni_id };
                                UCComboUAEscola.PermiteAlterarCombos = false;
                            }

                            UCCTurmaDisciplina1.Valor = Convert.ToInt64(dadosPaginaRetorno["Tud_idRetorno_ControleTurma"]);
                            UCComboTurmaDisciplina_IndexChanged();
                            UCCTurmaDisciplina1.PermiteEditar = false;

                            //Não tem períodos abertos para lançar compensação, retornar para tela anterior.
                            if (UCCPeriodoCalendario.QuantidadeItensCombo == 1)
                            {
                                __SessionWEB.PostMessages =
                                    UtilBO.GetErroMessage
                                        ("Não é possível criar compensação, pois o bimestre não está aberto para edição."
                                        , UtilBO.TipoMensagem.Alerta);
                                VerificaPaginaRedirecionar();
                            }
                        }
                        else
                        {
                            // Se veio da tela de Minhas turmas e não é docente, redireciona pra busca.
                            __SessionWEB.PostMessages = UtilBO.GetErroMessage("Operação exclusiva para docentes.", UtilBO.TipoMensagem.Alerta);
                            Response.Redirect("~/Classe/CompensacaoAusencia/Busca.aspx", false);
                            HttpContext.Current.ApplicationInstance.CompleteRequest();
                        }
                    }

                    if (docente)
                    {
                        Page.Form.DefaultFocus = UCCPeriodoCalendario.ClientID_Combo;
                    }
                    else
                    {
                        Page.Form.DefaultFocus = UCComboUAEscola.ComboUA_ClientID;
                    }

                    Page.Form.DefaultButton = btnSalvar.UniqueID;

                    //Nesse ponto, verifico a permissão apenas de alteração
                    if (VS_cpa_id > 0)
                    {
                        btnSalvar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_alterar && mostraSalvar;
                    }
                }
                catch (Exception ex)
                {
                    ApplicationWEB._GravaErro(ex);
                    lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro);
                }
            }
        }
예제 #21
0
    /// <summary>
    /// Salva as informações da Função
    /// </summary>
    private void _Salvar()
    {
        try
        {
            RHU_Funcao _Funcao = new RHU_Funcao
            {
                fun_id = _VS_fun_id
                ,
                fun_codigo = _txtCodigo.Text
                ,
                fun_nome = _txtFuncao.Text
                ,
                fun_descricao = _txtDescricao.Text
                ,
                fun_codIntegracao = _txtCodIntegracao.Text
                ,
                ent_id = __SessionWEB.__UsuarioWEB.Usuario.ent_id
                ,
                fun_situacao = Convert.ToByte(_ckbBloqueado.Checked ? 2 :1)
                ,
                pgs_chave = UCComboParametroGrupoPerfil1.Valor == "-1" ? string.Empty : UCComboParametroGrupoPerfil1.Valor
                ,
                IsNew = (_VS_fun_id > 0) ? false : true
            };
            if (RHU_FuncaoBO.Save(_Funcao))
            {
                if (_VS_fun_id <= 0)
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "fun_id: " + _Funcao.fun_id);
                    __SessionWEB.PostMessages = UtilBO.GetErroMessage("Função incluída com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }
                else
                {
                    ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "fun_id: " + _Funcao.fun_id);
                    __SessionWEB.PostMessages = UtilBO.GetErroMessage("Função alterada com sucesso.", UtilBO.TipoMensagem.Sucesso);
                }

                Response.Redirect("Busca.aspx", false);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
            else
            {
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar a função.", UtilBO.TipoMensagem.Erro);
            }
        }
        catch (MSTech.Validation.Exceptions.ValidationException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (ArgumentException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (DuplicateNameException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar a função.", UtilBO.TipoMensagem.Erro);
        }
    }
예제 #22
0
        /// <summary>
        /// Método para carregar um registro de compensacao, a fim de atualizar suas informações.
        /// Recebe dados referente a compensacao para realizar busca.
        /// </summary>
        /// <param name="cpa_id">ID da compensacao</param>
        public void Carregar(long cpa, long tud)
        {
            try
            {
                int cpa_id = Convert.ToInt32(cpa.ToString());

                // Armazena valor ID do informativo a ser alterada.
                VS_cpa_id = cpa_id;

                // Busca do informativo baseado no ID do informativo.
                CLS_CompensacaoAusencia entCompensacao = new CLS_CompensacaoAusencia {
                    cpa_id = cpa_id, tud_id = tud
                };
                CLS_CompensacaoAusenciaBO.GetEntity(entCompensacao);

                VS_pro_id = entCompensacao.pro_id;

                VS_QtAulasComp = entCompensacao.cpa_quantidadeAulasCompensadas;

                DataTable dt = CLS_CompensacaoAusenciaBO.RetornaIdsCadastro(entCompensacao.tud_id, entCompensacao.cpa_id);

                // Pega somente a primeira linha
                DataRow row = dt.Rows[0];

                Guid uad_id;
                int  esc_id, uni_id, cur_id, crr_id, cap_id, tpc_id, cal_id;
                long tur_id, crp_id, ttn_id, tud_id;
                bool fav_fechamentoAutomatico;

                uad_id = string.IsNullOrEmpty(row[1].ToString()) ? new Guid() : new Guid(row[1].ToString());
                esc_id = Convert.ToInt32(row[2].ToString());
                uni_id = Convert.ToInt32(row[3].ToString());
                cur_id = Convert.ToInt32(row[4].ToString());
                crr_id = Convert.ToInt32(row[5].ToString());
                cap_id = Convert.ToInt32(row[10].ToString());
                tpc_id = Convert.ToInt32(row[11].ToString());
                cal_id = Convert.ToInt32(row[12].ToString());
                tur_id = Convert.ToInt64(row[7].ToString());
                crp_id = Convert.ToInt64(row[6].ToString());
                ttn_id = Convert.ToInt64(row[8].ToString());
                tud_id = Convert.ToInt64(row[9].ToString());
                fav_fechamentoAutomatico = Convert.ToBoolean(row["fav_fechamentoAutomatico"].ToString());

                VS_FechamentoAutomatico = fav_fechamentoAutomatico;

                if (_VS_doc_id <= 0)
                {
                    //CRE / Escola
                    UCComboUAEscola.Inicializar();
                    if (!uad_id.Equals(new Guid()))
                    {
                        UCComboUAEscola.Uad_ID = uad_id;
                    }
                    UCComboUAEscola.MostraApenasAtivas   = true;
                    UCComboUAEscola.SelectedValueEscolas = new int[] { esc_id, uni_id };
                    UCComboUAEscola.PermiteAlterarCombos = false;

                    //Calendario
                    UCComboCalendario.CarregarCalendariosComBimestresAtivos(esc_id, true);
                    UCComboCalendario.Valor = cal_id;

                    //Etapa de ensino
                    UCCCursoCurriculo.CarregarPorEscolaSituacaoCurso(UCComboUAEscola.Esc_ID, UCComboUAEscola.Uni_ID, 0);
                    UCCCursoCurriculo.PermiteEditar = false;
                    UCCCursoCurriculo.Valor         = new int[] { cur_id, crr_id };

                    ddlTurma.Items.Clear();
                    ddlTurma.DataTextField = "tur_codigo";

                    ddlTurma.Items.Insert(0, new ListItem("-- Selecione uma turma --", "-1", true));

                    ddlTurma.DataSource = TUR_TurmaBO.GetSelectBy_Escola_Periodo_Situacao(__SessionWEB.__UsuarioWEB.Usuario.usu_id,
                                                                                          __SessionWEB.__UsuarioWEB.Grupo.gru_id,
                                                                                          (__SessionWEB.__UsuarioWEB.Grupo.vis_id == SysVisaoID.Administracao),
                                                                                          UCComboUAEscola.Esc_ID, UCComboUAEscola.Uni_ID,
                                                                                          UCComboCalendario.Valor, UCCCursoCurriculo.Valor[0],
                                                                                          UCCCursoCurriculo.Valor[1], -1,
                                                                                          __SessionWEB.__UsuarioWEB.Usuario.ent_id, 0, 0,
                                                                                          ApplicationWEB.AppMinutosCacheLongo)
                                          .GroupBy(p => new { tur_id = p.tur_id, tur_codigo = p.tur_codigo }).Select(p => p.Key).ToList();;
                    ddlTurma.DataBind();
                }
                else
                {
                    UCComboUAEscola.SelectedValueEscolas = new int[] { esc_id, uni_id };
                    UCComboUAEscola.PermiteAlterarCombos = false;

                    //Calendario
                    UCComboCalendario.CarregarCalendariosComBimestresAtivos(esc_id, true);
                    UCComboCalendario.Valor         = cal_id;
                    UCComboCalendario.PermiteEditar = false;

                    //Carrega os campos
                    int posicaoDocenteCompatilhado = ACA_ParametroAcademicoBO.ParametroValorInt32PorEntidade(eChaveAcademico.POSICAO_DOCENCIA_COMPARTILHADA, __SessionWEB.__UsuarioWEB.Usuario.ent_id);

                    ddlTurma.Items.Clear();
                    ddlTurma.DataTextField = "tur_esc_nome";

                    ddlTurma.Items.Insert(0, new ListItem("-- Selecione uma turma --", "-1", true));

                    ddlTurma.DataSource = TUR_TurmaBO.GetSelectBy_Docente_TodosTipos_Posicao(__SessionWEB.__UsuarioWEB.Usuario.ent_id, _VS_doc_id, posicaoDocenteCompatilhado, 0, UCComboCalendario.Valor, true, false, ApplicationWEB.AppMinutosCacheLongo)
                                          .GroupBy(p => new { tur_id = p.tur_id, tur_esc_nome = p.tur_esc_nome }).Select(p => p.Key).ToList();
                    ddlTurma.DataBind();
                }

                ddlTurma_SelectedIndexChanged(null, null);

                ddlTurma.Enabled       = false;
                ddlTurma.SelectedValue = tur_id.ToString();

                //Disciplina
                if (_VS_doc_id <= 0)
                {
                    UCCTurmaDisciplina1.CarregarTurmaDisciplina(tur_id);
                }
                else
                {
                    UCCTurmaDisciplina1.CarregarTurmaDisciplina(tur_id, _VS_doc_id);
                }

                UCCTurmaDisciplina1.PermiteEditar = false;
                UCCTurmaDisciplina1.Valor         = tud_id;

                //Periodo Calendario
                UCCPeriodoCalendario.CarregarPorPeriodoEventoEfetivacaoVigentes(cal_id, tud_id, tur_id);
                UCCPeriodoCalendario.PermiteEditar = false;
                UCCPeriodoCalendario.Valor         = new int[2] {
                    cap_id, tpc_id
                };
                UCCPeriodoCalendario_IndexChanged();

                // Só habilita os campos de quantidade de aulas compensadas e alunos selecionados,
                // na edicao de uma compensacao do último bimestre "aberto" para edição.
                bool selecaoUltimoBimestre = UCCPeriodoCalendario.SelecaoUltimoBimestre();
                txtQtAulas.Enabled = selecaoUltimoBimestre;

                UCComboCalendario.PermiteEditar = false;

                if (UCCPeriodoCalendario.Tpc_ID > 0)
                {
                    // Atividades
                    txtAtividades.Text = entCompensacao.cpa_atividadesDesenvolvidas;

                    // Qt Aulas
                    txtQtAulas.Text = entCompensacao.cpa_quantidadeAulasCompensadas.ToString();

                    // Alunos compensados
                    List <CLS_CompensacaoAusenciaAluno> listaAlunos = CLS_CompensacaoAusenciaAlunoBO.SelectByCpa_id(entCompensacao.cpa_id, entCompensacao.tud_id);
                    foreach (RepeaterItem item in rptAlunos.Items)
                    {
                        CheckBox    ckbAluno = (CheckBox)item.FindControl("ckbAluno");
                        HiddenField hdnId    = (HiddenField)item.FindControl("hdnId");

                        if (ckbAluno != null && hdnId != null)
                        {
                            ckbAluno.Enabled = selecaoUltimoBimestre;
                            ckbAluno.Checked = listaAlunos.Any(p => string.Concat(p.tud_id, ";", p.alu_id, ";", p.mtu_id, ";", p.mtd_id) == hdnId.Value);
                        }
                    }
                }
                else
                {
                    // Voltar pra busca, pois não é possível editar uma compensação de um bimestre não aberto.
                    __SessionWEB.PostMessages = UtilBO.GetErroMessage("Não é possível editar a compensação, pois o bimestre não está aberto para edição."
                                                                      , UtilBO.TipoMensagem.Alerta);
                    Response.Redirect("~/Classe/CompensacaoAusencia/Busca.aspx", false);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar a compensação de ausência.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #23
0
    private void _AssociarCidades()
    {
        try
        {
            END_Cidade entityCidade = new END_Cidade
            {
                cid_id = _VS_cid_id
                ,
                pai_id = new Guid(UCComboPais._Combo.SelectedValue)
                ,
                unf_id = new Guid(UCComboUnidadeFederativa._Combo.SelectedValue)
                ,
                cid_nome = _txtCidade.Text
                ,
                cid_ddd = string.IsNullOrEmpty(_txtDDD.Text) ? string.Empty : _txtDDD.Text
                ,
                cid_situacao = Convert.ToByte(1)
                ,
                IsNew = (_VS_cid_id != Guid.Empty) ? false : true
            };

            XmlDocument xDoc      = new XmlDocument();
            XmlNode     xElem     = xDoc.CreateNode(XmlNodeType.Element, "Coluna", "");
            XmlNode     xNodeCoor = xDoc.CreateNode(XmlNodeType.Element, "ColunaValorAntigo", "");
            XmlNode     xNode;

            for (int i = 0; i < _VS_AssociacaoCidades.Rows.Count; i++)
            {
                if (new Guid(_VS_AssociacaoCidades.Rows[i]["cid_id"].ToString()) != _VS_cid_id)
                {
                    xNodeCoor       = xDoc.CreateNode(XmlNodeType.Element, "ColunaValorAntigo", "");
                    xNode           = xDoc.CreateNode(XmlNodeType.Element, "valor", "");
                    xNode.InnerText = _VS_AssociacaoCidades.Rows[i]["cid_id"].ToString();
                    xNodeCoor.AppendChild(xNode);
                    xElem.AppendChild(xNodeCoor);
                }
            }
            xDoc.AppendChild(xElem);

            if (END_CidadeBO.AssociarCidades(entityCidade, _VS_pai_idAntigo, _VS_unf_idAntigo, xDoc))
            {
                ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "cid_id: " + entityCidade.cid_id);
                __SessionWEB.PostMessages = UtilBO.GetErroMessage("Cidades associadas com sucesso.", UtilBO.TipoMensagem.Sucesso);
                Response.Redirect(__SessionWEB._AreaAtual._Diretorio + "ManutencaoCidade/Busca.aspx", false);
            }
            else
            {
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar associar as cidades.", UtilBO.TipoMensagem.Erro);
            }
        }
        catch (CoreLibrary.Validation.Exceptions.ValidationException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (ArgumentException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (DuplicateNameException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar associar as cidades.", UtilBO.TipoMensagem.Erro);
        }
        finally
        {
            _updCidades.Update();
        }
    }
예제 #24
0
        /// <summary>
        /// Método para salvar um informativo.
        /// </summary>
        private void Salvar()
        {
            try
            {
                bool permiteEditar = true;

                if (__SessionWEB.__UsuarioWEB.Docente.doc_id > 0)
                {
                    long tud_id      = UCCTurmaDisciplina1.Valor;
                    byte tdt_posicao = TUR_TurmaDocenteBO.SelecionaPosicaoPorDocenteTurma(__SessionWEB.__UsuarioWEB.Docente.doc_id, tud_id, ApplicationWEB.AppMinutosCacheLongo);
                    permiteEditar = CFG_PermissaoDocenteBO.SelecionaPermissaoModulo(tdt_posicao, (byte)EnumModuloPermissao.Compensacoes)
                                    .Any(p => p.pdc_permissaoEdicao);
                }

                if (permiteEditar)
                {
                    if (Convert.ToInt32(txtQtAulas.Text) == 0)
                    {
                        throw new ValidationException("Quantidade de aulas compensadas deve ser um número maior do que zero.");
                    }

                    CLS_CompensacaoAusencia entCompensacao = new CLS_CompensacaoAusencia();
                    entCompensacao.cpa_id = VS_cpa_id;
                    entCompensacao.tud_id = UCCTurmaDisciplina1.Valor;
                    entCompensacao.tpc_id = UCCPeriodoCalendario.Valor[0];
                    entCompensacao.cpa_atividadesDesenvolvidas    = txtAtividades.Text;
                    entCompensacao.cpa_quantidadeAulasCompensadas = Convert.ToInt32(txtQtAulas.Text);
                    entCompensacao.pro_id       = VS_pro_id;
                    entCompensacao.cpa_situacao = 1;
                    entCompensacao.IsNew        = VS_cpa_id < 0;

                    List <CLS_CompensacaoAusenciaAluno> listCompensacaoAluno = new List <CLS_CompensacaoAusenciaAluno>();

                    foreach (RepeaterItem item in rptAlunos.Items)
                    {
                        CheckBox ckbAluno = (CheckBox)item.FindControl("ckbAluno");
                        if (ckbAluno != null && ckbAluno.Checked)
                        {
                            HiddenField hdnId = (HiddenField)item.FindControl("hdnId");
                            if (hdnId != null)
                            {
                                string[] valor = hdnId.Value.Split(';');
                                CLS_CompensacaoAusenciaAluno compAluno = new CLS_CompensacaoAusenciaAluno
                                {
                                    tud_id = Convert.ToInt64(valor[0]),
                                    cpa_id = Convert.ToInt32(entCompensacao.cpa_id),
                                    alu_id = Convert.ToInt64(valor[1]),
                                    mtu_id = Convert.ToInt32(valor[2]),
                                    mtd_id = Convert.ToInt32(valor[3])
                                };

                                listCompensacaoAluno.Add(compAluno);
                            }
                        }
                    }

                    if (listCompensacaoAluno.Count == 0)
                    {
                        throw new ValidationException("É necessário selecionar pelo menos um aluno para realizar a compensação.");
                    }

                    if (CLS_CompensacaoAusenciaBO.Save(entCompensacao, listCompensacaoAluno, VS_FechamentoAutomatico, UCComboCalendario.Valor))
                    {
                        ApplicationWEB._GravaLogSistema(VS_cpa_id > 0 ? LOG_SistemaTipo.Update : LOG_SistemaTipo.Insert, "cpa_id: " + entCompensacao.cpa_id + " tud_id: " + entCompensacao.tud_id);
                        __SessionWEB.PostMessages = UtilBO.GetErroMessage("Compensação de ausência " + (VS_cpa_id > 0 ? "alterada" : "incluída") + " com sucesso.", UtilBO.TipoMensagem.Sucesso);

                        VS_QtAulasComp = 0;

                        VerificaPaginaRedirecionar();
                    }
                }
                else
                {
                    string msg = String.Format("O docente não possui permissão para incluir compensações de ausência para o(a) {0} selecionado(a).", GetGlobalResourceObject("Mensagens", "MSG_DISCIPLINA_MIN"));
                    lblMessage.Text = UtilBO.GetErroMessage(msg, UtilBO.TipoMensagem.Alerta);
                }
            }
            catch (ValidationException e)
            {
                lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (ArgumentException e)
            {
                lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar compensação de ausência.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #25
0
        protected void _btnNovo_Click(object sender, EventArgs e)
        {
            try
            {
                List <CFG_ParametroDocumentoAluno> parametros = CFG_ParametroDocumentoAlunoBO.GetSelect().ToList();
                parametros.Add(new CFG_ParametroDocumentoAluno
                {
                    IsNew = true
                    ,
                    pda_id = -1
                    ,
                    rlt_id = (byte)ParametroDocumentoAlunoRelatorio.BoletimEscolar
                    ,
                    ent_id = __SessionWEB.__UsuarioWEB.Usuario.ent_id
                    ,
                    pda_chave = Convert.ToString(ChaveParametroDocumentoAluno.FILTRA_POR_PERIODO)
                    ,
                    pda_descricao = ""
                    ,
                    pda_valor = ""
                    ,
                    pda_situacao = 1
                    ,
                    NomeRelatorio = ""
                });

                int index = (parametros.Count - 1);
                _grvParametros.EditIndex  = index;
                _grvParametros.DataSource = parametros;
                _grvParametros.DataBind();

                ImageButton imgEditar = (ImageButton)_grvParametros.Rows[index].FindControl("_imgEditar");
                if (imgEditar != null)
                {
                    imgEditar.Visible = false;
                }
                ImageButton imgSalvar = (ImageButton)_grvParametros.Rows[index].FindControl("_imgSalvar");
                if (imgSalvar != null)
                {
                    imgSalvar.Visible = true;
                }
                ImageButton imgCancelar = (ImageButton)_grvParametros.Rows[index].FindControl("_imgCancelarParametro");
                if (imgCancelar != null)
                {
                    imgCancelar.Visible = true;
                }

                ImageButton imgExcluir = (ImageButton)_grvParametros.Rows[index].FindControl("_imgExcluir");
                if (imgExcluir != null)
                {
                    imgExcluir.Visible = false;
                }

                string script = String.Format("SetConfirmDialogLoader('{0}','{1}');", String.Concat("#", imgExcluir.ClientID), "Confirma a exclusão?");
                Page.ClientScript.RegisterStartupScript(GetType(), imgExcluir.ClientID, script, true);

                _grvParametros.Rows[index].Focus();
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar adicionar novo parâmetro de documentos do aluno.", UtilBO.TipoMensagem.Erro);
                _updMessage.Update();
            }
        }
예제 #26
0
        private void UCComboTurmaDisciplina_IndexChanged()
        {
            try
            {
                UCCPeriodoCalendario.Valor         = new[] { -1, -1 };
                UCCPeriodoCalendario.PermiteEditar = false;
                // utilizado para evitar chamar o evento de alteracao do calendario periodo duas vezes seguidas.
                bool selecionouComboPeriodos = false;

                if (UCCTurmaDisciplina1.Valor > -1)
                {
                    long tur_id = Convert.ToInt64(ddlTurma.SelectedValue);

                    TUR_Turma entTurma = new TUR_Turma {
                        tur_id = tur_id
                    };
                    TUR_TurmaBO.GetEntity(entTurma);

                    ACA_CalendarioAnual entCalendario = new ACA_CalendarioAnual {
                        cal_id = entTurma.cal_id
                    };
                    ACA_CalendarioAnualBO.GetEntity(entCalendario);

                    ACA_FormatoAvaliacao entFormatoAvaliacao = new ACA_FormatoAvaliacao {
                        fav_id = entTurma.fav_id
                    };
                    ACA_FormatoAvaliacaoBO.GetEntity(entFormatoAvaliacao);

                    VS_FechamentoAutomatico = entFormatoAvaliacao.fav_fechamentoAutomatico;

                    TUR_TurmaDisciplina entityTurmaDisciplina = new TUR_TurmaDisciplina {
                        tud_id = UCCTurmaDisciplina1.Valor
                    };
                    TUR_TurmaDisciplinaBO.GetEntity(entityTurmaDisciplina);

                    if (entityTurmaDisciplina.tud_naoLancarFrequencia)
                    {
                        lblMessage.Text           = UtilBO.GetErroMessage(GetGlobalResourceObject("Mensagens", "MSG_DISCIPLINA") + " não pode lançar frequência na turma.", UtilBO.TipoMensagem.Alerta);
                        UCCTurmaDisciplina1.Valor = -1;
                    }
                    else
                    {
                        bool sucessoProcessarPendenciaFechamento = true;
                        if (VS_FechamentoAutomatico)
                        {
                            var pendencias = CLS_AlunoFechamentoPendenciaBO.SelecionarAguardandoProcessamento(tur_id, entityTurmaDisciplina.tud_id, entityTurmaDisciplina.tud_tipo, 0);

                            if ((pendencias != null) && (pendencias.Rows.Count > 0))
                            {
                                try
                                {
                                    // limpa cache desta turma
                                    string pattern;
                                    pattern = String.Format("{0}_{1}", ModelCache.FECHAMENTO_AUTO_BIMESTRE_PATTERN_KEY, entityTurmaDisciplina.tud_id);
                                    CacheManager.Factory.RemoveByPattern(pattern);
                                    pattern = String.Format("{0}_{1}", ModelCache.FECHAMENTO_AUTO_BIMESTRE_FILTRO_DEFICIENCIA_PATTERN_KEY, entityTurmaDisciplina.tud_id);
                                    CacheManager.Factory.RemoveByPattern(pattern);
                                    pattern = String.Format("{0}_{1}", ModelCache.FECHAMENTO_AUTO_BIMESTRE_COMPONENTES_REGENCIA_PATTERN_KEY, tur_id);
                                    CacheManager.Factory.RemoveByPattern(pattern);
                                    pattern = String.Format("{0}_{1}", ModelCache.FECHAMENTO_AUTO_FINAL_PATTERN_KEY, entityTurmaDisciplina.tud_id);
                                    CacheManager.Factory.RemoveByPattern(pattern);
                                    pattern = String.Format("{0}_{1}", ModelCache.FECHAMENTO_AUTO_FINAL_FILTRO_DEFICIENCIA_PATTERN_KEY, entityTurmaDisciplina.tud_id);
                                    CacheManager.Factory.RemoveByPattern(pattern);
                                    pattern = String.Format("{0}_{1}", ModelCache.FECHAMENTO_AUTO_FINAL_COMPONENTES_REGENCIA_PATTERN_KEY, tur_id);
                                    CacheManager.Factory.RemoveByPattern(pattern);
                                    pattern = String.Format(ModelCache.PENDENCIAS_DISCIPLINA_MODEL_KEY, entTurma.esc_id, entTurma.uni_id, entCalendario.cal_ano, entityTurmaDisciplina.tud_id);
                                    CacheManager.Factory.Remove(pattern);
                                    CLS_AlunoFechamentoPendenciaBO.Processar(entityTurmaDisciplina.tud_id, (byte)AvaliacaoTipo.Final, pendencias);
                                }
                                catch (Exception ex)
                                {
                                    sucessoProcessarPendenciaFechamento = false;
                                    ApplicationWEB._GravaErro(ex);
                                    lblMessage.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Classe", "CompensacaoAusencia.Cadastro.MensagemErroProcessarPendenciaFechamento").ToString(), UtilBO.TipoMensagem.Erro);
                                }
                            }
                        }
                        if (sucessoProcessarPendenciaFechamento)
                        {
                            UCCPeriodoCalendario.CarregarPorPeriodoEventoEfetivacaoVigentes(entTurma.cal_id, UCCTurmaDisciplina1.Valor, entTurma.tur_id, true);
                            selecionouComboPeriodos = UCCPeriodoCalendario.Valor[0] != -1 && UCCPeriodoCalendario.Valor[1] != -1;

                            UCCPeriodoCalendario.SetarFoco();
                            UCCPeriodoCalendario.PermiteEditar = true;
                        }

                        VS_DisciplinaEspecial = entityTurmaDisciplina.tud_disciplinaEspecial;

                        VS_posicao = TUR_TurmaDocenteBO.SelecionaPosicaoPorDocenteTurma(_VS_doc_id, UCCTurmaDisciplina1.Valor, ApplicationWEB.AppMinutosCacheLongo);

                        VS_tipoDocente = ACA_TipoDocenteBO.SelecionaTipoDocentePorPosicao(VS_posicao, ApplicationWEB.AppMinutosCacheLongo);
                    }
                }

                if (!selecionouComboPeriodos)
                {
                    UCCPeriodoCalendario_IndexChanged();
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #27
0
 private void _Salvar()
 {
     try
     {
         if (!this._chkRecorrenciaAnual.Checked)
         {
             this._txtVigenciaIni.Text = this._txtData.Text;
             this._txtVigenciaFim.Text = this._txtData.Text;
         }
         SYS_DiaNaoUtil _DiaNaoUtil = new SYS_DiaNaoUtil()
         {
             dnu_id = this._VS_dnu_id
             ,
             dnu_nome = this._txtNome.Text
             ,
             dnu_abrangencia = Convert.ToByte(this._ddlAbrangencia.SelectedValue)
             ,
             dnu_descricao = this._txtDescricao.Text
             ,
             dnu_data = (this._chkRecorrenciaAnual.Checked) ? Convert.ToDateTime(this._txtDataDia.Text + "/" + this._txtDataMes.Text + "/2000") : Convert.ToDateTime(this._txtData.Text)
             ,
             dnu_recorrencia = (this._chkRecorrenciaAnual.Checked) ? true : false
             ,
             dnu_vigenciaInicio = Convert.ToDateTime(this._txtVigenciaIni.Text.Trim())
             ,
             dnu_vigenciaFim = string.IsNullOrEmpty(this._txtVigenciaFim.Text.Trim()) ? new DateTime() : Convert.ToDateTime(this._txtVigenciaFim.Text.Trim())
             ,
             cid_id = String.IsNullOrEmpty(this._UCComboCidade._Combo.SelectedValue) ? Guid.Empty : new Guid(this._UCComboCidade._Combo.SelectedValue)
             ,
             unf_id = String.IsNullOrEmpty(this._UCComboUnidadeFederativa._Combo.SelectedValue) ? Guid.Empty : new Guid(this._UCComboUnidadeFederativa._Combo.SelectedValue)
             ,
             dnu_situacao = 1
             ,
             IsNew = (this._VS_dnu_id != Guid.Empty) ? false : true
         };
         if (SYS_DiaNaoUtilBO.Save(_DiaNaoUtil, _VerificaVigenciaInicio))
         {
             if (this._VS_dnu_id != Guid.Empty)
             {
                 ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "dnu_id:" + _DiaNaoUtil.dnu_id);
                 this.__SessionWEB.PostMessages = UtilBO.GetErroMessage("Dia não útil alterado com sucesso.", UtilBO.TipoMensagem.Sucesso);
             }
             else
             {
                 ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "dnu_id:" + _DiaNaoUtil.dnu_id);
                 this.__SessionWEB.PostMessages = UtilBO.GetErroMessage("Dia não útil incluído com sucesso.", UtilBO.TipoMensagem.Sucesso);
             }
             Response.Redirect(this.__SessionWEB._AreaAtual._Diretorio + "DiasNaoUtil/Busca.aspx", false);
         }
         else
         {
             this._lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar o dia não útil.", UtilBO.TipoMensagem.Erro);
         }
     }
     catch (ArgumentException e)
     {
         this._lblMessage.Text = UtilBO.GetErroMessage(e.Message, UtilBO.TipoMensagem.Alerta);
     }
     catch (Exception e)
     {
         ApplicationWEB._GravaErro(e);
         this._lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar o dia não útil.", UtilBO.TipoMensagem.Erro);
     }
 }
예제 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    string provider = IdentitySettingsConfig.IDSSettings.AuthenticationType;
                    Context.GetOwinContext().Authentication.Challenge(provider);
                }
                else
                {
                    if (!UserIsAuthenticated())
                    {
                        throw new Exception("Usuário não encontrado!");
                    }

                    string prefixoRESP = ACA_ParametroAcademicoBO.ParametroValorPorEntidade(eChaveAcademico.PREFIXO_LOGIN_RESPONSAVEL_AREA_ALUNO, __SessionWEB.__UsuarioWEB.Usuario.ent_id);
                    bool   responsavel = __SessionWEB.__UsuarioWEB.Usuario.usu_login.Contains(prefixoRESP);

                    // Se selecionou para logar como responsável, verifica se esse ele é responsável por um aluno só,
                    //  ou caso tenha mais, redireciona para uma tela de selação de alunos
                    if (responsavel)
                    {
                        __SessionWEB.__UsuarioWEB.responsavel = true;
                        string prefixoAluno = ACA_ParametroAcademicoBO.ParametroValorPorEntidade(eChaveAcademico.PREFIXO_LOGIN_ALUNO_AREA_ALUNO, __SessionWEB.__UsuarioWEB.Usuario.ent_id);
                        //Troca o prefixo de responsável por aluno
                        var regex      = new Regex(Regex.Escape(prefixoRESP));
                        var loginAluno = regex.Replace(__SessionWEB.__UsuarioWEB.Usuario.usu_login, prefixoAluno, 1);

                        SYS_Usuario entityUsuarioAluno = new SYS_Usuario
                        {
                            ent_id    = __SessionWEB.__UsuarioWEB.Usuario.ent_id,
                            usu_login = loginAluno
                        };

                        SYS_UsuarioBO.GetSelectBy_ent_id_usu_login(entityUsuarioAluno);
                        __SessionWEB.__UsuarioWEB.pes_idAluno = entityUsuarioAluno.pes_id;

                        DataTable dtAlunosDoResponsavel = ACA_AlunoResponsavelBO.SelecionaAlunosPorResponsavel(__SessionWEB.__UsuarioWEB.Usuario.pes_id);
                        Session["Pes_Id_Responsavel"]      = __SessionWEB.__UsuarioWEB.Usuario.pes_id.ToString();
                        Session["Qtde_Filhos_Responsavel"] = dtAlunosDoResponsavel.Rows.Count;
                        if (dtAlunosDoResponsavel.Rows.Count > 1)
                        {
                            RedirecionarLogin(true);
                            return;
                        }
                    }
                    RedirecionarLogin(false);
                    return;
                }
            }
            catch (ValidationException ex)
            {
                lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar entrar no sistema.", UtilBO.TipoMensagem.Erro);
            }
        }
예제 #29
0
    /// <summary>
    /// Salva o calendário anual
    /// </summary>
    public void Salvar()
    {
        try
        {
            DataTable CalendarioPeriodico = new DataTable();
            int       valida = ValidaCampos();
            if (valida != 1)
            {
                if (valida == 0)
                {
                    CalendarioPeriodico = dtCalendarioPeriodo(listCalendarioPeriodo());
                }

                ACA_CalendarioAnual _calendarioAnual = new ACA_CalendarioAnual
                {
                    ent_id = __SessionWEB.__UsuarioWEB.Usuario.ent_id
                    ,
                    cal_id = _VS_cal_id
                    ,
                    cal_padrao = true
                    ,
                    cal_ano = Convert.ToInt32(_txtAno.Text)
                    ,
                    cal_descricao = _txtDescricao.Text
                    ,
                    cal_dataInicio = Convert.ToDateTime(_txtDataInicio.Text)
                    ,
                    cal_dataFim = Convert.ToDateTime(_txtDataFim.Text)
                    ,
                    cal_permiteLancamentoRecesso = ckbPermiteRecesso.Checked
                    ,
                    cal_situacao = 1
                    ,
                    IsNew = (_VS_cal_id > 0) ? false : true
                };

                List <ACA_CalendarioCurso> ListaCursoCurriculo = CriarListaCalendarioCurso();

                if (ACA_CalendarioAnualBO.Save(_calendarioAnual, CalendarioPeriodico, ListaCursoCurriculo, __SessionWEB.__UsuarioWEB.Usuario.ent_id))
                {
                    if (_VS_cal_id <= 0)
                    {
                        ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "cal_id: " + _calendarioAnual.cal_id);
                        __SessionWEB.PostMessages = UtilBO.GetErroMessage("Calendário escolar incluído com sucesso.", UtilBO.TipoMensagem.Sucesso);
                    }
                    else
                    {
                        ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "cal_id: " + _calendarioAnual.cal_id);
                        __SessionWEB.PostMessages = UtilBO.GetErroMessage("Calendário escolar alterado com sucesso.", UtilBO.TipoMensagem.Sucesso);
                    }

                    Response.Redirect("Busca.aspx", false);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
                else
                {
                    _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar o calendário escolar.", UtilBO.TipoMensagem.Erro);
                }
            }
        }
        catch (MSTech.Validation.Exceptions.ValidationException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (DuplicateNameException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (ArgumentException ex)
        {
            _lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar o calendário escolar.", UtilBO.TipoMensagem.Erro);
        }
    }
예제 #30
0
파일: Index.aspx.cs 프로젝트: Mualumene/SGP
        /// <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();
            }
        }