protected void Page_Load(object sender, EventArgs e) { ScriptManager sm = ScriptManager.GetCurrent(Page); if (sm != null) { sm.Scripts.Add(new ScriptReference("~/Includes/Angular/angular.js")); sm.Scripts.Add(new ScriptReference("~/Includes/Angular/module.js")); sm.Scripts.Add(new ScriptReference("~/Includes/Angular/Boletim.controller.js")); } if (!IsPostBack) { int temp; if (Session["tpc_id"] != null && int.TryParse(Session["tpc_id"].ToString(), out temp)) { tpc_id = temp; } alu_ids = Session["alu_ids"] as string; mtu_ids = Session["mtu_ids"] as string; Token = CreateToken(Usuario, Entidade, Grupo); bool visible = true; if (Session["mostrarPeriodos"] != null) { bool.TryParse(Session["mostrarPeriodos"].ToString(), out visible); } if (visible && !string.IsNullOrEmpty(alu_ids) && !alu_ids.Contains(",")) { long alu_id = 0; int mtu_id = 0; if (long.TryParse(alu_ids, out alu_id) && (string.IsNullOrEmpty(mtu_ids) || int.TryParse(mtu_ids, out mtu_id))) { var matriculas = ACA_AlunoBO.BuscarMatriculasPeriodos(new long[] { alu_id }, new int[] { mtu_id }); rptPeriodos.DataSource = matriculas; rptPeriodos.DataBind(); } } var textoRodape = GetGlobalResourceObject("Mensagens", "MSG_RODAPEBOLETIMCOMPLETO").ToString(); divRodape.Visible = !string.IsNullOrWhiteSpace(textoRodape); lblRodape.Text = textoRodape; var textoRodapeInfantil = GetGlobalResourceObject("Mensagens", "MSG_RODAPEBOLETIMCOMPLETOInfantil").ToString(); divRodapeInfantil.Visible = !string.IsNullOrWhiteSpace(textoRodapeInfantil); lblRodapeInfantil.Text = textoRodapeInfantil; var textoRodapeFreqExterna = ACA_ParametroAcademicoBO.ParametroValorPorEntidade(eChaveAcademico.MENSAGEM_FREQUENCIA_EXTERNA, __SessionWEB.__UsuarioWEB.Usuario.ent_id); lblFreqExterna.Text = !string.IsNullOrEmpty(textoRodapeFreqExterna) ? "* " + textoRodapeFreqExterna : textoRodapeFreqExterna; lblFreqExternaInfantil.Text = !string.IsNullOrEmpty(textoRodapeFreqExterna) ? "* " + textoRodapeFreqExterna : textoRodapeFreqExterna; } }
public void CarregaBoletim(long aluId, int mtuId, int tpcId, bool mostrarPeriodos) { tpc_id = tpcId; alu_ids = aluId.ToString(); mtu_ids = mtuId.ToString(); Token = CreateToken(Usuario, Entidade, Grupo); if (aluId > 0) { var matriculas = ACA_AlunoBO.BuscarMatriculasPeriodos(new long[] { aluId }, new int[] { mtuId }); int temp; if (tpc_id == 0 && int.TryParse(matriculas.Rows[0]["tpc_id"].ToString(), out temp)) { tpc_id = temp; } rptPeriodos.DataSource = matriculas; rptPeriodos.DataBind(); } }