コード例 #1
0
 public void CallUpdateFulfillmentData(IMarketOrderUpdaterApi api, IList <string> orderNumbers)
 {
     using (var db = _dbFactory.GetRWDb())
     {
         var service = new BaseOrderUpdater(api, _log, _time);
         service.UpdateOrders(db, orderNumbers);
     }
 }
コード例 #2
0
        public void UpdateOrders(GrouponApi api)
        {
            var updater = new BaseOrderUpdater(api, _log, _time);

            using (var db = _dbFactory.GetRWDb())
            {
                updater.UpdateOrders(db);
            }
        }
コード例 #3
0
        public void SendOrdersUpdate(SupplieroasisApi api)
        {
            var updater = new BaseOrderUpdater(api, _log, _time);

            using (var db = _dbFactory.GetRWDb())
            {
                updater.UpdateOrders(db);
            }
        }
コード例 #4
0
 public void CallUpdateFulfillmentData(IMarketOrderUpdaterApi api, string orderString)
 {
     using (var db = _dbFactory.GetRWDb())
     {
         var service = new BaseOrderUpdater(api, _log, _time);
         service.UpdateOrders(db, !String.IsNullOrEmpty(orderString) ? new List <string>()
         {
             orderString
         } : null);
     }
 }
コード例 #5
0
        protected override void RunCallback()
        {
            _api.Connect();

            var dbFactory = new DbFactory();
            var time      = new TimeService(dbFactory);
            var settings  = new SettingsService(dbFactory);

            using (var db = dbFactory.GetRWDb())
            {
                var lastSyncDate = settings.GetOrdersFulfillmentDate(_api.Market, _api.MarketplaceId);

                LogWrite("Last sync date=" + lastSyncDate);

                if (!lastSyncDate.HasValue ||
                    (time.GetUtcTime() - lastSyncDate) > _betweenProcessingInverval)
                {
                    var updater = new BaseOrderUpdater(_api, GetLogger(), time);
                    updater.UpdateOrders(db);
                    settings.SetOrdersFulfillmentDate(time.GetUtcTime(), _api.Market, _api.MarketplaceId);
                }
            }
        }