Beispiel #1
0
        public IArticle RefreshOrCreateEbayArticle(IArticle article, EbayArticleCSVWriter cswWriter, double amount, string template)
        {
            IArticle newArticle = null;
            currentAmount = amount;

            var availabilityMap = GetAvailabilityMap(article);

            foreach (var availabilityPair in availabilityMap)
            {
                if (article.EbayIds.ContainsKey(availabilityPair.Key))
                {
                    newArticle = ReviseEbayArticle(article, availabilityPair);
                    continue;
                }
                if (availabilityPair.Value == 0)
                {
                    continue;
                }
                newArticle = LoadUpNewSingleArticle(article, template, availabilityPair);
            }

            cswWriter.WriteToCSVFile(newArticle);
            return newArticle;
        }
 private static void WriteAllArticlesBackToCSV(List<IArticle> articles)
 {
     var ebayArticleCsvWriter = new EbayArticleCSVWriter(baseFileName);
     ebayArticleCsvWriter.WriteToCSVFile(articles);
 }