Exemplo n.º 1
0
    protected void _grvAluno_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Boletim")
        {
            try
            {
                int  index  = int.Parse(e.CommandArgument.ToString());
                long alu_id = Convert.ToInt64(_grvAluno.DataKeys[index].Value);
                int  tpc_id = ACA_TipoPeriodoCalendarioBO.SelecionaPeriodoVigente();

                ucBoletim.Carregar(tpc_id, alu_id);
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "BoletimCompletoAluno", "$(document).ready(function(){ $('#divBoletimCompleto').dialog('open'); });", true);
            }
            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 boletim completo do aluno.", UtilBO.TipoMensagem.Erro);
            }
        }

        if (e.CommandName == "RelatorioPedagogico")
        {
            try
            {
                int index = int.Parse(e.CommandArgument.ToString());

                Session.Remove("alu_id_RelatorioPedagogico");
                Session.Remove("PaginaRetorno_RelatorioPedagogico");

                Session.Add("alu_id_RelatorioPedagogico", Convert.ToInt64(_grvAluno.DataKeys[index].Value));
                Session.Add("PaginaRetorno_RelatorioPedagogico", Path.Combine(MSTech.Web.WebProject.ApplicationWEB._DiretorioVirtual, "Academico/Aluno/Busca.aspx"));
                RedirecionarPagina("~/Documentos/RelatorioPedagogico/RelatorioPedagogico.aspx");
            }
            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 pedagógico do aluno.", UtilBO.TipoMensagem.Erro);
            }
        }
    }