private void EnsureAllArticlesExists(IEnumerable <TransferItemLine> lines, ArticleManager articleManager) { foreach (var line in lines) { if (string.IsNullOrWhiteSpace(line.ArticleNo) || articleManager.ArticleExists(line.ArticleNo)) { continue; } _attemptsToCreateArticle++; if (!articleManager.CreateArticle(line.ArticleNo, line.ArticleName, _priceCalcMethodsNo, _postingTemplate, _stockProfileNo)) { _failedAttemptsToCreateArticle++; lstLog.Items.Add(string.Format("Kunne ikke opprette artikkel '{0} - {1}'", line.ArticleNo, line.ArticleName)); } } }