示例#1
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)
            {
                Int64 alu_id = __SessionWEB.__UsuarioWEB.alu_id;

                // somente terá acesso se o flag exibirBoletim do cadastro de "Tipo de ciclo" estiver marcado
                if (!ACA_TipoCicloBO.VerificaSeExibeCompromissoAluno(alu_id))
                {
                    lblMensagem.Text             = UtilBO.GetErroMessage("Este usuário não tem permissão de acesso a esta página.", UtilBO.TipoMensagem.Alerta);
                    fdsCompromissoEstudo.Visible = false;
                    return;
                }

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

                UCComboAnosLetivos.CarregarComboAnosLetivos(__SessionWEB.__UsuarioWEB.alu_id, 0);

                UCComboAnosLetivos.Ano = VSAnoLetivo;
                AnosLetivos_SelectedIndexChanged();
            }

            UCComboAnosLetivos.IndexChanged += AnosLetivos_SelectedIndexChanged;
        }
示例#2
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));
                sm.Scripts.Add(new ScriptReference(ArquivoJS.CamposData));

                sm.Scripts.Add(new ScriptReference("~/includes/jquery.PrintBoletim.js"));
            }

            try
            {
                if (!IsPostBack)
                {
                    if ((__SessionWEB.__UsuarioWEB ?? new UsuarioWEB()).alu_id <= 0)
                    {
                        throw new ValidationException("Usuário não autorizado a exibir a Área do Aluno.");
                    }

                    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))
                        {
                            VS_nomeBoletim = (string)GetGlobalResourceObject("AreaAluno.MasterPageAluno", "MenuBoletimInfantil");
                        }
                        else
                        {
                            VS_nomeBoletim = (string)GetGlobalResourceObject("AreaAluno.MasterPageAluno", "MenuBoletimOnline");
                        }
                    }

                    ACA_Aluno entityAluno = ACA_AlunoBO.GetEntity(new ACA_Aluno {
                        alu_id = __SessionWEB.__UsuarioWEB.alu_id
                    });
                    if (entityAluno.alu_possuiInformacaoSigilosa && entityAluno.alu_bloqueioBoletimOnline)
                    {
                        Response.Redirect("~/Index.aspx", false);
                        HttpContext.Current.ApplicationInstance.CompleteRequest();
                    }

                    UCComboAnosLetivos.CarregarComboAnosLetivos(__SessionWEB.__UsuarioWEB.alu_id, 0);

                    // Selecionar o mtu_id que está na sessão do aluno.

                    var valores = (from ListItem item in UCComboAnosLetivos.Combo.Items
                                   let mtu_id_cal_id = item.Value.Split(',')
                                                       where mtu_id_cal_id.Length > 0 &&
                                                       mtu_id_cal_id[0] == __SessionWEB.__UsuarioWEB.mtu_id.ToString()
                                                       select item.Value);

                    if (valores.Any() && UCComboAnosLetivos.Combo.Items.FindByValue(valores.First()) != null)
                    {
                        UCComboAnosLetivos.mtu_id = __SessionWEB.__UsuarioWEB.mtu_id;
                    }

                    //int mtu_id = 0;
                    //int tpc_id = 0;

                    //if (mtu_id == 0)
                    //{
                    //    mtu_id = (string.IsNullOrEmpty(UCComboAnosLetivos.Valor)
                    //                   ? __SessionWEB.__UsuarioWEB.mtu_id
                    //                   : Convert.ToInt32(UCComboAnosLetivos.Valor));
                    //}

                    //if (tpc_id == 0)
                    //{
                    //    if ((UCComboAnosLetivos.Ano == DateTime.Now.Year) && (__SessionWEB.__UsuarioWEB.tpc_id > 0))
                    //    {
                    //        tpc_id = __SessionWEB.__UsuarioWEB.tpc_id;
                    //    }
                    //}

                    //Session["tpc_id"] = tpc_id;
                    //Session["alu_ids"] = __SessionWEB.__UsuarioWEB.alu_id;
                    //Session["mtu_ids"] = mtu_id;
                    //Session["mostrarPeriodos"] = true;

                    CarregarBoletimPorComboAnoLetivo(0, 0);
                }
            }
            catch (ValidationException ex)
            {
                lblMensagem.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta);
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMensagem.Text = UtilBO.GetErroMessage("Erro ao exibir o " + VS_nomeBoletim + " do aluno.", UtilBO.TipoMensagem.Erro);
            }

            UCComboAnosLetivos.IndexChanged += AnosLetivos_SelectedIndexChanged;
        }