protected override void RunCallback()
        {
            CompanyDTO company        = null;
            var        dbFactory      = new DbFactory();
            var        time           = new TimeService(dbFactory);
            var        log            = GetLogger();
            var        weightService  = new WeightService();
            var        messageService = new SystemMessageService(log, time, dbFactory);
            var        serviceFactory = new ServiceFactory();

            using (var db = dbFactory.GetRDb())
            {
                company = db.Companies.GetByIdWithSettingsAsDto(CompanyId);
            }

            var actionService = new SystemActionService(log, time);
            var rateProviders = serviceFactory.GetShipmentProviders(log,
                                                                    time,
                                                                    dbFactory,
                                                                    weightService,
                                                                    company.ShipmentProviderInfoList,
                                                                    null,
                                                                    null,
                                                                    null,
                                                                    null);


            //var addressService = new AddressService(null, company.GetReturnAddressDto(), company.GetPickupAddressDto());
            //Checking email service, sent test message
            //var emailSmtpSettings = SettingsBuilder.GetSmtpSettingsFromCompany(company, AppSettings.IsDebug, AppSettings.IsSampleLabels);
            //var emailService = new EmailService(GetLogger(), emailSmtpSettings, addressService);

            var rateService = new RateService(dbFactory,
                                              log,
                                              time,
                                              weightService,
                                              messageService,
                                              company,
                                              actionService,
                                              rateProviders);

            rateService.RefreshAmazonRates();
            rateService.RefreshSuspiciousFedexRates();
        }
Exemplo n.º 2
0
 public void RefreshSuspiciousFedexRates()
 {
     _rateService.RefreshSuspiciousFedexRates();
 }