Example #1
0
        //public static void UploadPendingChanges()
        //{
        //    if (!WebApiClient.IsAvailableConnection) return;

        //    //TransferRequestHelper.GetPendingToSyncOrders()
        //    //.ForEach(transfer=> SyncUpload(transfer));

        //    //PurchaseHelper.GetPendingToSyncPurchases()
        //    //.ForEach(purchase=> purchase.Upload(SyncUpload,true));

        //    //var sales = SalesHelper.GetPendingToSyncSales();
        //    //sales.ForEach(sale=> SyncUpload(sale));

        //    //var notes = SupplierCreditNoteHelper.GetPendingtoSyncNotes();
        //    //notes.ForEach(note => SyncUpload(note));

        //    //var receipts = GoodsReceiptHelper.GetPendingToSync();
        //    //receipts.ForEach(receipt=> SyncUpload(receipt));

        //    //var goodIssues = GoodIssuesHelper.GetPendingToSync();
        //    //goodIssues.ForEach(issue=> SyncUpload(issue));

        //    //var downPayments = DownPaymentHelper.GetPendingToSync();
        //    //downPayments.ForEach(dp=> SyncUpload(dp));

        //    //var inventoryCount = InventoryCountHelper.GetOpenInventoryCountForToday();

        //    //inventoryCount.ForEach(InventoryCountHelper.Process);
        //}

        private static OWTQ_TransferRequest SyncUpload(OWTQ_TransferRequest transferRequest)

        {
            var transfer = WebApiClient.AddTransfer(transferRequest).Result;

            transferRequest.UpdateModelPropertiesFrom(transfer.Model);
            transferRequest.StateL = LocalStatus.Procesado;
            transfer.UpdateEntityVersion();
            return(transferRequest);
        }