Example #1
0
        private void frmGatilhos_Load(object sender, EventArgs e)
        {
            agilee = new AgileE();

            CarregarListTabelas();
            CarregarGatilhoDoBancoPlataforma(cmbTabelaPlataforma.SelectedValue.ToString());
        }
Example #2
0
        public static void InstanciaApis()
        {
            Geral.harpiaapi = new AgileESync.HarpiaApi(Geral.HarpiaWMSConStr(Geral.frmconfiguracao.txtIP.Text, Geral.frmconfiguracao.txtPorta.Text, Geral.frmconfiguracao.txtInstancia.Text, Geral.frmconfiguracao.txtUsuario.Text, Geral.frmconfiguracao.txtSenha.Text));
            Geral.agileapi  = new AgileECommerceApi(Geral.frmconfiguracao.txtApiUrl.Text, Geral.frmconfiguracao.txtToken.Text, Geral.frmconfiguracao.txtAccessKeyId.Text, Geral.frmconfiguracao.txtSecretAccessKey.Text, Geral.frmconfiguracao.cmbRegionEndpoint.Text, Geral.frmconfiguracao.txtBucketName.Text);
            Geral.agilee    = new AgileE();

            //Testando conexao das Apis
            if (!Geral.harpiaapi.TestaConexao())
            {
                MessageBox.Show("Não foi possivel conectar ao Harpia!");
            }
        }
        private void bgwSyncJob_DoWork(object sender, DoWorkEventArgs e)
        {
            AgileE agilee = new AgileE();

            long count = 0;

            DataTable dtSyncJob = new DataTable();
            List <AgileECommerceApi.AgileESyncJob> listSyncJob = new List <AgileECommerceApi.AgileESyncJob>();

            while (!bgwSyncJob.CancellationPending)
            {
                dtSyncJob   = agilee.getSyncJob();
                listSyncJob = Geral.DataTableToSyncJob(dtSyncJob);

                bgwSyncJob.ReportProgress(1, "0 / " + listSyncJob.Count().ToString());

                qtd_fail_loop_atual = 0;
                count = 0;

                foreach (var job in listSyncJob)
                {
                    var job_done = agilee.doJob(job, ref bgwSyncJob);
                    count++;

                    bgwSyncJob.ReportProgress(1, count.ToString() + " / " + listSyncJob.Count().ToString());

                    if (job_done.Status == "E")
                    {
                        qtd_fail_loop_atual++;
                        bgwSyncJob.ReportProgress(2, qtd_fail_loop_atual.ToString());
                    }

                    if (bgwSyncJob.CancellationPending)
                    {
                        break;
                    }
                }

                System.Threading.Thread.Sleep(10000);
            }

            if (bgwSyncJob.CancellationPending)
            {
                return;
            }
        }
        private void bgwInternalizaPedidos_DoWork(object sender, DoWorkEventArgs e)
        {
            AgileE agilee = new AgileE();

            while (true)
            {
                var listPedidos = Geral.agileapi.PedidosPendentes();

                foreach (var pedido in listPedidos)
                {
                    if (pedido.products != null)
                    {
                        agilee.setPedido(pedido);
                    }
                }

                System.Threading.Thread.Sleep(10000);
            }
        }
Example #5
0
        private void frmClientes_Load(object sender, EventArgs e)
        {
            AgileE agilee = new AgileE();

            gridClientes.DataSource = agilee.getClientes();
        }