示例#1
0
        private void IntegracaoCancelPedido(object sender, ElapsedEventArgs e)
        {
            try
            {
                timerCancelPedido.Enabled   = false;
                timerCancelPedido.AutoReset = false;

                this.log.WriteLogPedido("#### INTEGRAÇÃO CANCELAMENTO DE PEDIDO INICIADA");

                IntegracaoService integracaoService = new IntegracaoService();

                integracaoService.IniciarIntegracaoCancelamentoPedido(this.oCompany);

                timerCancelPedido.Enabled = true;

                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
            }
            catch (Exception ex)
            {
                this.log.WriteLogPedido("Exception IntegracaoCancelamento " + ex.Message);
                throw;
            }
        }
示例#2
0
        private void IntegracaoEstoque(object sender, ElapsedEventArgs e)
        {
            try
            {
                timerEstoque.Enabled   = false;
                timerEstoque.AutoReset = false;

                this.log.WriteLogEstoque("#### INTEGRAÇÃO DE ESTOQUE INICIALIZADA");

                IntegracaoService integracaoService = new IntegracaoService();

                integracaoService.IniciarIntegracaoEstoque(this.oCompany);

                timerEstoque.Enabled = true;

                //System.Runtime.InteropServices.Marshal.ReleaseComObject(oCompanyEstoque);

                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
            }
            catch (Exception ex)
            {
                this.log.WriteLogEstoque("Exception IntegracaoEstoque " + ex.Message);
                throw;
            }
        }
示例#3
0
        private void IntegracaoRetornoNF(object sender, ElapsedEventArgs e)
        {
            try
            {
                timerRetNF.Enabled   = false;
                timerRetNF.AutoReset = false;

                this.log.WriteLogPedido("#### INTEGRAÇÃO RETORNO NF INICIALIZADA");

                IntegracaoService integracaoService = new IntegracaoService();

                integracaoService.RetornoNotaFiscal(this.oCompany);

                timerRetNF.Enabled = true;

                //System.Runtime.InteropServices.Marshal.ReleaseComObject(oCompanyRetNF);

                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
            }
            catch (Exception ex)
            {
                this.log.WriteLogPedido("Exception IntegracaoRetornoNF " + ex.Message);
                throw;
            }
        }
        public async Task TesteAsync()
        {
            IntegracaoService integracaoService = new IntegracaoService();

            //integracaoService.GetNewAccessToken();

            //integracaoService.IniciarIntegracaoPedido(this.oCompany);
            integracaoService.RetornoNotaFiscal(this.oCompany);
            //integracaoService.IniciarIntegracaoEstoque(oCompany);
        }
        public void Teste()
        {
            //this.timerEstoque.Interval = TimeSpan.FromHours(Convert.ToDouble(intervaloExecucaoEstoque)).TotalMilliseconds;

            IntegracaoService integracaoService = new IntegracaoService();

            //integracaoService.IniciarIntegracaoCancelamentoPedido(oCompany);
            //integracaoService.IniciarIntegracaoEstoque(this.oCompany);
            integracaoService.RetornoNotaFiscal(this.oCompany);
            //integracaoService.IniciarIntegracaoPedido(this.oCompany);
        }
        public ScheduleIntegracoesML()
        {
            this.log      = new Log();
            this.oCompany = CommonConn.InitializeCompany();

            IntegracaoService integracaoService = new IntegracaoService();

            integracaoService.GetNewAccessToken();

            InitializeComponent();
        }
示例#7
0
        public Scheduler()
        {
            log = new Log();

            log.WriteLogPedido("Conectando ao SAPB1 ...");
            log.WriteLogEstoque("Conectando ao SAPB1 ...");
            log.WriteLogRetornoNF("Conectando ao SAPB1 ...");

            oCompany = CommonConn.InitializeCompany();

            IntegracaoService integracaoService = new IntegracaoService();

            integracaoService.GetNewAccessToken();

            //integracaoService.IniciarIntegracaoPedido(oCompany);

            InitializeComponent();
        }
示例#8
0
        public void TesteWriter()
        {
            ///Log.WriteLogEstoque("Modo DEBUG inicializado.");

            //Log.WriteLogPedido("Modo DEBUG inicializado.");
            //string intervaloExecucaoEstoque = ConfigurationManager.AppSettings["intervaloExecucaoEstoque"] + ",10";
            //this.timerEstoque = new Timer();

            //this.timerEstoque.Interval = TimeSpan.FromHours(Convert.ToDouble(intervaloExecucaoEstoque)).TotalMilliseconds;

            IntegracaoService integracaoService = new IntegracaoService();

            //integracaoService.IniciarIntegracaoCancelamentoPedido(oCompany);
            //integracaoService.IniciarIntegracaoEstoque(oCompany);

            integracaoService.RetornoNotaFiscal(this.oCompany);

            //integracaoService.IniciarIntegracaoPedido(null);
        }
示例#9
0
        private void timer_Tick(object sender, ElapsedEventArgs e)
        {
            Util.Log.WriteLog("Chamou método.");

            try
            {
                IntegracaoService integracaoService = new IntegracaoService();

                integracaoService.IniciarProcesso(Environment.GetEnvironmentVariable("controleExecucao"));

                //Atualizando variavel de ambiente para controle da integração
                Environment.SetEnvironmentVariable("controleExecucao", DateTime.Now.ToString("s") + "Z");
            }
            catch (Exception)
            {
                throw;
            }

            //throw new NotImplementedException();
        }