示例#1
0
        public void SubmitSingleProductEndItem(ItemFeed itemFeed, string submittedBy)
        {
            try
            {
                if (string.IsNullOrEmpty(itemFeed.ItemId))
                {
                    _logger.LogInfo(LogEntryType.eBayEndListing, string.Format("Unable to send END_ITEM feed for \'{0}\' since it doesn't have ItemId. \nRequested by: {1}", itemFeed.EisSKU, submittedBy));
                    return;
                }

                // create the end item request
                var endItemCall = new EndItemCall(_context);
                endItemCall.EndItem(itemFeed.ItemId, EndReasonCodeType.NotAvailable);

                // let's set the eBay product ItemId to null
                _logger.SeteBayItemIdToNull(new List <ItemFeed> {
                    itemFeed
                });

                _logger.LogInfo(LogEntryType.eBayEndListing, string.Format("Successfully posted single END_ITEM feed for {0} - {1} item. \nRequested by: {2} \nAPI Message: {3}",
                                                                           ChannelName, itemFeed.EisSKU, submittedBy, endItemCall.ApiResponse.Message));
            }
            catch (Exception ex)
            {
                var description = string.Format("Error in submitting END_ITEM feed for {0}. \nError Message: {2} \nRequested by: {3}",
                                                itemFeed.EisSKU,
                                                EisHelper.GetExceptionMessage(ex),
                                                submittedBy);
                _logger.LogError(LogEntryType.eBayEndListing, description, ex.StackTrace);
            }
        }
        private ItemFeed GetMarketplaceEndItemProduct(string crendentialType, string eisSku)
        {
            var marketplaceEndItem = new ItemFeed();

            switch (crendentialType)
            {
            case MarketPlaceTypes.Values.Amazon:

                var productInfoAmazon = _productService.GetProductAmazon(eisSku);

                if (productInfoAmazon == null)
                {
                    break;
                }
                marketplaceEndItem.EisSKU = productInfoAmazon.EisSKU;
                marketplaceEndItem.ItemId = productInfoAmazon.ASIN;

                break;

            case MarketPlaceTypes.Values.BigCommerce:

                var productInfoBigCommerce = _productService.GetProductBigCommerce(eisSku);

                if (productInfoBigCommerce == null)
                {
                    break;
                }
                marketplaceEndItem.EisSKU = productInfoBigCommerce.EisSKU;
                marketplaceEndItem.ItemId = productInfoBigCommerce.ProductId.ToString();

                break;

            case MarketPlaceTypes.Values.eBay:

                var productInfoeBay = _productService.GetProducteBay(eisSku);

                if (productInfoeBay == null)
                {
                    break;
                }
                marketplaceEndItem.EisSKU = productInfoeBay.EisSKU;
                marketplaceEndItem.ItemId = productInfoeBay.ItemId;

                break;

            default:
                marketplaceEndItem = null;
                break;
            }

            return(marketplaceEndItem);
        }
示例#3
0
        public void Should_Delete_Single_BigCommerce_Product()
        {
            // Arrange
            var bcInventoryprovider = new BigCommerceMarketplaceInventoryProvider();

            bcInventoryprovider.Credential = _credential;
            var marketPlaceEndItemFeed = new ItemFeed();

            // Act
            marketPlaceEndItemFeed.EisSKU = "";
            marketPlaceEndItemFeed.ItemId = "";

            bcInventoryprovider.SubmitSingleProductEndItem(marketPlaceEndItemFeed, "UnitTest");


            // Assert
        }
        public async Task SubmiteBayEndItemFeedBySkuAsync(string crendentialType, string eisSku, string userName)
        {
            // get the product to to post it's inventory
            var productInfo = _productService.GetProducteBay(eisSku);

            if (productInfo == null)
            {
                return; // exit
            }
            var itemFeed = new ItemFeed
            {
                EisSKU = productInfo.EisSKU,
                ItemId = productInfo.ItemId
            };

            // get the marketplace
            var markeplaceProvider = _marketInventoryProviders.FirstOrDefault(x => x.ChannelName == crendentialType);

            // set the credential and submit the feed
            markeplaceProvider.Credential = _credentialService.GetCredential(crendentialType, _marketplaceMode);
            markeplaceProvider.SubmitSingleProductEndItem(itemFeed, userName);
        }
示例#5
0
 public void SubmitSingleProductEndItem(ItemFeed itemFeed, string submittedBy)
 {
     return;
 }
示例#6
0
 public void OnFeedLoaded()
 {
     RssFeedList = ItemFeed.Select(x => new CodeProjectRssItemViewModel(x /*, gotoPageAction*/)).ToList();
 }