예제 #1
0
        public void GetItemsReport(WalmartApi api)
        {
            var reportPath = api.GetItemsReport(AppSettings.WalmartReportBaseDirectory);
            var report     = new WalmartReport(reportPath);
            var items      = report.GetItems();

            _log.Info("Items count: " + items.Count);
            _log.Info("Report: " + reportPath);
        }
예제 #2
0
        public void GetApsentItemsFromReport(WalmartApi api)
        {
            var reportPath = api.GetItemsReport(AppSettings.WalmartReportBaseDirectory);
            var report     = new WalmartReport(reportPath);
            var items      = report.GetItems();

            _log.Info("Items count: " + items.Count);
            _log.Info("Report: " + reportPath);

            using (var db = _dbFactory.GetRWDb())
            {
                var existListings = db.Listings.GetAll().Where(l => l.Market == (int)MarketType.Walmart).ToList();
                foreach (var item in items)
                {
                    var existListing = existListings.FirstOrDefault(l => l.SKU == item.SKU);
                    if (existListing == null)
                    {
                        _log.Info("SKU=" + item.SKU + ", Qty=" + item.AmazonRealQuantity);
                    }
                }
            }
        }