Example #1
0
 public RuleController(
     IRuleFactory ruleFactory,
     IRuleStorage ruleStorage,
     IRuleTemplateSelector ruleTemplateSelector,
     Func <RuleScope, IRuleProvider> ruleProvider,
     IEnumerable <IRuleOptionsProvider> ruleOptionsProviders,
     Lazy <IPaymentService> paymentService,
     Lazy <PluginMediator> pluginMediator,
     Lazy <IMediaService> mediaService,
     AdminAreaSettings adminAreaSettings,
     Lazy <CustomerSettings> customerSettings,
     Lazy <MediaSettings> mediaSettings)
 {
     _ruleFactory          = ruleFactory;
     _ruleStorage          = ruleStorage;
     _ruleTemplateSelector = ruleTemplateSelector;
     _ruleProvider         = ruleProvider;
     _ruleOptionsProviders = ruleOptionsProviders;
     _paymentService       = paymentService;
     _pluginMediator       = pluginMediator;
     _mediaService         = mediaService;
     _adminAreaSettings    = adminAreaSettings;
     _customerSettings     = customerSettings;
     _mediaSettings        = mediaSettings;
 }
        public EditRuleViewModel(IRuleStorage ruleStorage, IProvinceService provinceService, IMunicipalityService municipalityService)
        {
            _ruleStorage         = ruleStorage;
            _provinceService     = provinceService;
            _municipalityService = municipalityService;

            PropertyChanged += EditRuleViewModel_PropertyChanged;
        }
        public EditRuleViewModel(IRuleStorage ruleStorage, IProvinceService provinceService, IMunicipalityService municipalityService)
        {
            _ruleStorage = ruleStorage;
            _provinceService = provinceService;
            _municipalityService = municipalityService;

            PropertyChanged += EditRuleViewModel_PropertyChanged;
        }
Example #4
0
        public RulesViewModel(IRuleStorage ruleStorage, INotificationCenter notificationCenter)
        {
            _ruleStorage = ruleStorage;

            Title = "Regler";

            Device.BeginInvokeOnMainThread(RefreshRules);

            notificationCenter.Subscribe <User>(this, NotificationKeys.CurrentUserChanged, u =>
            {
                Device.BeginInvokeOnMainThread(RefreshRules);
            });
        }
Example #5
0
        public RulesViewModel(IRuleStorage ruleStorage, INotificationCenter notificationCenter)
        {
            _ruleStorage = ruleStorage;

            Title = "Regler";

            Device.BeginInvokeOnMainThread(RefreshRules);

            notificationCenter.Subscribe<User>(this, NotificationKeys.CurrentUserChanged, u =>
            {
                Device.BeginInvokeOnMainThread(RefreshRules);
            });
        }
Example #6
0
 public CustomerRoleController(
     ICustomerService customerService,
     ICustomerActivityService customerActivityService,
     IRuleStorage ruleStorage,
     Lazy <ITaskScheduler> taskScheduler,
     Lazy <IScheduleTaskService> scheduleTaskService,
     CustomerSettings customerSettings,
     AdminAreaSettings adminAreaSettings)
 {
     _customerService         = customerService;
     _customerActivityService = customerActivityService;
     _ruleStorage             = ruleStorage;
     _taskScheduler           = taskScheduler;
     _scheduleTaskService     = scheduleTaskService;
     _customerSettings        = customerSettings;
     _adminAreaSettings       = adminAreaSettings;
 }
Example #7
0
 public PaymentController(
     IPaymentService paymentService,
     PaymentSettings paymentSettings,
     PluginMediator pluginMediator,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService,
     IStoreMappingService storeMappingService,
     IRuleStorage ruleStorage)
 {
     _paymentService         = paymentService;
     _paymentSettings        = paymentSettings;
     _pluginMediator         = pluginMediator;
     _languageService        = languageService;
     _localizedEntityService = localizedEntityService;
     _storeMappingService    = storeMappingService;
     _ruleStorage            = ruleStorage;
 }
 public ShippingController(
     IShippingService shippingService,
     ShippingSettings shippingSettings,
     ILocalizedEntityService localizedEntityService,
     ILanguageService languageService,
     PluginMediator pluginMediator,
     IStoreMappingService storeMappingService,
     IRuleStorage ruleStorage)
 {
     _shippingService        = shippingService;
     _shippingSettings       = shippingSettings;
     _localizedEntityService = localizedEntityService;
     _languageService        = languageService;
     _pluginMediator         = pluginMediator;
     _storeMappingService    = storeMappingService;
     _ruleStorage            = ruleStorage;
 }
 public RuleController(
     IRuleFactory ruleFactory,
     IRuleStorage ruleStorage,
     ITargetGroupService targetGroupService,
     IRuleTemplateSelector ruleTemplateSelector,
     Func <RuleScope, IRuleProvider> ruleProvider,
     IEnumerable <IRuleOptionsProvider> ruleOptionsProviders,
     AdminAreaSettings adminAreaSettings)
 {
     _ruleFactory          = ruleFactory;
     _ruleStorage          = ruleStorage;
     _targetGroupService   = targetGroupService;
     _ruleTemplateSelector = ruleTemplateSelector;
     _ruleProvider         = ruleProvider;
     _ruleOptionsProviders = ruleOptionsProviders;
     _adminAreaSettings    = adminAreaSettings;
 }
 public CategoryController(
     ICategoryService categoryService,
     ICategoryTemplateService categoryTemplateService,
     IProductService productService,
     IUrlRecordService urlRecordService,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     IDiscountService discountService,
     IAclService aclService,
     IStoreService storeService,
     IStoreMappingService storeMappingService,
     IWorkContext workContext,
     ICustomerActivityService customerActivityService,
     IRuleStorage ruleStorage,
     IDateTimeHelper dateTimeHelper,
     AdminAreaSettings adminAreaSettings,
     CatalogSettings catalogSettings,
     IEventPublisher eventPublisher,
     Lazy <IGenericAttributeService> genericAttributeService,
     Lazy <ITaskScheduler> taskScheduler,
     Lazy <IScheduleTaskService> scheduleTaskService)
 {
     _categoryService         = categoryService;
     _categoryTemplateService = categoryTemplateService;
     _productService          = productService;
     _urlRecordService        = urlRecordService;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _localizedEntityService  = localizedEntityService;
     _discountService         = discountService;
     _aclService              = aclService;
     _storeService            = storeService;
     _storeMappingService     = storeMappingService;
     _workContext             = workContext;
     _customerActivityService = customerActivityService;
     _ruleStorage             = ruleStorage;
     _dateTimeHelper          = dateTimeHelper;
     _adminAreaSettings       = adminAreaSettings;
     _catalogSettings         = catalogSettings;
     _eventPublisher          = eventPublisher;
     _genericAttributeService = genericAttributeService;
     _taskScheduler           = taskScheduler;
     _scheduleTaskService     = scheduleTaskService;
 }
 public DiscountController(
     IDiscountService discountService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductService productService,
     IDateTimeHelper dateTimeHelper,
     ICustomerActivityService customerActivityService,
     IRuleStorage ruleStorage,
     IPriceFormatter priceFormatter,
     AdminAreaSettings adminAreaSettings)
 {
     _discountService         = discountService;
     _categoryService         = categoryService;
     _manufacturerService     = manufacturerService;
     _productService          = productService;
     _dateTimeHelper          = dateTimeHelper;
     _customerActivityService = customerActivityService;
     _ruleStorage             = ruleStorage;
     _priceFormatter          = priceFormatter;
     _adminAreaSettings       = adminAreaSettings;
 }
        /// <summary>
        /// Starts the engine. Reads <see cref="AnalyzeRule"/>s from storage and builds a collection of <see cref="ProgramAnalyzer"/>s to hold them.
        /// </summary>
        /// <param name="ruleStorage">The <see cref="AnalyzeRule"/> storage.</param>
        /// <param name="alarmMessageManager">The alarm manager.</param>
        public void StartEngine(IRuleStorage ruleStorage, AlarmMessageManager alarmMessageManager)
        {
            AddMessage($"Starting {nameof(AnalyzerEngine)} {Guid.NewGuid()}");
            RuleStorage         = ruleStorage;
            AlarmMessageManager = alarmMessageManager;
            Analyzers.Clear();
            var allRules = RuleStorage.GetAllRules();

            if (allRules.Count == 0)
            {
                AddMessage("Starting with no rules.");
            }
            else
            {
                AddRulesToAnalyzer(allRules);
            }
            foreach (var analyzer in Analyzers)
            {
                analyzer.Value.StartAnalyzer();
            }
            StartEngine();
        }
Example #13
0
 public RuleFactory(IRuleStorage storage)
 {
     _storage = storage;
 }