private void UpdateSiteQuantity(KCDataExchangeMaint masterGraph, KCMSMQInventoryQuantity quantityProduct, KCInventoryItemAPIHelper helper)
        {
            InventoryItem inventoryItem = masterGraph.ProductByInvCd.Select(quantityProduct.InventoryID.Trim());

            if (inventoryItem != null)
            {
                KNSIKCInventoryItem kcProduct = masterGraph.KCInventoryItem.SelectSingle(inventoryItem.InventoryID);
                if (kcProduct.UsrKCCAID != null)
                {
                    logger.SetParentAndEntityIds(null, inventoryItem.InventoryCD);

                    try
                    {
                        APIQuantityValue apiQuantity = new APIQuantityValue
                        {
                            Value = new APIUpdates()
                            {
                                UpdateType = "InStock",
                                Updates    = quantityProduct.Updates
                            }
                        };

                        helper.UpdateQuantity(apiQuantity, kcProduct.UsrKCCAID);

                        logger.Information(KCMessages.MSMQSyncAPI);
                    }
                    catch (Exception e)
                    {
                        logger.Information(e.Message);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public IRestRequest UpdateQuantityRequest(APIQuantityValue quantity, int?productId)
        {
            IRestRequest request = CreateRestRequest("/v1/Products({id})/UpdateQuantity");

            request.AddUrlSegment("id", productId.ToString());
            AddBody(request, quantity);

            return(request);
        }
Exemplo n.º 3
0
 public void UpdateQuantity(APIQuantityValue qty, int?productId)
 {
     client.Post <KCAPIResponse>(request.UpdateQuantityRequest(qty, productId));
 }