public DiscountController(IDiscountService discountService, 
     ILocalizationService localizationService,
     ICurrencyService currencyService,
     ICategoryService categoryService,
     IProductService productService,
     IWebHelper webHelper, 
     IDateTimeHelper dateTimeHelper,
     ICustomerActivityService customerActivityService, 
     CurrencySettings currencySettings,
     IPermissionService permissionService,
     IWorkContext workContext,
     IManufacturerService manufacturerService,
     IStoreService storeService,
     IVendorService vendorService,
     IOrderService orderService,
     IPriceFormatter priceFormatter)
 {
     this._discountService = discountService;
     this._localizationService = localizationService;
     this._currencyService = currencyService;
     this._categoryService = categoryService;
     this._productService = productService;
     this._webHelper = webHelper;
     this._dateTimeHelper = dateTimeHelper;
     this._customerActivityService = customerActivityService;
     this._currencySettings = currencySettings;
     this._permissionService = permissionService;
     this._workContext = workContext;
     this._manufacturerService = manufacturerService;
     this._storeService = storeService;
     this._vendorService = vendorService;
     this._orderService = orderService;
     this._priceFormatter = priceFormatter;
 }
 public CheckoutAttributeController(ICheckoutAttributeService checkoutAttributeService,
     ILanguageService languageService, 
     ILocalizedEntityService localizedEntityService,
     ILocalizationService localizationService,
     ITaxCategoryService taxCategoryService,
     IWorkContext workContext, 
     ICurrencyService currencyService, 
     ICustomerActivityService customerActivityService, 
     CurrencySettings currencySettings,
     IMeasureService measureService, 
     MeasureSettings measureSettings,
     IPermissionService permissionService,
     IStoreService storeService,
     IStoreMappingService storeMappingService)
 {
     this._checkoutAttributeService = checkoutAttributeService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._localizationService = localizationService;
     this._taxCategoryService = taxCategoryService;
     this._workContext = workContext;
     this._currencyService = currencyService;
     this._customerActivityService = customerActivityService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._permissionService = permissionService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
 }
Example #3
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="sciRepository">Shopping cart repository</param>
 /// <param name="workContext">Work context</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="productService">Product settings</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="checkoutAttributeService">Checkout attribute service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="eventPublisher">Event publisher</param>
 /// <param name="permissionService">Permission service</param>
 /// <param name="aclService">ACL service</param>
 public ShoppingCartService(IRepository<ShoppingCartItem> sciRepository,
     IWorkContext workContext, ICurrencyService currencyService,
     IProductService productService, ILocalizationService localizationService,
     IProductAttributeParser productAttributeParser,
     ICheckoutAttributeService checkoutAttributeService,
     ICheckoutAttributeParser checkoutAttributeParser,
     IPriceFormatter priceFormatter,
     ICustomerService customerService,
     ShoppingCartSettings shoppingCartSettings,
     IEventPublisher eventPublisher,
     IPermissionService permissionService, 
     IAclService aclService)
 {
     this._sciRepository = sciRepository;
     this._workContext = workContext;
     this._currencyService = currencyService;
     this._productService = productService;
     this._localizationService = localizationService;
     this._productAttributeParser = productAttributeParser;
     this._checkoutAttributeService = checkoutAttributeService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._priceFormatter = priceFormatter;
     this._customerService = customerService;
     this._shoppingCartSettings = shoppingCartSettings;
     this._eventPublisher = eventPublisher;
     this._permissionService = permissionService;
     this._aclService = aclService;
 }
 public MobSocialMessageService(IMessageTemplateService messageTemplateService,
                                    IStoreService storeService, IMessageTokenProvider messageTokenProvider,
                                    ILanguageService languageService,
                                    IStoreContext storeContext,
                                    IEventPublisher eventPublisher,
                                    ITokenizer tokenizer, IQueuedEmailService queuedEmailService,
                                    IEmailAccountService emailAccountService,
                                    EmailAccountSettings emailAccountSettings,
                                    ILocalizationService localizationService,
                                    MessageTemplatesSettings messageTemplateSettings,
                                    CatalogSettings catalogSettings,
                                    IProductAttributeParser productAttributeParser, IWorkContext workContext)
 {
     _messageTemplateService = messageTemplateService;
     _storeService = storeService;
     _messageTokenProvider = messageTokenProvider;
     _languageService = languageService;
     _storeContext = storeContext;
     _eventPublisher = eventPublisher;
     _tokenizer = tokenizer;
     _queuedEmailService = queuedEmailService;
     _emailAccountService = emailAccountService;
     _emailAccountSettings = emailAccountSettings;
     _localizationService = localizationService;
     _messageTemplateSettings = messageTemplateSettings;
     _catalogSettings = catalogSettings;
     _productAttributeParser = productAttributeParser;
     _workContext = workContext;
 }
 public ShippingController(IShippingService shippingService, 
     ShippingSettings shippingSettings,
     ISettingService settingService,
     IAddressService addressService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     ILocalizationService localizationService, 
     IPermissionService permissionService,
      ILocalizedEntityService localizedEntityService,
     ILanguageService languageService,
     IPluginFinder pluginFinder,
     IWebHelper webHelper)
 {
     this._shippingService = shippingService;
     this._shippingSettings = shippingSettings;
     this._settingService = settingService;
     this._addressService = addressService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._localizedEntityService = localizedEntityService;
     this._languageService = languageService;
     this._pluginFinder = pluginFinder;
     this._webHelper = webHelper;
 }
 public AuthenticationController(
     OwinEnvironmentService owin,
     IViewService viewService, 
     IUserService userService, 
     IdentityServerOptions idSvrOptions, 
     IClientStore clientStore, 
     IEventService eventService,
     ILocalizationService localizationService,
     SessionCookie sessionCookie, 
     MessageCookie<SignInMessage> signInMessageCookie,
     MessageCookie<SignOutMessage> signOutMessageCookie,
     LastUserNameCookie lastUsernameCookie,
     AntiForgeryToken antiForgeryToken)
 {
     this.context = new OwinContext(owin.Environment);
     this.viewService = viewService;
     this.userService = userService;
     this.options = idSvrOptions;
     this.clientStore = clientStore;
     this.eventService = eventService;
     this.localizationService = localizationService;
     this.sessionCookie = sessionCookie;
     this.signInMessageCookie = signInMessageCookie;
     this.signOutMessageCookie = signOutMessageCookie;
     this.lastUsernameCookie = lastUsernameCookie;
     this.antiForgeryToken = antiForgeryToken;
 }
Example #7
0
        public BlogController(IBlogService blogService, 
            IWorkContext workContext,
            IStoreContext storeContext,
            IPictureService pictureService, 
            ILocalizationService localizationService,
            IDateTimeHelper dateTimeHelper,
            IWorkflowMessageService workflowMessageService, 
            IWebHelper webHelper,
            ICacheManager cacheManager, 
            ICustomerActivityService customerActivityService,
            IStoreMappingService storeMappingService,
            MediaSettings mediaSettings,
            BlogSettings blogSettings,
            LocalizationSettings localizationSettings, 
            CustomerSettings customerSettings,
            CaptchaSettings captchaSettings)
        {
            this._blogService = blogService;
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._dateTimeHelper = dateTimeHelper;
            this._workflowMessageService = workflowMessageService;
            this._webHelper = webHelper;
            this._cacheManager = cacheManager;
            this._customerActivityService = customerActivityService;
            this._storeMappingService = storeMappingService;

            this._mediaSettings = mediaSettings;
            this._blogSettings = blogSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings = customerSettings;
            this._captchaSettings = captchaSettings;
        }
 protected ViewComponentLocalization(ILocalizationService localizationService, string resourceLocation, string resourceName, CultureInfo culture)
 {
     this.localizationService = localizationService;
     this.resourceLocation = string.IsNullOrEmpty(resourceLocation) ? "~/App_GlobalResources" : resourceLocation;
     this.resourceName = resourceName;
     this.culture = culture ?? CultureInfo.CurrentUICulture;
 }
 public PaymentPayPalStandardController(IWorkContext workContext,
     IStoreService storeService, 
     ISettingService settingService, 
     IPaymentService paymentService, 
     IOrderService orderService, 
     IOrderProcessingService orderProcessingService,
     ILocalizationService localizationService,
     IStoreContext storeContext,
     ILogger logger, 
     IWebHelper webHelper,
     PaymentSettings paymentSettings,
     PayPalStandardPaymentSettings payPalStandardPaymentSettings)
 {
     this._workContext = workContext;
     this._storeService = storeService;
     this._settingService = settingService;
     this._paymentService = paymentService;
     this._orderService = orderService;
     this._orderProcessingService = orderProcessingService;
     this._localizationService = localizationService;
     this._storeContext = storeContext;
     this._logger = logger;
     this._webHelper = webHelper;
     this._paymentSettings = paymentSettings;
     this._payPalStandardPaymentSettings = payPalStandardPaymentSettings;
 }
        public PayPalExpressController(
			IPaymentService paymentService, IOrderService orderService,
			IOrderProcessingService orderProcessingService,
			ILogger logger, 
			PaymentSettings paymentSettings, ILocalizationService localizationService,
			OrderSettings orderSettings,
			ICurrencyService currencyService, CurrencySettings currencySettings,
			IOrderTotalCalculationService orderTotalCalculationService, ICustomerService customerService,
			IGenericAttributeService genericAttributeService,
            IComponentContext ctx, ICommonServices services,
            IStoreService storeService)
        {
            _paymentService = paymentService;
            _orderService = orderService;
            _orderProcessingService = orderProcessingService;
            _logger = logger;
            _paymentSettings = paymentSettings;
            _localizationService = localizationService;
            _orderSettings = orderSettings;
            _currencyService = currencyService;
            _currencySettings = currencySettings;
            _orderTotalCalculationService = orderTotalCalculationService;
            _customerService = customerService;
            _genericAttributeService = genericAttributeService;
            _services = services;
            _storeService = storeService;

            _helper = new PluginHelper(ctx, "SmartStore.PayPal", "Plugins.Payments.PayPalExpress");

            T = NullLocalizer.Instance;
        }
        public PluginController(IPluginFinder pluginFinder,
            IOfficialFeedManager officialFeedManager,
            ILocalizationService localizationService,
            IWebHelper webHelper,
            IPermissionService permissionService, 
            ILanguageService languageService,
            ISettingService settingService, 
            IStoreService storeService,
            PaymentSettings paymentSettings,
            ShippingSettings shippingSettings,
            TaxSettings taxSettings, 
            ExternalAuthenticationSettings externalAuthenticationSettings, 
            WidgetSettings widgetSettings)
		{
            this._pluginFinder = pluginFinder;
            this._officialFeedManager = officialFeedManager;
            this._localizationService = localizationService;
            this._webHelper = webHelper;
            this._permissionService = permissionService;
            this._languageService = languageService;
            this._settingService = settingService;
            this._storeService = storeService;
            this._paymentSettings = paymentSettings;
            this._shippingSettings = shippingSettings;
            this._taxSettings = taxSettings;
            this._externalAuthenticationSettings = externalAuthenticationSettings;
            this._widgetSettings = widgetSettings;
		}
 public MiscFacebookShopController(IAclService aclService,
     ICacheManager cacheManager,
     CatalogSettings catalogSettings,
     ICategoryService categoryService,
     ICurrencyService currencyService,
     ILocalizationService localizationService,
     IPermissionService permissionService,
     IPictureService pictureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductService productService,
     IStoreContext storeContext,
     IStoreMappingService storeMappingService,
     ITaxService taxService,
     IWorkContext workContext)
 {
     this._aclService = aclService;
     this._cacheManager = cacheManager;
     this._catalogSettings = catalogSettings;
     this._categoryService = categoryService;
     this._currencyService = currencyService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._pictureService = pictureService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._productService = productService;
     this._storeContext = storeContext;
     this._storeMappingService = storeMappingService;
     this._taxService = taxService;
     this._workContext = workContext;
 }
        public ReturnRequestController(IOrderService orderService, 
            IWorkContext workContext, 
            IStoreContext storeContext,
            ICurrencyService currencyService, 
            IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService,
            ILocalizationService localizationService,
            ICustomerService customerService,
            IWorkflowMessageService workflowMessageService,
            IDateTimeHelper dateTimeHelper,
            LocalizationSettings localizationSettings,
            OrderSettings orderSettings)
        {
            this._orderService = orderService;
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._localizationService = localizationService;
            this._customerService = customerService;
            this._workflowMessageService = workflowMessageService;
            this._dateTimeHelper = dateTimeHelper;

            this._localizationSettings = localizationSettings;
            this._orderSettings = orderSettings;
        }
		public Plugin(
			ISettingService settingService,
			ILocalizationService localizationService)
		{
			_settingService = settingService;
			_localizationService = localizationService;
		}
        public OrderController(IOrderService orderService, 
            IShipmentService shipmentService, IWorkContext workContext,
            ICurrencyService currencyService, IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService, IDateTimeHelper dateTimeHelper,
            IPaymentService paymentService, ILocalizationService localizationService,
            IPdfService pdfService, IShippingService shippingService,
            ICountryService countryService, IProductAttributeParser productAttributeParser,
            IWebHelper webHelper,
            CatalogSettings catalogSettings, OrderSettings orderSettings,
            TaxSettings taxSettings, PdfSettings pdfSettings,
            ShippingSettings shippingSettings, AddressSettings addressSettings)
        {
            this._orderService = orderService;
            this._shipmentService = shipmentService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._paymentService = paymentService;
            this._localizationService = localizationService;
            this._pdfService = pdfService;
            this._shippingService = shippingService;
            this._countryService = countryService;
            this._productAttributeParser = productAttributeParser;
            this._webHelper = webHelper;

            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._taxSettings = taxSettings;
            this._pdfSettings = pdfSettings;
            this._shippingSettings = shippingSettings;
            this._addressSettings = addressSettings;
        }
Example #16
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postService"></param>
 /// <param name="pollVoteService"></param>
 /// <param name="pollAnswerService"></param>
 /// <param name="pollService"></param>
 /// <param name="topicService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMVCForumContext context, ISettingsService settingsService,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostService postService, IPollVoteService pollVoteService, IPollAnswerService pollAnswerService,
     IPollService pollService, ITopicService topicService, IFavouriteService favouriteService, 
     ICategoryService categoryService, IPostEditService postEditService)
 {
     _settingsService = settingsService;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postService = postService;
     _pollVoteService = pollVoteService;
     _pollAnswerService = pollAnswerService;
     _pollService = pollService;
     _topicService = topicService;
     _favouriteService = favouriteService;
     _categoryService = categoryService;
     _postEditService = postEditService;
     _context = context as MVCForumContext;
 }
        public PaymentSagePayServerController(ISettingService settingService, 
            IPaymentService paymentService, IOrderService orderService, 
            IOrderProcessingService orderProcessingService,
            ILogger logger, SagePayServerPaymentSettings sagePayServerPaymentSettings,
            PaymentSettings paymentSettings, ILocalizationService localizationService,
            IWorkContext workContext, ISagePayServerTransactionService sagePayServerTransactionService,
            IOrderTotalCalculationService orderTotalCalculationService, ICurrencyService currencyService, CurrencySettings currencySettings,
            IMobileDeviceHelper mobileDeviceHelper, OrderSettings orderSettings, HttpContextBase httpContext)
        {
            this._settingService = settingService;
            this._paymentService = paymentService;
            this._orderService = orderService;
            this._orderProcessingService = orderProcessingService;
            this._localizationService = localizationService;
            this._sagePayServerTransactionService = sagePayServerTransactionService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._currencyService = currencyService;

            this._sagePayServerPaymentSettings = sagePayServerPaymentSettings;
            this._paymentSettings = paymentSettings;
            this._currencySettings = currencySettings;
            this._orderSettings = orderSettings;

            this._logger = logger;

            this._workContext = workContext;

            this._httpContext = httpContext;

            this._mobileDeviceHelper = mobileDeviceHelper;
        }
Example #18
0
 public StatsController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, 
     ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicService topicService, IPostService postService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicService = topicService;
     _postService = postService;
 }
Example #19
0
 public TagController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicTagService topicTagService, ICategoryService categoryService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicTagService = topicTagService;
     _categoryService = categoryService;
     _cacheService = cacheService;
 }
Example #20
0
 public TopicController(ITopicService topicService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService, 
     ILocalizationService localizationService,
     IPermissionService permissionService, 
     IStoreService storeService,
     IStoreMappingService storeMappingService,
     IUrlRecordService urlRecordService,
     ITopicTemplateService topicTemplateService,
     ICustomerService customerService,
     ICustomerActivityService customerActivityService,
     IAclService aclService)
 {
     this._topicService = topicService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._urlRecordService = urlRecordService;
     this._topicTemplateService = topicTemplateService;
     this._customerService = customerService;
     this._customerActivityService = customerActivityService;
     this._aclService = aclService;
 }
 public DiscountRulesCustomerRolesController(IDiscountService discountService,
     ICustomerService customerService, ILocalizationService localize)
 {
     this._discountService = discountService;
     this._customerService = customerService;
     this._localize = localize;
 }
        public HomeInstallationQuoteController(
            IWorkContext workContext,
            ISettingService settingService,
            IGenericAttributeService genericAttributeService,
            ILocalizationService localizationService,
            IMessageTokenProvider messageTokenProvider,
            IEmailAccountService emailAccountService,
            IEventPublisher eventPublisher,
            IMessageTemplateService messageTemplateService,
            ITokenizer tokenizer,
            IQueuedEmailService queuedEmailService,
            IProductService productService,

            CaptchaSettings captchaSettings,
            EmailAccountSettings emailAccountSettings)
        {
            _workContext = workContext;
            _settingService = settingService;
            _genericAttributeService = genericAttributeService;
            _localizationService = localizationService;
            _messageTokenProvider = messageTokenProvider;
            _emailAccountService = emailAccountService;
            _eventPublisher = eventPublisher;
            _messageTemplateService = messageTemplateService;
            _tokenizer = tokenizer;
            _queuedEmailService = queuedEmailService;
            _productService = productService;
            _captchaSettings = captchaSettings;
            _emailAccountSettings = emailAccountSettings;
        }
 public PromoController(
     IPromoUtilities promoUtilities,
     IPriceFormatter priceFormatter,
     IWorkContext workContext,
     PromoSettings promoSettings,
     IProductMappingService productMappingService,
     IProductPromoMappingService productPromoMappingService,
     IPromoDetailService promoDetailService,
     IStoreService storeService,
     IStoreContext storeContext,
     IAttributeValueService attributeValueService,
     ICurrencyService currencyService,
     IPromoPictureService promoPictureService,
     IPictureService pictureService,
     IProductService productService,
     ILocalizationService localizationService)
 {
     this._promoUtilities = promoUtilities;
     this._priceFormatter = priceFormatter;
     this._workContext = workContext;
     this._productMappingService = productMappingService;
     this._productPromoMappingService = productPromoMappingService;
     this._promoDetailService = promoDetailService;
     this._promoSettings = promoSettings;
     this._storeService = storeService;
     this._storeContext = storeContext;
     this._attributeValueService = attributeValueService;
     this._currencyService = currencyService;
     this._promoPictureService = promoPictureService;
     this._pictureService = pictureService;
     this._productService = productService;
     this._localizationService = localizationService;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"> </param>
 /// <param name="localizationService"></param>
 /// <param name="settingsService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="loggingService"> </param>
 public AdminBadgeController(IBadgeService badgeService, IPostService postService, ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, 
     IMembershipService membershipService, ILocalizationService localizationService, ISettingsService settingsService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService)
 {
     _badgeService = badgeService;
     _postService = postService;
 }
 public DiyGroupController(IPermissionService permissionService,
     IDiyService branchService, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     IStoreMappingService storeMappingService, 
     ILocalizedEntityService localizedEntityService, 
     IStoreService storeService,
     IPictureService pictureService, 
     IUrlRecordService urlRecordService, 
     ICustomerActivityService customerActivityService, 
     IWorkContext workContext,
     ICacheManager cacheManager, 
     DiySettings diySettings, 
     IWebHelper webHelper)
 {
     _permissionService = permissionService;
     _diyService = branchService;
     _languageService = languageService;
     _localizationService = localizationService;
     _storeMappingService = storeMappingService;
     _localizedEntityService = localizedEntityService;
     _storeService = storeService;
     _pictureService = pictureService;
     _urlRecordService = urlRecordService;
     _customerActivityService = customerActivityService;
     _workContext = workContext;
     _cacheManager = cacheManager;
     _diySettings = diySettings;
     _webHelper = webHelper;
 }
Example #26
0
 public CountryController(ICountryService countryService,
     IStateProvinceService stateProvinceService,
     ICityService cityService,
     IZipcodeService zipcodeService,
     ILocalizationService localizationService,
     IAddressService addressService,
     IPermissionService permissionService,
     ILocalizedEntityService localizedEntityService,
     ILanguageService languageService,
     IStoreService storeService,
     IStoreMappingService storeMappingService,
     IExportManager exportManager,
     IImportManager importManager)
 {
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._cityService = cityService;
     this._zipcodeService = zipcodeService;
     this._localizationService = localizationService;
     this._addressService = addressService;
     this._permissionService = permissionService;
     this._localizedEntityService = localizedEntityService;
     this._languageService = languageService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._exportManager = exportManager;
     this._importManager = importManager;
 }
Example #27
0
        public CheckoutController(IWorkContext workContext,
            IShoppingCartService shoppingCartService, ILocalizationService localizationService,
            ITaxService taxService, ICurrencyService currencyService,
            IPriceFormatter priceFormatter, IOrderProcessingService orderProcessingService,
            ICustomerService customerService,  ICountryService countryService,
            IStateProvinceService stateProvinceService, IShippingService shippingService,
            IPaymentService paymentService, IOrderTotalCalculationService orderTotalCalculationService,
            ILogger logger, IOrderService orderService, IWebHelper webHelper,
            OrderSettings orderSettings, RewardPointsSettings rewardPointsSettings,
            PaymentSettings paymentSettings)
        {
            this._workContext = workContext;
            this._shoppingCartService = shoppingCartService;
            this._localizationService = localizationService;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._customerService = customerService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._shippingService = shippingService;
            this._paymentService = paymentService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._logger = logger;
            this._orderService = orderService;
            this._webHelper = webHelper;

            this._orderSettings = orderSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._paymentSettings = paymentSettings;
        }
 public SettingController(ISettingService settingService,
     ICountryService countryService, IStateProvinceService stateProvinceService,
     IAddressService addressService, ITaxCategoryService taxCategoryService,
     ICurrencyService currencyService, IPictureService pictureService, 
     ILocalizationService localizationService, IDateTimeHelper dateTimeHelper,
     IOrderService orderService, IEncryptionService encryptionService,
     IThemeProvider themeProvider, ICustomerService customerService, 
     ICustomerActivityService customerActivityService, IPermissionService permissionService,
     IWebHelper webHelper, IFulltextService fulltextService, 
     IMaintenanceService maintenanceService, IStoreService storeService,
     IWorkContext workContext, IGenericAttributeService genericAttributeService)
 {
     this._settingService = settingService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._addressService = addressService;
     this._taxCategoryService = taxCategoryService;
     this._currencyService = currencyService;
     this._pictureService = pictureService;
     this._localizationService = localizationService;
     this._dateTimeHelper = dateTimeHelper;
     this._orderService = orderService;
     this._encryptionService = encryptionService;
     this._themeProvider = themeProvider;
     this._customerService = customerService;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
     this._webHelper = webHelper;
     this._fulltextService = fulltextService;
     this._maintenanceService = maintenanceService;
     this._storeService = storeService;
     this._workContext = workContext;
     this._genericAttributeService = genericAttributeService;
 }
 public AccessTokenValidationController(TokenValidator validator, IdentityServerOptions options, ILocalizationService localizationService, IEventService events)
 {
     _validator = validator;
     _options = options;
     _localizationService = localizationService;
     _events = events;
 }
 public ManufacturerController(ICategoryService categoryService, IManufacturerService manufacturerService,
     IManufacturerTemplateService manufacturerTemplateService, IProductService productService,
     ICustomerService customerService, IStoreService storeService,
     IStoreMappingService storeMappingService,
     IUrlRecordService urlRecordService, IPictureService pictureService,
     ILanguageService languageService, ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService, IExportManager exportManager,
     ICustomerActivityService customerActivityService, IAclService aclService, 
     IPermissionService permissionService,
     AdminAreaSettings adminAreaSettings, CatalogSettings catalogSettings)
 {
     this._categoryService = categoryService;
     this._manufacturerTemplateService = manufacturerTemplateService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._customerService = customerService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._urlRecordService = urlRecordService;
     this._pictureService = pictureService;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._exportManager = exportManager;
     this._customerActivityService = customerActivityService;
     this._aclService = aclService;
     this._permissionService = permissionService;
     this._adminAreaSettings = adminAreaSettings;
     this._catalogSettings = catalogSettings;
 }
Example #31
0
        public CustomerInfoValidator(ILocalizationService localizationService,
                                     IStateProvinceService stateProvinceService,
                                     CustomerSettings customerSettings)
        {
            RuleFor(x => x.Email).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Email.Required"));
            RuleFor(x => x.Email).EmailAddress().WithMessage(localizationService.GetResource("Common.WrongEmail"));
            RuleFor(x => x.FirstName).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.FirstName.Required"));
            RuleFor(x => x.LastName).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.LastName.Required"));

            if (customerSettings.UsernamesEnabled && customerSettings.AllowUsersToChangeUsernames)
            {
                RuleFor(x => x.Username).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Username.Required"));
            }

            //form fields
            if (customerSettings.CountryEnabled && customerSettings.CountryRequired)
            {
                RuleFor(x => x.CountryId)
                .NotNull()
                .WithMessage(localizationService.GetResource("Address.Fields.Country.Required"));
                RuleFor(x => x.CountryId)
                .NotEqual("")
                .WithMessage(localizationService.GetResource("Address.Fields.Country.Required"));
            }
            if (customerSettings.CountryEnabled &&
                customerSettings.StateProvinceEnabled &&
                customerSettings.StateProvinceRequired)
            {
                RuleFor(x => x.StateProvinceId).Must((x, context) =>
                {
                    var countryId = !String.IsNullOrEmpty(x.CountryId) ? x.CountryId : "";
                    var hasStates = stateProvinceService.GetStateProvincesByCountryId(countryId).Count > 0;
                    if (hasStates)
                    {
                        //if yes, then ensure that state is selected
                        if (String.IsNullOrEmpty(x.StateProvinceId))
                        {
                            return(false);
                        }
                    }
                    return(true);
                }).WithMessage(localizationService.GetResource("Account.Fields.StateProvince.Required"));
            }
            if (customerSettings.DateOfBirthEnabled && customerSettings.DateOfBirthRequired)
            {
                RuleFor(x => x.DateOfBirthDay).Must((x, context) =>
                {
                    var dateOfBirth = x.ParseDateOfBirth();
                    if (!dateOfBirth.HasValue)
                    {
                        return(false);
                    }

                    return(true);
                }).WithMessage(localizationService.GetResource("Account.Fields.DateOfBirth.Required"));

                //minimum age
                RuleFor(x => x.DateOfBirthDay).Must((x, context) =>
                {
                    var dateOfBirth = x.ParseDateOfBirth();
                    if (dateOfBirth.HasValue && customerSettings.DateOfBirthMinimumAge.HasValue &&
                        CommonHelper.GetDifferenceInYears(dateOfBirth.Value, DateTime.Today) <
                        customerSettings.DateOfBirthMinimumAge.Value)
                    {
                        return(false);
                    }

                    return(true);
                }).WithMessage(string.Format(localizationService.GetResource("Account.Fields.DateOfBirth.MinimumAge"), customerSettings.DateOfBirthMinimumAge));
            }
            if (customerSettings.CompanyRequired && customerSettings.CompanyEnabled)
            {
                RuleFor(x => x.Company).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Company.Required"));
            }
            if (customerSettings.StreetAddressRequired && customerSettings.StreetAddressEnabled)
            {
                RuleFor(x => x.StreetAddress).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.StreetAddress.Required"));
            }
            if (customerSettings.StreetAddress2Required && customerSettings.StreetAddress2Enabled)
            {
                RuleFor(x => x.StreetAddress2).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.StreetAddress2.Required"));
            }
            if (customerSettings.ZipPostalCodeRequired && customerSettings.ZipPostalCodeEnabled)
            {
                RuleFor(x => x.ZipPostalCode).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.ZipPostalCode.Required"));
            }
            if (customerSettings.CityRequired && customerSettings.CityEnabled)
            {
                RuleFor(x => x.City).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.City.Required"));
            }
            if (customerSettings.PhoneRequired && customerSettings.PhoneEnabled)
            {
                RuleFor(x => x.Phone).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Phone.Required"));
            }
            if (customerSettings.FaxRequired && customerSettings.FaxEnabled)
            {
                RuleFor(x => x.Fax).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Fax.Required"));
            }
        }
Example #32
0
 /// <summary>
 /// Constructs a new instance of the <see cref="RegistrationEmailService"/>.
 /// </summary>
 /// <param name="localizationService">Instance of the <see cref="ILocalizationService"/>.</param>
 public RegistrationEmailService(IConfigurationProvider configurationProvider, ILocalizationService localizationService, ISendEmailService sendEmailService)
 {
     _configurationProvider = configurationProvider;
     _localizationService   = localizationService;
     _sendEmailService      = sendEmailService;
 }
Example #33
0
        public ProxyCheck(IReadarrCloudRequestBuilder cloudRequestBuilder, IConfigService configService, IHttpClient client, ILocalizationService localizationService, Logger logger)
            : base(localizationService)
        {
            _configService = configService;
            _client        = client;
            _logger        = logger;

            _cloudRequestBuilder = cloudRequestBuilder.Services;
        }
Example #34
0
        public OrderAmazonController(IWorkContext workContext,
            IStoreContext storeContext,
            IStoreService storeService,
            ISettingService settingService,
            ILocalizationService localizationService,
            IPermissionService permissionService,
            IDateTimeHelper dateTimeHelper,

            IOrderService orderService,
            IOrderReportService orderReportService,
            IVendorService vendorService,
            ICacheManager cacheManager,
            IShippingService shippingService,
            IPaymentService paymentService,
            ICountryService countryService,
            IProductService productService,
            IPriceFormatter priceFormatter,
            ICurrencyService currencyService,
            CurrencySettings currencySettings,
            TaxSettings taxSettings,
            IAffiliateService affiliateService,
            IDiscountService discountService,
            IAddressAttributeFormatter addressAttributeFormatter,
            AddressSettings addressSettings,

            IOrderAmazonService orderAmazonService,

            IRepository<OrderItem> orderItemRepository,
            IRepository<OrderAmazon> orderAmazonRepository,
            IRepository<ProductMapping> productMappingRepository,

            IProductAttributeParser productAttributeParser,
        IPluginFinder pluginFinder)
        {
            this._localizationService = localizationService;
            this._settingService = settingService;
            this._storeContext = storeContext;
            this._storeService = storeService;
            this._workContext = workContext;
            this._permissionService = permissionService;
            this._dateTimeHelper = dateTimeHelper;

            this._orderService = orderService;
            this._orderReportService = orderReportService;
            this._orderAmazonService = orderAmazonService;
            this._vendorService = vendorService;
            this._cacheManager = cacheManager;
            this._shippingService = shippingService;
            this._paymentService = paymentService;
            this._countryService = countryService;
            this._productService = productService;
            this._priceFormatter = priceFormatter;
            this._currencyService = currencyService;
            this._currencySettings = currencySettings;

            this._taxSettings = taxSettings;
            this._affiliateService = affiliateService;
            this._discountService = discountService;
            this._addressAttributeFormatter = addressAttributeFormatter;
            this._addressSettings = addressSettings;

            this._orderItemRepository = orderItemRepository;
            this._orderAmazonRepository = orderAmazonRepository;
            this._productMappingRepository = productMappingRepository;

            this._productAttributeParser = productAttributeParser;
        }
Example #35
0
 public ProductReviewsValidator(ILocalizationService localizationService)
 {
     RuleFor(x => x.AddProductReview.Title).NotEmpty().WithMessage(localizationService.GetResource("Reviews.Fields.Title.Required")).When(x => x.AddProductReview != null);
     RuleFor(x => x.AddProductReview.Title).Length(1, 200).WithMessage(string.Format(localizationService.GetResource("Reviews.Fields.Title.MaxLengthValidation"), 200)).When(x => x.AddProductReview != null && !string.IsNullOrEmpty(x.AddProductReview.Title));
     RuleFor(x => x.AddProductReview.ReviewText).NotEmpty().WithMessage(localizationService.GetResource("Reviews.Fields.ReviewText.Required")).When(x => x.AddProductReview != null);
 }
        public ProductValidator(ILocalizationService localizationService, IDbContext dbContext)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.Catalog.Products.Fields.Name.Required"));

            SetDatabaseValidationRules <Product>(dbContext);
        }
 public ShippingMethodValidator(ILocalizationService localizationService)
 {
     RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.Configuration.Shipping.Methods.Fields.Name.Required"));
 }
Example #38
0
        public SettingValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Configuration.Settings.AllSettings.Fields.Name.Required"));

            SetDatabaseValidationRules <Setting>(dataProvider);
        }
Example #39
0
 public ReturnRequestValidator(ILocalizationService localizationService)
 {
     RuleFor(x => x.ReasonForReturn).NotEmpty().WithMessage(localizationService.GetResource("Admin.ReturnRequests.Fields.ReasonForReturn.Required"));
     RuleFor(x => x.RequestedAction).NotEmpty().WithMessage(localizationService.GetResource("Admin.ReturnRequests.Fields.RequestedAction.Required"));
 }
Example #40
0
 public RootFolderCheck(IMovieService movieService, IDiskProvider diskProvider, IRootFolderService rootFolderService, ILocalizationService localizationService)
     : base(localizationService)
 {
     _movieService      = movieService;
     _diskProvider      = diskProvider;
     _rootFolderService = rootFolderService;
 }
 public ContentMapDefinition(CommonMapper commonMapper, ILocalizedTextService localizedTextService, IContentService contentService, IContentTypeService contentTypeService,
                             IFileService fileService, IUmbracoContextAccessor umbracoContextAccessor, IPublishedRouter publishedRouter, ILocalizationService localizationService, ILogger logger,
                             IUserService userService, IEntityService entityService)
 {
     _commonMapper           = commonMapper;
     _localizedTextService   = localizedTextService;
     _contentService         = contentService;
     _contentTypeService     = contentTypeService;
     _fileService            = fileService;
     _umbracoContextAccessor = umbracoContextAccessor;
     _publishedRouter        = publishedRouter;
     _localizationService    = localizationService;
     _logger                  = logger;
     _userService             = userService;
     _entityService           = entityService;
     _tabsAndPropertiesMapper = new TabsAndPropertiesMapper <IContent>(localizedTextService);
     _stateMapper             = new ContentSavedStateMapper <ContentPropertyDisplay>();
     _basicStateMapper        = new ContentBasicSavedStateMapper <ContentPropertyBasic>();
     _contentVariantMapper    = new ContentVariantMapper(_localizationService, localizedTextService);
 }
Example #42
0
 public SystemTimeCheck(IHttpClient client, IReadarrCloudRequestBuilder cloudRequestBuilder, ILocalizationService localizationService, Logger logger)
     : base(localizationService)
 {
     _client = client;
     _cloudRequestBuilder = cloudRequestBuilder.Services;
     _logger = logger;
 }
Example #43
0
 public LocalizationPartDriver(ICultureManager cultureManager, ILocalizationService localizationService, IContentManager contentManager) {
     _cultureManager = cultureManager;
     _localizationService = localizationService;
     _contentManager = contentManager;
 }
 public BlogPostValidator(ILocalizationService localizationService)
 {
     RuleFor(x => x.AddNewComment.CommentText).NotEmpty().WithMessage(localizationService.GetResource("Blog.Comments.CommentText.Required")).When(x => x.AddNewComment != null);
 }
Example #45
0
 public ProductController(
     ICommonServices services,
     IManufacturerService manufacturerService,
     IProductService productService,
     IProductAttributeService productAttributeService,
     IProductAttributeParser productAttributeParser,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPictureService pictureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     ICustomerContentService customerContentService,
     ICustomerService customerService,
     IShoppingCartService shoppingCartService,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     IWorkflowMessageService workflowMessageService,
     IProductTagService productTagService,
     IOrderReportService orderReportService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     MediaSettings mediaSettings,
     SeoSettings seoSettings,
     CatalogSettings catalogSettings,
     ShoppingCartSettings shoppingCartSettings,
     LocalizationSettings localizationSettings,
     CaptchaSettings captchaSettings,
     CatalogHelper helper,
     IDownloadService downloadService,
     ILocalizationService localizationService,
     IBreadcrumb breadcrumb)
 {
     _services                       = services;
     _manufacturerService            = manufacturerService;
     _productService                 = productService;
     _productAttributeService        = productAttributeService;
     _productAttributeParser         = productAttributeParser;
     _taxService                     = taxService;
     _currencyService                = currencyService;
     _pictureService                 = pictureService;
     _priceCalculationService        = priceCalculationService;
     _priceFormatter                 = priceFormatter;
     _customerContentService         = customerContentService;
     _customerService                = customerService;
     _shoppingCartService            = shoppingCartService;
     _recentlyViewedProductsService  = recentlyViewedProductsService;
     _workflowMessageService         = workflowMessageService;
     _productTagService              = productTagService;
     _orderReportService             = orderReportService;
     _backInStockSubscriptionService = backInStockSubscriptionService;
     _aclService                     = aclService;
     _storeMappingService            = storeMappingService;
     _mediaSettings                  = mediaSettings;
     _seoSettings                    = seoSettings;
     _catalogSettings                = catalogSettings;
     _shoppingCartSettings           = shoppingCartSettings;
     _localizationSettings           = localizationSettings;
     _captchaSettings                = captchaSettings;
     _helper              = helper;
     _downloadService     = downloadService;
     _localizationService = localizationService;
     _breadcrumb          = breadcrumb;
 }
        public CommonModelFactory(ICategoryService categoryService,
                                  IProductService productService,
                                  IManufacturerService manufacturerService,
                                  ITopicService topicService,
                                  ILanguageService languageService,
                                  ICurrencyService currencyService,
                                  ILocalizationService localizationService,
                                  IWorkContext workContext,
                                  IStoreContext storeContext,
                                  ISitemapGenerator sitemapGenerator,
                                  IThemeContext themeContext,
                                  IThemeProvider themeProvider,
                                  IForumService forumService,
                                  IGenericAttributeService genericAttributeService,
                                  IWebHelper webHelper,
                                  IPermissionService permissionService,
                                  ICacheManager cacheManager,
                                  IPageHeadBuilder pageHeadBuilder,
                                  IPictureService pictureService,
                                  HttpContextBase httpContext,
                                  CatalogSettings catalogSettings,
                                  StoreInformationSettings storeInformationSettings,
                                  CommonSettings commonSettings,
                                  BlogSettings blogSettings,
                                  NewsSettings newsSettings,
                                  ForumSettings forumSettings,
                                  LocalizationSettings localizationSettings,
                                  CaptchaSettings captchaSettings,
                                  VendorSettings vendorSettings)
        {
            this._categoryService         = categoryService;
            this._productService          = productService;
            this._manufacturerService     = manufacturerService;
            this._topicService            = topicService;
            this._languageService         = languageService;
            this._currencyService         = currencyService;
            this._localizationService     = localizationService;
            this._workContext             = workContext;
            this._storeContext            = storeContext;
            this._sitemapGenerator        = sitemapGenerator;
            this._themeContext            = themeContext;
            this._themeProvider           = themeProvider;
            this._forumservice            = forumService;
            this._genericAttributeService = genericAttributeService;
            this._webHelper         = webHelper;
            this._permissionService = permissionService;
            this._cacheManager      = cacheManager;
            this._pageHeadBuilder   = pageHeadBuilder;
            this._pictureService    = pictureService;
            this._httpContext       = httpContext;

            this._catalogSettings          = catalogSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._commonSettings           = commonSettings;
            this._blogSettings             = blogSettings;
            this._newsSettings             = newsSettings;
            this._forumSettings            = forumSettings;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
            this._vendorSettings           = vendorSettings;
        }
        public ProductValidator(
            IEnumerable <IValidatorConsumer <ProductDto> > validators,
            ILocalizationService localizationService, IProductService productService, IProductTemplateService productTemplateService, IVendorService vendorService, CommonSettings commonSettings)
            : base(validators)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.Name.Required"));
            RuleFor(x => x.ProductType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ProductType.Required"));
            RuleFor(x => x.BackorderMode).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.BackorderMode.Required"));
            RuleFor(x => x.DownloadActivationType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.DownloadActivationType.Required"));
            RuleFor(x => x.IntervalUnitType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.IntervalUnitType.Required"));
            RuleFor(x => x.GiftCardType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.GiftCardType.Required"));
            RuleFor(x => x.LowStockActivity).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.LowStockActivity.Required"));
            RuleFor(x => x.ManageInventoryMethod).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ManageInventoryMethod.Required"));
            RuleFor(x => x.RecurringCyclePeriod).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.RecurringCyclePeriod.Required"));

            if (!commonSettings.AllowEditProductEndedAuction)
            {
                RuleFor(x => x.AuctionEnded && x.ProductType == ProductType.Auction).Equal(false).WithMessage(localizationService.GetResource("Api.Catalog.Products.Cannoteditauction"));
            }

            RuleFor(x => x.ProductType == ProductType.Auction && !x.AvailableEndDateTimeUtc.HasValue).Equal(false).WithMessage(localizationService.GetResource("Api.Catalog.Products.Fields.AvailableEndDateTime.Required"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.ParentGroupedProductId))
                {
                    var product = await productService.GetProductById(x.ParentGroupedProductId);
                    if (product == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ParentGroupedProductId.NotExists"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.ProductTemplateId))
                {
                    var template = await productTemplateService.GetProductTemplateById(x.ProductTemplateId);
                    if (template == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ProductTemplateId.NotExists"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.VendorId))
                {
                    var vendor = await vendorService.GetVendorById(x.VendorId);
                    if (vendor == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.VendorId.NotExists"));


            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.Id))
                {
                    var product = await productService.GetProductById(x.Id);
                    if (product == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.Id.NotExists"));
        }
Example #48
0
        public CustomerAttributeValueValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.Customers.CustomerAttributes.Values.Fields.Name.Required"));

            SetDatabaseValidationRules <CustomerAttributeValue>(dataProvider);
        }
Example #49
0
 public PasswordRecoveryValidator(ILocalizationService localizationService)
 {
     RuleFor(x => x.Email).NotEmpty().WithMessage(localizationService.GetResource("Account.PasswordRecovery.Email.Required"));
     RuleFor(x => x.Email).EmailAddress().WithMessage(localizationService.GetResource("Common.WrongEmail"));
 }
 public TestMessageTemplateValidator(ILocalizationService localizationService)
 {
     RuleFor(x => x.SendTo).NotEmpty();
     RuleFor(x => x.SendTo).EmailAddress().WithMessage(localizationService.GetResource("Admin.Common.WrongEmail"));
 }
Example #51
0
        public CustomerValidator(ILocalizationService localizationService,
                                 IStateProvinceService stateProvinceService,
                                 ICustomerService customerService,
                                 CustomerSettings customerSettings,
                                 IDbContext dbContext)
        {
            //ensure that valid email address is entered if Registered role is checked to avoid registered customers with empty email address
            RuleFor(x => x.Email)
            .NotEmpty()
            .EmailAddress()
            //.WithMessage("Valid Email is required for customer to be in 'Registered' role")
            .WithMessage(localizationService.GetResource("Admin.Common.WrongEmail"))
            //only for registered users
            .When(x => IsRegisteredCustomerRoleChecked(x, customerService));

            //form fields
            if (customerSettings.CountryEnabled && customerSettings.CountryRequired)
            {
                RuleFor(x => x.CountryId)
                .NotEqual(0)
                .WithMessage(localizationService.GetResource("Account.Fields.Country.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }
            if (customerSettings.CountryEnabled &&
                customerSettings.StateProvinceEnabled &&
                customerSettings.StateProvinceRequired)
            {
                Custom(x =>
                {
                    //does selected country have states?
                    var hasStates = stateProvinceService.GetStateProvincesByCountryId(x.CountryId).Any();
                    if (hasStates)
                    {
                        //if yes, then ensure that a state is selected
                        if (x.StateProvinceId == 0)
                        {
                            return(new ValidationFailure("StateProvinceId", localizationService.GetResource("Account.Fields.StateProvince.Required")));
                        }
                    }
                    return(null);
                });
            }
            if (customerSettings.CompanyRequired && customerSettings.CompanyEnabled)
            {
                RuleFor(x => x.Company)
                .NotEmpty()
                .WithMessage(localizationService.GetResource("Admin.Customers.Customers.Fields.Company.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }
            if (customerSettings.StreetAddressRequired && customerSettings.StreetAddressEnabled)
            {
                RuleFor(x => x.StreetAddress)
                .NotEmpty()
                .WithMessage(localizationService.GetResource("Admin.Customers.Customers.Fields.StreetAddress.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }
            if (customerSettings.StreetAddress2Required && customerSettings.StreetAddress2Enabled)
            {
                RuleFor(x => x.StreetAddress2)
                .NotEmpty()
                .WithMessage(localizationService.GetResource("Admin.Customers.Customers.Fields.StreetAddress2.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }
            if (customerSettings.ZipPostalCodeRequired && customerSettings.ZipPostalCodeEnabled)
            {
                RuleFor(x => x.ZipPostalCode)
                .NotEmpty()
                .WithMessage(localizationService.GetResource("Admin.Customers.Customers.Fields.ZipPostalCode.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }
            if (customerSettings.CityRequired && customerSettings.CityEnabled)
            {
                RuleFor(x => x.City)
                .NotEmpty()
                .WithMessage(localizationService.GetResource("Admin.Customers.Customers.Fields.City.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }
            if (customerSettings.PhoneRequired && customerSettings.PhoneEnabled)
            {
                RuleFor(x => x.Phone)
                .NotEmpty()
                .WithMessage(localizationService.GetResource("Admin.Customers.Customers.Fields.Phone.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }
            if (customerSettings.FaxRequired && customerSettings.FaxEnabled)
            {
                RuleFor(x => x.Fax)
                .NotEmpty()
                .WithMessage(localizationService.GetResource("Admin.Customers.Customers.Fields.Fax.Required"))
                //only for registered users
                .When(x => IsRegisteredCustomerRoleChecked(x, customerService));
            }

            SetStringPropertiesMaxLength <Customer>(dbContext);
        }
        public RegisterValidator(ILocalizationService localizationService,
                                 IStateProvinceService stateProvinceService,
                                 CustomerSettings customerSettings)
        {
            RuleFor(x => x.Email).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Email.Required"));
            RuleFor(x => x.Email).EmailAddress().WithMessage(localizationService.GetResource("Common.WrongEmail"));


            if (customerSettings.UsernamesEnabled)
            {
                RuleFor(x => x.Username).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Username.Required"));
            }

            RuleFor(x => x.FirstName).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.FirstName.Required"));
            RuleFor(x => x.LastName).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.LastName.Required"));


            RuleFor(x => x.Password).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Password.Required"));
            RuleFor(x => x.Password).Length(customerSettings.PasswordMinLength, 999).WithMessage(string.Format(localizationService.GetResource("Account.Fields.Password.LengthValidation"), customerSettings.PasswordMinLength));
            RuleFor(x => x.ConfirmPassword).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.ConfirmPassword.Required"));
            RuleFor(x => x.ConfirmPassword).Equal(x => x.Password).WithMessage(localizationService.GetResource("Account.Fields.Password.EnteredPasswordsDoNotMatch"));

            //form fields
            if (customerSettings.CountryEnabled && customerSettings.CountryRequired)
            {
                RuleFor(x => x.CountryId)
                .NotEqual(0)
                .WithMessage(localizationService.GetResource("Account.Fields.Country.Required"));
            }
            if (customerSettings.CountryEnabled &&
                customerSettings.StateProvinceEnabled &&
                customerSettings.StateProvinceRequired)
            {
                Custom(x =>
                {
                    //does selected country have states?
                    var hasStates = stateProvinceService.GetStateProvincesByCountryId(x.CountryId).Count > 0;
                    if (hasStates)
                    {
                        //if yes, then ensure that a state is selected
                        if (x.StateProvinceId == 0)
                        {
                            return(new ValidationFailure("StateProvinceId", localizationService.GetResource("Account.Fields.StateProvince.Required")));
                        }
                    }
                    return(null);
                });
            }
            if (customerSettings.DateOfBirthEnabled && customerSettings.DateOfBirthRequired)
            {
                Custom(x =>
                {
                    var dateOfBirth = x.ParseDateOfBirth();
                    //entered?
                    if (!dateOfBirth.HasValue)
                    {
                        return(new ValidationFailure("DateOfBirthDay", localizationService.GetResource("Account.Fields.DateOfBirth.Required")));
                    }
                    //minimum age
                    if (customerSettings.DateOfBirthMinimumAge.HasValue &&
                        CommonHelper.GetDifferenceInYears(dateOfBirth.Value, DateTime.Today) < customerSettings.DateOfBirthMinimumAge.Value)
                    {
                        return(new ValidationFailure("DateOfBirthDay", string.Format(localizationService.GetResource("Account.Fields.DateOfBirth.MinimumAge"), customerSettings.DateOfBirthMinimumAge.Value)));
                    }
                    return(null);
                });
            }
            if (customerSettings.CompanyRequired && customerSettings.CompanyEnabled)
            {
                RuleFor(x => x.Company).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Company.Required"));
            }
            if (customerSettings.StreetAddressRequired && customerSettings.StreetAddressEnabled)
            {
                RuleFor(x => x.StreetAddress).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.StreetAddress.Required"));
            }
            if (customerSettings.StreetAddress2Required && customerSettings.StreetAddress2Enabled)
            {
                RuleFor(x => x.StreetAddress2).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.StreetAddress2.Required"));
            }
            if (customerSettings.ZipPostalCodeRequired && customerSettings.ZipPostalCodeEnabled)
            {
                RuleFor(x => x.ZipPostalCode).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.ZipPostalCode.Required"));
            }
            if (customerSettings.CityRequired && customerSettings.CityEnabled)
            {
                RuleFor(x => x.City).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.City.Required"));
            }
            if (customerSettings.PhoneRequired && customerSettings.PhoneEnabled)
            {
                RuleFor(x => x.Phone).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Phone.Required"));
            }
            if (customerSettings.FaxRequired && customerSettings.FaxEnabled)
            {
                RuleFor(x => x.Fax).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.Fax.Required"));
            }
        }
 public UserEntityClaimController(IUserEntityClaimManager userEntityClaimManager, ILocalizationService localizationService, ILogger <UserEntityClaimController> logger, IMapper mapper)
     : base(userEntityClaimManager, localizationService, logger, mapper)
 {
 }
 public GetFunctionHandlerService(IUcquClient client, IDataAccessService dataService, ILocalizationService locService)
 {
     this.client      = client;
     this.dataService = dataService;
     this.locService  = locService;
 }
 public KnowledgebaseController(KnowledgebaseSettings knowledgebaseSettings, IKnowledgebaseService knowledgebaseService, IWorkContext workContext,
                                IStoreContext storeContext, ICacheManager cacheManager, IAclService aclService, IStoreMappingService storeMappingService, ILocalizationService localizationService,
                                CaptchaSettings captchaSettings, LocalizationSettings localizationSettings, IWorkflowMessageService workflowMessageService,
                                ICustomerActivityService customerActivityService, IDateTimeHelper dateTimeHelper, CustomerSettings customerSettings,
                                MediaSettings mediaSettings, IPictureService pictureService)
 {
     this._knowledgebaseSettings   = knowledgebaseSettings;
     this._knowledgebaseService    = knowledgebaseService;
     this._workContext             = workContext;
     this._storeContext            = storeContext;
     this._cacheManager            = cacheManager;
     this._aclService              = aclService;
     this._storeMappingService     = storeMappingService;
     this._localizationService     = localizationService;
     this._captchaSettings         = captchaSettings;
     this._localizationSettings    = localizationSettings;
     this._workflowMessageService  = workflowMessageService;
     this._customerActivityService = customerActivityService;
     this._dateTimeHelper          = dateTimeHelper;
     this._customerSettings        = customerSettings;
     this._mediaSettings           = mediaSettings;
     this._pictureService          = pictureService;
 }
Example #56
0
        /// <summary>
        /// Gets the Urls of the content item.
        /// </summary>
        /// <remarks>
        /// <para>Use when displaying Urls. If errors occur when generating the Urls, they will show in the list.</para>
        /// <para>Contains all the Urls that we can figure out (based upon domains, etc).</para>
        /// </remarks>
        public static IEnumerable <UrlInfo> GetContentUrls(this IContent content,
                                                           IPublishedRouter publishedRouter,
                                                           UmbracoContext umbracoContext,
                                                           ILocalizationService localizationService,
                                                           ILocalizedTextService textService,
                                                           IContentService contentService,
                                                           ILogger logger)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }
            if (publishedRouter == null)
            {
                throw new ArgumentNullException(nameof(publishedRouter));
            }
            if (umbracoContext == null)
            {
                throw new ArgumentNullException(nameof(umbracoContext));
            }
            if (localizationService == null)
            {
                throw new ArgumentNullException(nameof(localizationService));
            }
            if (textService == null)
            {
                throw new ArgumentNullException(nameof(textService));
            }
            if (contentService == null)
            {
                throw new ArgumentNullException(nameof(contentService));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (content.Published == false)
            {
                yield return(UrlInfo.Message(textService.Localize("content/itemNotPublished")));

                yield break;
            }

            // build a list of urls, for the back-office
            // which will contain
            // - the 'main' urls, which is what .Url would return, for each culture
            // - the 'other' urls we know (based upon domains, etc)
            //
            // need to work through each installed culture:
            // on invariant nodes, each culture returns the same url segment but,
            // we don't know if the branch to this content is invariant, so we need to ask
            // for URLs for all cultures.
            // and, not only for those assigned to domains in the branch, because we want
            // to show what GetUrl() would return, for every culture.

            var urls     = new HashSet <UrlInfo>();
            var cultures = localizationService.GetAllLanguages().Select(x => x.IsoCode).ToList();

            //get all URLs for all cultures
            //in a HashSet, so de-duplicates too
            foreach (var cultureUrl in GetContentUrlsByCulture(content, cultures, publishedRouter, umbracoContext, contentService, textService, logger))
            {
                urls.Add(cultureUrl);
            }

            //return the real urls first, then the messages
            foreach (var urlGroup in urls.GroupBy(x => x.IsUrl).OrderByDescending(x => x.Key))
            {
                //in some cases there will be the same URL for multiple cultures:
                // * The entire branch is invariant
                // * If there are less domain/cultures assigned to the branch than the number of cultures/languages installed

                foreach (var dUrl in urlGroup.DistinctBy(x => x.Text.ToUpperInvariant()).OrderBy(x => x.Text).ThenBy(x => x.Culture))
                {
                    yield return(dUrl);
                }
            }

            // get the 'other' urls - ie not what you'd get with GetUrl() but urls that would route to the document, nevertheless.
            // for these 'other' urls, we don't check whether they are routable, collide, anything - we just report them.
            foreach (var otherUrl in umbracoContext.UrlProvider.GetOtherUrls(content.Id).OrderBy(x => x.Text).ThenBy(x => x.Culture))
            {
                if (urls.Add(otherUrl)) //avoid duplicates
                {
                    yield return(otherUrl);
                }
            }
        }
Example #57
0
 public CommonModelFactory(AdminAreaSettings adminAreaSettings,
                           CatalogSettings catalogSettings,
                           CurrencySettings currencySettings,
                           IActionContextAccessor actionContextAccessor,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IDateTimeHelper dateTimeHelper,
                           IExternalAuthenticationService externalAuthenticationService,
                           INopFileProvider fileProvider,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IMaintenanceService maintenanceService,
                           IMeasureService measureService,
                           IOrderService orderService,
                           IPaymentService paymentService,
                           IPluginFinder pluginFinder,
                           IProductService productService,
                           IReturnRequestService returnRequestService,
                           ISearchTermService searchTermService,
                           IShippingService shippingService,
                           IStoreContext storeContext,
                           IStoreService storeService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWidgetService widgetService,
                           IWorkContext workContext,
                           MeasureSettings measureSettings,
                           TaxSettings taxSettings)
 {
     this._adminAreaSettings             = adminAreaSettings;
     this._catalogSettings               = catalogSettings;
     this._currencySettings              = currencySettings;
     this._actionContextAccessor         = actionContextAccessor;
     this._currencyService               = currencyService;
     this._customerService               = customerService;
     this._dateTimeHelper                = dateTimeHelper;
     this._externalAuthenticationService = externalAuthenticationService;
     this._fileProvider         = fileProvider;
     this._httpContextAccessor  = httpContextAccessor;
     this._languageService      = languageService;
     this._localizationService  = localizationService;
     this._maintenanceService   = maintenanceService;
     this._measureService       = measureService;
     this._orderService         = orderService;
     this._paymentService       = paymentService;
     this._pluginFinder         = pluginFinder;
     this._productService       = productService;
     this._returnRequestService = returnRequestService;
     this._searchTermService    = searchTermService;
     this._shippingService      = shippingService;
     this._storeContext         = storeContext;
     this._storeService         = storeService;
     this._urlHelperFactory     = urlHelperFactory;
     this._urlRecordService     = urlRecordService;
     this._webHelper            = webHelper;
     this._widgetService        = widgetService;
     this._workContext          = workContext;
     this._measureSettings      = measureSettings;
     this._taxSettings          = taxSettings;
 }
Example #58
0
 public MeasureDimensionValidator(ILocalizationService localizationService)
 {
     RuleFor(x => x.Name).NotNull().WithMessage(localizationService.GetResource("Admin.Configuration.Measures.Dimensions.Fields.Name.Required"));
     RuleFor(x => x.SystemKeyword).NotNull().WithMessage(localizationService.GetResource("Admin.Configuration.Measures.Dimensions.Fields.SystemKeyword.Required"));
 }
Example #59
0
 protected BaseViewModel()
 {
     SetConfigurationPath();
     _localization = LocalizationService.GetInstance();
 }
Example #60
0
 public LocalizationActionFilter(ILocalizationService locService)
 {
     this.locService = locService;
 }