public void ProcessCancellation(WalmartApi api) { var actionService = new SystemActionService(_log, _time); var updater = new WalmartOrderCancellation(api, actionService, _log, _time); using (var db = _dbFactory.GetRWDb()) { updater.ProcessCancellations(db); } }
public void CallProcessCancellations() { using (var db = _dbFactory.GetRWDb()) { var actionService = new SystemActionService(_log, _time); var service = new WalmartOrderCancellation(_walmartCAApi, actionService, _log, _time); service.ProcessCancellations(db); } }
protected override void RunCallback() { var dbFactory = new DbFactory(); var time = new TimeService(dbFactory); var settings = new SettingsService(dbFactory); var actionService = new SystemActionService(GetLogger(), time); var lastSyncDate = settings.GetOrdersCancellationDate(_api.Market, _api.MarketplaceId); using (var db = dbFactory.GetRWDb()) { LogWrite("Last sync date=" + lastSyncDate); if (!lastSyncDate.HasValue || (time.GetUtcTime() - lastSyncDate) > _betweenProcessingInverval) { var updater = new WalmartOrderCancellation(_api, actionService, GetLogger(), time); updater.ProcessCancellations(db); settings.SetOrdersCancellationtDate(time.GetUtcTime(), _api.Market, _api.MarketplaceId); } } }