public static void ProcessStore(KCStore store, CancellationToken token) { KCBulkProductMaint graph = CreateInstance <KCBulkProductMaint>(); KCBulkUploader bulkUploader = new KCBulkUploader(graph, logger.LoggerProperties, token); KCBulkProductSyncConfig config = new KCBulkProductSyncConfig { SyncType = store.SyncType ?? KCBulkProductSyncTypesConstants.Delta, DateFrom = store.DateFrom, DateTo = store.DateTo }; bulkUploader.SetStrategy(config); bulkUploader.ExportProducts(store); }
private void Export(KCDataExchangeMaint graph, List <KeyValuePair <string, InventoryItem> > products, CancellationToken cancellationToken, Dictionary <string, KCAPIInventoryItem> MSMQPrices = null, Dictionary <string, List <KCAPIQuantity> > MSMQQuantityUpdates = null) { KCBulkProductMaint bulkGraph = PXGraph.CreateInstance <KCBulkProductMaint>(); KCSiteMaster connection = graph.Connection.SelectSingle(); KCARestClient client = new KCARestClient(connection); KCBulkUploader bulkUploader = new KCBulkUploader(bulkGraph, logger.LoggerProperties, cancellationToken) { ApiHelper = new KCInventoryItemAPIHelper(client, logger.LoggerProperties), _strategy = new KCFullSync(bulkGraph) }; List <KCBulkProduct> dtos = bulkUploader.HandleItems(products, MSMQPrices, MSMQQuantityUpdates); if (dtos.Count > 0) { string bulkFile = bulkUploader.PrepareItemBulkFile(dtos); string productFilePath = bulkUploader.GenerateProductUploadPath(connection); bulkUploader.UploadFileToFTP(connection, bulkFile, productFilePath); } }