예제 #1
0
        public void ProcessAddCommentSystemActions()
        {
            var commentService = new OrderCommentService(_dbFactory,
                                                         _log,
                                                         _time,
                                                         _actionService);

            commentService.ProcessSystemAction();
        }
예제 #2
0
        protected override void RunCallback()
        {
            var        dbFactory = new DbFactory();
            var        time      = new TimeService(dbFactory);
            var        log       = GetLogger();
            CompanyDTO company;

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

            var weightService  = new WeightService();
            var messageService = new SystemMessageService(log, time, dbFactory);

            var serviceFactory  = new ServiceFactory();
            var quantityManager = new QuantityManager(log, time);
            var rateProviders   = serviceFactory.GetShipmentProviders(log,
                                                                      time,
                                                                      dbFactory,
                                                                      weightService,
                                                                      company.ShipmentProviderInfoList,
                                                                      null,
                                                                      null,
                                                                      null,
                                                                      null);

            var actionService = new SystemActionService(log, time);

            var commentService = new OrderCommentService(dbFactory,
                                                         log,
                                                         time,
                                                         actionService);

            commentService.ProcessSystemAction();

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

            rateService.ProcessSystemAction(CancellationToken);


            var quantityDistribution = new QuantityDistributionService(dbFactory,
                                                                       quantityManager,
                                                                       log,
                                                                       time,
                                                                       QuantityDistributionHelper.GetDistributionMarkets(),
                                                                       DistributeMode.None);

            quantityDistribution.ProcessSystemAction(actionService);
        }