Exemplo n.º 1
0
 private void FrmListaBaixarArquivos_Load(object sender, EventArgs e)
 {
     try
     {
         FrmArquivoDataSUS.formAtual = this;
         this.PreencherComboFrequencia();
         this.CarregarConfiguracoes();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         BaseAquivosDataSUS.SalvarLogErroAplicacao(ex);
     }
 }
Exemplo n.º 2
0
        private void btnAgendarExecucao_Click(object sender, EventArgs e)
        {
            if (this.Validar())
            {
                try
                {
                    this.btnExecutarAgora.Enabled = this.btnAgendarExecucao.Enabled = false;
                    //
                    this.DefinirAgendamentoExecucao();
                    //
                    this.btnExecutarAgora.Enabled = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);

                    this.btnExecutarAgora.Enabled = this.btnAgendarExecucao.Enabled = true;
                    BaseAquivosDataSUS.SalvarLogErroAplicacao(ex);
                }
            }
        }
Exemplo n.º 3
0
 public void ExecutarLocal(IJobExecutionContext context)
 {
     try
     {
         if (this.emExecucao)
         {
             RegistroLog.RegistarLogInfo("**********************************************************************************");
             RegistroLog.RegistarLogInfo(Mensagem.ServicoEmExecucao);
             RegistroLog.RegistarLogInfo(Mensagem.SistemaUltimaExecucao + " (" + context.FireTimeUtc.Value.LocalDateTime.ToString(Constantes.FormatoDataHora) + ")");
             RegistroLog.RegistarLogInfo(Mensagem.SistemaProximaExecucao + " (" + context.NextFireTimeUtc.Value.LocalDateTime.ToString(Constantes.FormatoDataHora) + ")");
             RegistroLog.RegistarLogInfo("**********************************************************************************");
         }
         else
         {
             //Inicia a o tratamento dos arquivos.
             this.IniciarExecucao(context.FireTimeUtc.Value.LocalDateTime, context.NextFireTimeUtc.Value.LocalDateTime);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         BaseAquivosDataSUS.SalvarLogErroAplicacao(ex);
     }
 }
Exemplo n.º 4
0
        private void btnExecutarAgora_Click(object sender, EventArgs e)
        {
            if (this.Validar())
            {
                try
                {
                    this.btnExecutarAgora.Enabled = this.btnAgendarExecucao.Enabled = false;
                    RegistroLog.RegistarLogInfo(Mensagem.SistemaAgendamentoInicio);
                    //
                    this.IniciarExecucao(DateTime.Now, DateTime.Now);
                    //
                    RegistroLog.RegistarLogInfo(Mensagem.SistemaAgendamentoFim);
                    this.btnExecutarAgora.Enabled   = true;
                    this.btnAgendarExecucao.Enabled = (this.scheduler == null);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);

                    this.btnExecutarAgora.Enabled = this.btnAgendarExecucao.Enabled = true;
                    BaseAquivosDataSUS.SalvarLogErroAplicacao(ex);
                }
            }
        }
Exemplo n.º 5
0
        private void IniciarExecucao(DateTime ultimaExcucao, DateTime proximaExecucao)
        {
            this.emExecucao = true;

            this.DefinirIcone();

            this.lblBarraStatus.Text = Mensagem.SistemaInicio;

            Stopwatch tempoExecucao = new Stopwatch();

            tempoExecucao.Start();

            this.lblStatusApp.Text = Mensagem.SistemaEmExecucao;

            RegistroLog.RegistarLogInfo(Mensagem.SistemaInicio);

            //if (this.lblTipoArquivos.Text.Contains(Constantes.TipoArquivoRD))
            //    this.BuscarArquivosRD();
            //if (this.lblTipoArquivos.Text.Contains(Constantes.TipoArquivoRJ))
            //    this.BuscarArquivosRJ();
            //if (this.lblTipoArquivos.Text.Contains(Constantes.TipoArquivoPA))
            //    this.BuscarArquivosPA();

            if (this.lblTipoArquivos.Text.Contains(Constantes.TipoArquivoRD))
            {
                try
                {
                    this.BuscarArquivosRD();
                }
                catch (Exception ex)
                {
                    BaseAquivosDataSUS.SalvarLogErroAplicacao(Mensagem.ArqFalhaRD, ex);
                }
            }

            if (this.lblTipoArquivos.Text.Contains(Constantes.TipoArquivoRJ))
            {
                try
                {
                    this.BuscarArquivosRJ();
                }
                catch (Exception ex)
                {
                    BaseAquivosDataSUS.SalvarLogErroAplicacao(Mensagem.ArqFalhaRJ, ex);
                }
            }

            if (this.lblTipoArquivos.Text.Contains(Constantes.TipoArquivoPA))
            {
                try
                {
                    this.BuscarArquivosPA();
                }
                catch (Exception ex)
                {
                    BaseAquivosDataSUS.SalvarLogErroAplicacao(Mensagem.ArqFalhaPA, ex);
                }
            }

            this.lblUltimaExecucao.Text  = ultimaExcucao.ToString(Constantes.FormatoDataHora);
            this.lblProximaExecucao.Text = proximaExecucao.ToString(Constantes.FormatoDataHora);

            tempoExecucao.Stop();

            this.lblExecucao.Text  = Constantes.FormartarTimeSpan(tempoExecucao.Elapsed);
            this.lblStatusApp.Text = Mensagem.SistemaAguardandoExecucao;

            RegistroLog.RegistarLogInfo(Mensagem.SistemaFim);
            RegistroLog.RegistarLogInfo(Mensagem.SistemaTempoExecucao + tempoExecucao.Elapsed.ToString());

            this.lblBarraStatus.Text = Mensagem.SistemaFim;

            RegistroLog.RegistarLogInfo("----------------------------------------------------------------------------------");

            this.emExecucao = false;

            this.DefinirIcone();
        }