Example #1
0
        /// <summary>
        /// Faz o pré procesamento de notas e frequeências que estão na fila para o novo fechamento
        /// </summary>
        public static void ExecJOB_ProcessamentoNotaFrequenciaFechamentoAsync(bool limpacache = true)
        {
            using (DataTable dt = new GestaoEscolarServicoDAO().ExecJOB_ProcessamentoNotaFrequenciaFechamentoAsync())
            {
                if (limpacache)
                {
                    if (dt.Rows.Count > 0)
                    {
                        List <sChavesCacheFechamento> ltChave = (from DataRow dr in dt.Rows
                                                                 select(sChavesCacheFechamento) GestaoEscolarUtilBO.DataRowToEntity(dr, new sChavesCacheFechamento())).ToList();

                        // Informações da configuracao.
                        IDictionary <string, ICFG_Configuracao> configuracao;
                        CFG_ConfiguracaoBO.Consultar(eConfig.Academico, out configuracao);
                        string ips = configuracao["AppEnderecoIPRaizHandlerLimpaCache"].cfg_valor;

                        string[] listaIps = ips.Split('|');

                        foreach (string ip in listaIps)
                        {
                            string handler = ip + "/Configuracao/Conteudo/LimpaCache.ashx?tipoCache=1";
                            handler += "&tur_ids=" + string.Join(";", ltChave.Select(p => p.tur_id));
                            handler += "&tud_ids=" + string.Join(";", ltChave.Select(p => p.tud_id));
                            handler += "&fav_ids=" + string.Join(";", ltChave.Select(p => p.fav_id));
                            handler += "&ava_ids=" + string.Join(";", ltChave.Select(p => p.ava_id));
                            handler += "&tpc_ids=" + string.Join(";", ltChave.Select(p => p.tpc_id));

                            HttpWebRequest  request  = WebRequest.Create(handler) as HttpWebRequest;
                            HttpWebResponse response = request.GetResponse() as HttpWebResponse;
                        }
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Processa a abertura/fechamento das turmas dos anos anteriores.
        /// </summary>
        public static void ExecJOB_ProcessamentoAberturaTurmaAnosAnteriores()
        {
            new GestaoEscolarServicoDAO().ExecJOB_ProcessamentoAberturaTurmaAnosAnteriores();

            IDictionary <string, ICFG_Configuracao> configuracao;

            CFG_ConfiguracaoBO.Consultar(eConfig.Academico, out configuracao);
            string ips = configuracao["AppEnderecoIPRaizHandlerLimpaCache"].cfg_valor;

            string[] listaIps = ips.Split('|');

            foreach (string ip in listaIps)
            {
                string handler = ip + "/Configuracao/Conteudo/LimpaCache.ashx?tipoCache=3";

                try
                {
                    HttpWebRequest request = WebRequest.Create(handler) as HttpWebRequest;
                    request.GetResponseAsync();
                }
                catch
                {
                }
            }
        }
Example #3
0
        /// <summary>
        /// Faz o pré procesamento do relatório pendências por disciplinas e alunos
        /// </summary>
        public static void ExecJOB_ProcessamentoRelatorioDisciplinasAlunosPendenciasAsync(bool limpacache = true)
        {
            using (DataTable dt = new GestaoEscolarServicoDAO().ExecJOB_ProcessamentoRelatorioDisciplinasAlunosPendenciasAsync())
            {
                if (dt.Rows.Count > 0)
                {
                    List <sChaveCachePendenciaFechamento> ltChave = (from DataRow dr in dt.Rows
                                                                     select(sChaveCachePendenciaFechamento) GestaoEscolarUtilBO.DataRowToEntity(dr, new sChaveCachePendenciaFechamento())).ToList();

                    if (limpacache)
                    {
                        // Informações do e-mail.
                        IDictionary <string, ICFG_Configuracao> configuracao;
                        CFG_ConfiguracaoBO.Consultar(eConfig.Academico, out configuracao);
                        string ips = configuracao["AppEnderecoIPRaizHandlerLimpaCache"].cfg_valor;

                        string[] listaIps = ips.Split('|');

                        foreach (string ip in listaIps)
                        {
                            string handler = ip + "/Configuracao/Conteudo/LimpaCache.ashx?tipoCache=2";
                            handler += "&esc_ids=" + string.Join(";", ltChave.Select(p => p.esc_id));
                            handler += "&uni_ids=" + string.Join(";", ltChave.Select(p => p.uni_id));
                            handler += "&cal_ids=" + string.Join(";", ltChave.Select(p => p.cal_id));
                            handler += "&tud_ids=" + string.Join(";", ltChave.Select(p => p.tud_id));

                            try
                            {
                                HttpWebRequest request = WebRequest.Create(handler) as HttpWebRequest;
                                request.GetResponseAsync();
                            }
                            catch
                            {
                            }
                        }
                    }
                }
            }
        }