예제 #1
0
        public VendorController(IWorkContext workContext,
            ILocalizationService localizationService,
            ICustomerService customerService,
            IWorkflowMessageService workflowMessageService,
            IVendorService vendorService,
            IUrlRecordService urlRecordService,
            IPictureService pictureService,
            LocalizationSettings localizationSettings,
            VendorSettings vendorSettings,
            CaptchaSettings captchaSettings,
            MediaSettings mediaSettings)
        {
            this._workContext = workContext;
            this._localizationService = localizationService;
            this._customerService = customerService;
            this._workflowMessageService = workflowMessageService;
            this._vendorService = vendorService;
            this._urlRecordService = urlRecordService;
            this._pictureService = pictureService;

            this._localizationSettings = localizationSettings;
            this._vendorSettings = vendorSettings;
            this._captchaSettings = captchaSettings;
            this._mediaSettings = mediaSettings;
        }
예제 #2
0
 public CategoryController(ICategoryService categoryService, ICategoryTemplateService categoryTemplateService,
     IManufacturerService manufacturerService, IProductService productService, 
     ICustomerService customerService,
     IUrlRecordService urlRecordService, IPictureService pictureService, ILanguageService languageService,
     ILocalizationService localizationService, ILocalizedEntityService localizedEntityService,
     IDiscountService discountService, IPermissionService permissionService,
     IAclService aclService,
     IExportManager exportManager, IWorkContext workContext,
     ICustomerActivityService customerActivityService, AdminAreaSettings adminAreaSettings,
     CatalogSettings catalogSettings)
 {
     this._categoryService = categoryService;
     this._categoryTemplateService = categoryTemplateService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._customerService = customerService;
     this._urlRecordService = urlRecordService;
     this._pictureService = pictureService;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._discountService = discountService;
     this._permissionService = permissionService;
     this._aclService = aclService;
     this._exportManager = exportManager;
     this._workContext = workContext;
     this._customerActivityService = customerActivityService;
     this._adminAreaSettings = adminAreaSettings;
     this._catalogSettings = catalogSettings;
 }
 public BranchGroupReadController(IPermissionService permissionService,
     IBranchService branchService, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     ILocalizedEntityService localizedEntityService, 
     IPictureService pictureService, 
     IUrlRecordService urlRecordService, 
     ICustomerActivityService customerActivityService, 
     IWorkContext workContext,
     ICacheManager cacheManager, 
     BranchSettings branchSettings, 
     IWebHelper webHelper)
 {
     _permissionService = permissionService;
     _branchService = branchService;
     _languageService = languageService;
     _localizationService = localizationService;
     _localizedEntityService = localizedEntityService;
     _pictureService = pictureService;
     _urlRecordService = urlRecordService;
     _customerActivityService = customerActivityService;
     _workContext = workContext;
     _cacheManager = cacheManager;
     _branchSettings = branchSettings;
     _webHelper = webHelper;
 }
 public mobSocialApiController(IPermissionService permissionService,
     IWorkContext workContext, AdminAreaSettings adminAreaSettings, ILocalizationService localizationService,
     IPictureService pictureService, IMobSocialService socialNetworkService, ICustomerService customerService,
     ICustomerAlbumPictureService customerAlbumPictureService, mobSocialSettings mobSocialSettings, MediaSettings mediaSettings, CustomerSettings customerSettings, 
     ForumSettings forumSettings, RewardPointsSettings rewardPointsSettings, OrderSettings orderSettings,
      IStoreContext storeContext, IWebHelper webHelper, IUrlRecordService urlRecordService, IRepository<UrlRecord> urlRecordRepository,
     ICustomerVideoAlbumService customerVideoAlbumService, CustomerProfileViewService customerProfileViewService)
 {
     _permissionService = permissionService;
     _workContext = workContext;
     _adminAreaSettings = adminAreaSettings;
     _localizationService = localizationService;
     _pictureService = pictureService;
     _socialNetworkService = socialNetworkService;
     _customerService = customerService;
     _customerAlbumPictureService = customerAlbumPictureService;
     _mobSocialSettings = mobSocialSettings;
     _mediaSettings = mediaSettings;
     _customerSettings = customerSettings;
     _forumSettings = forumSettings;
     _rewardPointsSettings = rewardPointsSettings;
     _orderSettings = orderSettings;
     _storeContext = storeContext;
     _webHelper = webHelper;
     _urlRecordService = urlRecordService;
     _urlRecordRepository = urlRecordRepository;
     _customerVideoAlbumService = customerVideoAlbumService;
     _customerProfileViewService = customerProfileViewService;
 }
 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;
 }
예제 #6
0
 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;
 }
예제 #7
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 CommonController(IPaymentService paymentService, 
     IShippingService shippingService,
     IShoppingCartService shoppingCartService,
     ICurrencyService currencyService,
     IMeasureService measureService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWebHelper webHelper,
     CurrencySettings currencySettings,
     MeasureSettings measureSettings,
     IDateTimeHelper dateTimeHelper,
     ILanguageService languageService,
     IWorkContext workContext,
     IStoreContext storeContext,
     IPermissionService permissionService,
     ILocalizationService localizationService)
 {
     this._paymentService = paymentService;
     this._shippingService = shippingService;
     this._shoppingCartService = shoppingCartService;
     this._currencyService = currencyService;
     this._measureService = measureService;
     this._customerService = customerService;
     this._urlRecordService = urlRecordService;
     this._webHelper = webHelper;
     this._currencySettings = currencySettings;
     this._measureSettings = measureSettings;
     this._dateTimeHelper = dateTimeHelper;
     this._languageService = languageService;
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._permissionService = permissionService;
     this._localizationService = localizationService;
 }
 public CollectibleExportService(IProductService productService, 
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     IUrlRecordService urlRecordService,
     IStoreContext storeContext,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     ICountryService countryService,   //not used
     IStateProvinceService stateProvinceService,
     IConsignorService consignorService,
     IAuthenticationService authenticationService,
     ILogger logger,
     IRepository<AUCountryLotRecord> countrylotRepo,
     IRepository<AUStateProvinceLotRecord> stateprovincelotRepo
     )
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._urlRecordService = urlRecordService;
     this._storeContext = storeContext;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._consignorService = consignorService;
     this._authenticationService = authenticationService;
     this._logger = logger;                          //NJM: AUConsignor
     this._countrylotRepo = countrylotRepo;
     this._stateprovincelotRepo = stateprovincelotRepo;
 }
        public ManufacturerController(ICategoryService categoryService, IManufacturerService manufacturerService,
            IManufacturerTemplateService manufacturerTemplateService, IProductService productService,
			IStoreService storeService,	IStoreMappingService storeMappingService,
            IUrlRecordService urlRecordService, IPictureService pictureService,
            ILanguageService languageService, ILocalizationService localizationService, ILocalizedEntityService localizedEntityService,
            IWorkContext workContext,
            ICustomerActivityService customerActivityService, IPermissionService permissionService,
			IDateTimeHelper dateTimeHelper,
            AdminAreaSettings adminAreaSettings,
			CatalogSettings catalogSettings)
        {
            this._categoryService = categoryService;
            this._manufacturerTemplateService = manufacturerTemplateService;
            this._manufacturerService = manufacturerService;
            this._productService = productService;
            this._storeService = storeService;
            this._storeMappingService = storeMappingService;
            this._urlRecordService = urlRecordService;
            this._pictureService = pictureService;
            this._languageService = languageService;
            this._localizationService = localizationService;
            this._localizedEntityService = localizedEntityService;
            this._workContext = workContext;
            this._customerActivityService = customerActivityService;
            this._permissionService = permissionService;
            this._dateTimeHelper = dateTimeHelper;
            this._adminAreaSettings = adminAreaSettings;
            this._catalogSettings = catalogSettings;
        }
예제 #11
0
 public VendorController(ICustomerService customerService, 
     ILocalizationService localizationService,
     IVendorService vendorService, 
     IPermissionService permissionService,
     IUrlRecordService urlRecordService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService,
     VendorSettings vendorSettings,
     IPictureService pictureService,
     IProductService productService,
     IWorkContext workContext,
     IGenericAttributeService genericAttributeService,
     IWorkflowMessageService workflowMessageService)
 {
     this._customerService = customerService;
     this._localizationService = localizationService;
     this._vendorService = vendorService;
     this._permissionService = permissionService;
     this._urlRecordService = urlRecordService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._vendorSettings = vendorSettings;
     this._pictureService = pictureService;
     this._productService = productService;
     this._workContext = workContext;
     this._workflowMessageService = workflowMessageService;
     this._genericAttributeService = genericAttributeService;
 }
예제 #12
0
 public CopyProductService(IProductService productService,
     IProductAttributeService productAttributeService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService, 
     IPictureService pictureService,
     ICategoryService categoryService, 
     IManufacturerService manufacturerService,
     ISpecificationAttributeService specificationAttributeService,
     IDownloadService downloadService,
     IProductAttributeParser productAttributeParser,
     IUrlRecordService urlRecordService, 
     IStoreMappingService storeMappingService)
 {
     this._productService = productService;
     this._productAttributeService = productAttributeService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._pictureService = pictureService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._specificationAttributeService = specificationAttributeService;
     this._downloadService = downloadService;
     this._productAttributeParser = productAttributeParser;
     this._urlRecordService = urlRecordService;
     this._storeMappingService = storeMappingService;
 }
예제 #13
0
 /// <summary>
 /// Từ bộ 3 giá trị đọc ra slug key tương ứng, tuy nhiên, có 1 khác biệt so với IUrlRecordService.GetActiveSlugCached()
 /// là hàm này cho phép chúng ta có thể lấy về slug mặc định với languageId=0 trong trường hợp languageId<>0 và ko tìm thấy
 /// urlRecord phù hợp
 /// 
 /// Chúng ta cũng có thể chỉ định rằng chỉ load urlRecord cho ngôn ngữ khác khi hệ thống có ít nhất 2 ngôn ngữ đang hoạt động, ngược lại
 /// thì cứ load theo languageid=0 cho nó lành
 /// </summary>
 /// /// <param name="entityId">Entity identifier</param>
 /// <param name="entityName">Entity name</param>
 /// <param name="languageId">Language identifier</param>
 /// <param name="returnDefaultValue">A value indicating whether to return default value (if language specified one is not found)</param>
 /// <param name="ensureTwoPublishedLanguages">A value indicating whether to ensure that we have at least two published languages; otherwise, load only default value</param>
 /// <returns>Search engine  name (slug)</returns>
 public static string GetSeName(int entityId, string entityName, int languageId, IUrlRecordService urlRecordService = null,
     bool returnDefaultValue = true, bool ensureTwoPublishedLanguages = true)
 {
     string result = string.Empty;
     var engine = EngineContext.Current;
     if(urlRecordService == null)
         urlRecordService = engine.Resolve<IUrlRecordService>();
     if (languageId > 0)
     {
         // giải quyết ràng buộc của ensureTwoPublishedLanguages
         bool loadLocalizedValue = true;
         if (ensureTwoPublishedLanguages)
         {
             var languageService = engine.Resolve<ILanguageService>();
             loadLocalizedValue = languageService.GetAllLanguages().Count >= 2;
         }
         // như vậy trong trường hợp chỉ có 1 ngôn ngữ active thì cho dù có định nghĩa seo url riêng cho ngôn ngữ đó, hệ thống
         // vẫn sẽ chọn dùng seo url mặc định với laguageid = 0
         if (loadLocalizedValue)
             result = urlRecordService.GetActiveSlugCached(entityId, entityName, languageId);
     }
     if (string.IsNullOrEmpty(result) && returnDefaultValue)
         result = urlRecordService.GetActiveSlugCached(entityId, entityName, 0);
     return result;
 }
예제 #14
0
        public ImportManager(
			IProductService productService, 
			ICategoryService categoryService,
            IManufacturerService manufacturerService, 
			IPictureService pictureService,
            IUrlRecordService urlRecordService,
			SeoSettings seoSettings,
			IEventPublisher eventPublisher,
			IRepository<Product> rsProduct,
			IRepository<ProductCategory> rsProductCategory,
			IRepository<ProductManufacturer> rsProductManufacturer,
            IRepository<Picture> rsPicture,
			IRepository<ProductPicture> rsProductPicture,
            IRepository<UrlRecord> rsUrlRecord,
            ILanguageService languageService,
            ILocalizedEntityService localizedEntityService,
            IStoreMappingService storeMappingService)
        {
            this._productService = productService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._pictureService = pictureService;
            this._urlRecordService = urlRecordService;
            this._seoSettings = seoSettings;
            this._eventPublisher = eventPublisher;
            this._rsProduct = rsProduct;
            this._rsProductCategory = rsProductCategory;
            this._rsProductManufacturer = rsProductManufacturer;
            this._rsProductPicture = rsProductPicture;
            this._rsUrlRecord = rsUrlRecord;
            this._rsPicture = rsPicture;
            this._languageService = languageService;
            this._localizedEntityService = localizedEntityService;
            this._storeMappingService = storeMappingService;
        }
 public SelectSellController(IProductService productService,
     IProductTemplateService productTemplateService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService,
     IProductTagService productTagService,
     ICopyProductService copyProductService,
     IPdfService pdfService,
     IExportManager exportManager,
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService,
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
     IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     IStoreContext storeContext,
     IRepository<StoreMapping> storeMapping)
 {
     _workContext = workContext;
     _productService = productService;
     _pictureService = pictureService;
     _localizationService = localizationService;
     _categoryService = categoryService;
     _manufacturerService = manufacturerService;
     _storeService = storeService;
     _shippingService = shippingService;
     _vendorService = vendorService;
     _storeMappingService = storeMappingService;
     _storeContext = storeContext;
     _storeMapping = storeMapping;
 }
예제 #16
0
 public ImportManager(IProductService productService, ICategoryService categoryService,
     IManufacturerService manufacturerService, IPictureService pictureService,
     IUrlRecordService urlRecordService)
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._urlRecordService = urlRecordService;
 }
        public UrlRecordController(
			IUrlRecordService urlRecordService,
			AdminAreaSettings adminAreaSettings,
			ICommonServices services,
			ILanguageService languageService)
        {
            _urlRecordService = urlRecordService;
            _adminAreaSettings = adminAreaSettings;
            _services = services;
            _languageService = languageService;
        }
예제 #18
0
 public BlogController(IBlogService blogService, ILanguageService languageService,
     IDateTimeHelper dateTimeHelper, ICustomerContentService customerContentService,
     ILocalizationService localizationService, IPermissionService permissionService,
     IUrlRecordService urlRecordService, AdminAreaSettings adminAreaSettings)
 {
     this._blogService = blogService;
     this._languageService = languageService;
     this._dateTimeHelper = dateTimeHelper;
     this._customerContentService = customerContentService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._urlRecordService = urlRecordService;
     this._adminAreaSettings = adminAreaSettings;
 }
예제 #19
0
        private readonly IVendorService _sendorService; //add by hz

        #endregion Fields

        #region Constructors

        public ImportManager(IProductService productService, ICategoryService categoryService,
           IManufacturerService manufacturerService,
           IPictureService pictureService,
           IUrlRecordService urlRecordService
           , IVendorService sendorService//add by hz
           )
        {
            this._productService = productService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._pictureService = pictureService;
            this._urlRecordService = urlRecordService;
            this._sendorService = sendorService;//add by hz
        }
 public ProductController(IProductService productService, 
     IProductTemplateService productTemplateService,
     ICategoryService categoryService, IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService, IWorkContext workContext, ILanguageService languageService,
     ILocalizationService localizationService, ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService, IPictureService pictureService,
     ITaxCategoryService taxCategoryService, IProductTagService productTagService,
     ICopyProductService copyProductService, IPdfService pdfService,
     IExportManager exportManager, IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService, IAclService aclService,
     IStoreService storeService, IStoreMappingService storeMappingService,
     IVendorService vendorService,
     ICurrencyService currencyService, CurrencySettings currencySettings,
     IMeasureService measureService, MeasureSettings measureSettings,
     PdfSettings pdfSettings, AdminAreaSettings adminAreaSettings)
 {
     this._productService = productService;
     this._productTemplateService = productTemplateService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._customerService = customerService;
     this._urlRecordService = urlRecordService;
     this._workContext = workContext;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._specificationAttributeService = specificationAttributeService;
     this._pictureService = pictureService;
     this._taxCategoryService = taxCategoryService;
     this._productTagService = productTagService;
     this._copyProductService = copyProductService;
     this._pdfService = pdfService;
     this._exportManager = exportManager;
     this._importManager = importManager;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
     this._aclService = aclService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._vendorService = vendorService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._pdfSettings = pdfSettings;
     this._adminAreaSettings = adminAreaSettings;
 }
 public NewsController(INewsService newsService, ILanguageService languageService,
     IDateTimeHelper dateTimeHelper, ICustomerContentService customerContentService,
     ILocalizationService localizationService, IPermissionService permissionService,
     IUrlRecordService urlRecordService, IStoreService storeService, IStoreMappingService storeMappingService)
 {
     this._newsService = newsService;
     this._languageService = languageService;
     this._dateTimeHelper = dateTimeHelper;
     this._customerContentService = customerContentService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._urlRecordService = urlRecordService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
 }
예제 #22
0
 public BlogController(IBlogService blogService, ILanguageService languageService,
     IDateTimeHelper dateTimeHelper, 
     ILocalizationService localizationService, IPermissionService permissionService,
     IUrlRecordService urlRecordService,
     IStoreService storeService, IStoreMappingService storeMappingService)
 {
     this._blogService = blogService;
     this._languageService = languageService;
     this._dateTimeHelper = dateTimeHelper;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._urlRecordService = urlRecordService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
 }
예제 #23
0
        public ForumController(IForumService forumService,
			ICommonServices services,
            IDateTimeHelper dateTimeHelper,
			IStoreMappingService storeMappingService,
			ILanguageService languageService,
			ILocalizedEntityService localizedEntityService,
			IUrlRecordService urlRecordService)
        {
            _forumService = forumService;
            _services = services;
            _dateTimeHelper = dateTimeHelper;
            _storeMappingService = storeMappingService;
            _languageService = languageService;
            _localizedEntityService = localizedEntityService;
            _urlRecordService = urlRecordService;
        }
예제 #24
0
        public CommonController(
			Lazy<IPaymentService> paymentService,
			Lazy<IShippingService> shippingService,
            Lazy<ICurrencyService> currencyService,
			Lazy<IMeasureService> measureService,
            ICustomerService customerService,
			IUrlRecordService urlRecordService, 
			IWebHelper webHelper,
			Lazy<CurrencySettings> currencySettings,
            Lazy<MeasureSettings> measureSettings,
			Lazy<IDateTimeHelper> dateTimeHelper,
            ILanguageService languageService,
			IWorkContext workContext,
			IStoreContext storeContext,
            IPermissionService permissionService,
			ILocalizationService localizationService,
            Lazy<IImageCache> imageCache,
			Lazy<SecuritySettings> securitySettings,
			Lazy<IMenuPublisher> menuPublisher,
            Lazy<IPluginFinder> pluginFinder,
            IGenericAttributeService genericAttributeService,
			IDbContext dbContext,
			Func<string, ICacheManager> cache)
        {
            this._paymentService = paymentService;
            this._shippingService = shippingService;
            this._currencyService = currencyService;
            this._measureService = measureService;
            this._customerService = customerService;
            this._urlRecordService = urlRecordService;
            this._webHelper = webHelper;
            this._currencySettings = currencySettings;
            this._measureSettings = measureSettings;
            this._dateTimeHelper = dateTimeHelper;
            this._languageService = languageService;
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._permissionService = permissionService;
            this._localizationService = localizationService;
            this._imageCache = imageCache;
            this._securitySettings = securitySettings;
            this._menuPublisher = menuPublisher;
            this._pluginFinder = pluginFinder;
            this._genericAttributeService = genericAttributeService;
            this._dbContext = dbContext;
            this._cache = cache;
        }
 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,
     IDiscountService discountService,
     ICustomerActivityService customerActivityService, 
     IVendorService vendorService,
     IAclService aclService,
     IPermissionService permissionService,
     CatalogSettings catalogSettings,
     IWorkContext workContext,
     IImportManager importManager, 
     ICacheManager cacheManager)
 {
     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._discountService = discountService;
     this._customerActivityService = customerActivityService;
     this._vendorService = vendorService;
     this._aclService = aclService;
     this._permissionService = permissionService;
     this._catalogSettings = catalogSettings;
     this._workContext = workContext;
     this._importManager = importManager;
     this._cacheManager = cacheManager;
 }
예제 #26
0
 public TopicController(ITopicService topicService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService, 
     ILocalizationService localizationService,
     IPermissionService permissionService, 
     IStoreService storeService,
     IStoreMappingService storeMappingService,
     IUrlRecordService urlRecordService)
 {
     this._topicService = topicService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._urlRecordService = urlRecordService;
 }
 public VendorController(ICustomerService customerService, 
     ILocalizationService localizationService,
     IVendorService vendorService, 
     IPermissionService permissionService,
     IUrlRecordService urlRecordService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService,
     VendorSettings vendorSettings)
 {
     this._customerService = customerService;
     this._localizationService = localizationService;
     this._vendorService = vendorService;
     this._permissionService = permissionService;
     this._urlRecordService = urlRecordService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._vendorSettings = vendorSettings;
 }
		private readonly static object _lock = new object();	// codehint: sm-add

        #endregion

        #region Constructors

        public CommonController(IPaymentService paymentService,
			IShippingService shippingService,
            ICurrencyService currencyService,
			IMeasureService measureService,
            ICustomerService customerService,
			IUrlRecordService urlRecordService, 
			IWebHelper webHelper,
			CurrencySettings currencySettings,
            MeasureSettings measureSettings,
			IDateTimeHelper dateTimeHelper,
            ILanguageService languageService,
			IWorkContext workContext,
			IStoreContext storeContext,
            IPermissionService permissionService,
			ILocalizationService localizationService,
            IImageCache imageCache,
			SecuritySettings securitySettings,
			ITypeFinder typeFinder,
            IPluginFinder pluginFinder,
            IGenericAttributeService genericAttributeService,
			IDbContext dbContext)
        {
            this._paymentService = paymentService;
            this._shippingService = shippingService;
            this._currencyService = currencyService;
            this._measureService = measureService;
            this._customerService = customerService;
            this._urlRecordService = urlRecordService;
            this._webHelper = webHelper;
            this._currencySettings = currencySettings;
            this._measureSettings = measureSettings;
            this._dateTimeHelper = dateTimeHelper;
            this._languageService = languageService;
            this._workContext = workContext;
			this._storeContext = storeContext;
            this._permissionService = permissionService;
            this._localizationService = localizationService;
            this._imageCache = imageCache; // codehint: sm-add
            this._securitySettings = securitySettings; // codehint: sm-add
            this._typeFinder = typeFinder; // codehint: sm-add
			this._pluginFinder = pluginFinder;	// codehint: sm-add
            this._genericAttributeService = genericAttributeService; // codehint: sm-add
			this._dbContext = dbContext;	// codehint: sm-add
        }
예제 #29
0
 public ProjectController(IPermissionService permissionService,
     IProjectService projectService, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     ILocalizedEntityService localizedEntityService, 
     IPictureService pictureService, 
     IUrlRecordService urlRecordService, 
     ICustomerActivityService customerActivityService, IDateTimeHelper dateTimeHelper)
 {
     _permissionService = permissionService;
     _projectService = projectService;
     _languageService = languageService;
     _localizationService = localizationService;
     _localizedEntityService = localizedEntityService;
     _pictureService = pictureService;
     _urlRecordService = urlRecordService;
     _customerActivityService = customerActivityService;
     _dateTimeHelper = dateTimeHelper;
 }
        public VendorController(IWorkContext workContext, 
            ILocalizationService localizationService,
            ICustomerService customerService,
            IWorkflowMessageService workflowMessageService,
            IVendorService vendorService,
            IUrlRecordService urlRecordService,
            LocalizationSettings localizationSettings,
            VendorSettings vendorSettings)
        {
            this._workContext = workContext;
            this._localizationService = localizationService;
            this._customerService = customerService;
            this._workflowMessageService = workflowMessageService;
            this._vendorService = vendorService;
            this._urlRecordService = urlRecordService;

            this._localizationSettings = localizationSettings;
            this._vendorSettings = vendorSettings;
        }
예제 #31
0
 public void SetUp()
 {
     _urlRecordService = GetService <IUrlRecordService>();
 }
 public GroupDealsController(
     IProductService productService,
     IProductTemplateService productTemplateService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService,
     IProductTagService productTagService,
     ICopyProductService copyProductService,
     IPdfService pdfService,
     IExportManager exportManager,
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService,
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
     IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     IRepository <GroupDeal> groupDealRepo,
     IRepository <GroupdealPicture> groupdealPictureRepo,
     IGroupDealService groupdealService,
     IGenericAttributeService genericAttributeService)
     : base(productService,
            productTemplateService,
            categoryService,
            manufacturerService,
            customerService,
            urlRecordService,
            workContext,
            languageService,
            localizationService,
            localizedEntityService,
            specificationAttributeService,
            pictureService,
            taxCategoryService,
            productTagService,
            copyProductService,
            pdfService,
            exportManager,
            importManager,
            customerActivityService,
            permissionService,
            aclService,
            storeService,
            orderService,
            storeMappingService,
            vendorService,
            shippingService,
            shipmentService,
            currencyService,
            currencySettings,
            measureService,
            measureSettings,
            adminAreaSettings,
            dateTimeHelper,
            discountService,
            productAttributeService,
            backInStockSubscriptionService,
            shoppingCartService,
            productAttributeFormatter,
            productAttributeParser,
            downloadService,
            groupDealRepo,
            groupdealPictureRepo,
            groupdealService,
            genericAttributeService)
 {
 }
 public mobSocialApiController(IPermissionService permissionService,
                               IWorkContext workContext, AdminAreaSettings adminAreaSettings, ILocalizationService localizationService,
                               IPictureService pictureService, IMobSocialService socialNetworkService, ICustomerService customerService,
                               ICustomerAlbumPictureService customerAlbumPictureService, mobSocialSettings mobSocialSettings, MediaSettings mediaSettings, CustomerSettings customerSettings,
                               ForumSettings forumSettings, RewardPointsSettings rewardPointsSettings, OrderSettings orderSettings,
                               IStoreContext storeContext, IWebHelper webHelper, IUrlRecordService urlRecordService, IRepository <UrlRecord> urlRecordRepository,
                               ICustomerVideoAlbumService customerVideoAlbumService, CustomerProfileViewService customerProfileViewService)
 {
     _permissionService           = permissionService;
     _workContext                 = workContext;
     _adminAreaSettings           = adminAreaSettings;
     _localizationService         = localizationService;
     _pictureService              = pictureService;
     _socialNetworkService        = socialNetworkService;
     _customerService             = customerService;
     _customerAlbumPictureService = customerAlbumPictureService;
     _mobSocialSettings           = mobSocialSettings;
     _mediaSettings               = mediaSettings;
     _customerSettings            = customerSettings;
     _forumSettings               = forumSettings;
     _rewardPointsSettings        = rewardPointsSettings;
     _orderSettings               = orderSettings;
     _storeContext                = storeContext;
     _webHelper                  = webHelper;
     _urlRecordService           = urlRecordService;
     _urlRecordRepository        = urlRecordRepository;
     _customerVideoAlbumService  = customerVideoAlbumService;
     _customerProfileViewService = customerProfileViewService;
 }
예제 #34
0
 public EntityMediaService(IMobRepository <EntityMedia> repository, IWorkContext workContext, IUrlRecordService urlRecordService) : base(repository, workContext, urlRecordService)
 {
 }
예제 #35
0
 public CatalogApiController(
     ShoppingCartSettings shoppingCartSettings,
     LocalizationSettings localizationSettings,
     IWorkflowMessageService workflowMessageService,
     IOrderService orderService,
     IOrderReportService orderReportService,
     IPriceFormatter priceFormatter,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     IUrlRecordService urlRecordService,
     IWebHelper webHelper,
     ICatalogModelFactory catalogModelService,
     IProductModelFactory productModelFactory,
     ITopicModelFactory topicModelFactory,
     ICategoryService categoryService,
     IProductService productService,
     IProductTagService productTagService,
     ILocalizationService localizationService,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     IPermissionService permissionService,
     ICustomerActivityService customerActivityService,
     CatalogSettings catalogSettings,
     IStoreContext storeContext,
     IWorkContext workContext,
     IShoppingCartService shoppingCartService,
     IEventPublisher eventPublisher,
     IVendorService vendorService,
     ICustomerService customerService,
     IDateTimeHelper dateTimeHelper,
     IStaticCacheManager staticCacheManager,
     ISettingService settingService)
 {
     _shoppingCartSettings          = shoppingCartSettings;
     _localizationSettings          = localizationSettings;
     _workflowMessageService        = workflowMessageService;
     _orderReportService            = orderReportService;
     _orderService                  = orderService;
     _priceFormatter                = priceFormatter;
     _specificationAttributeService = specificationAttributeService;
     _pictureService                = pictureService;
     _urlRecordService              = urlRecordService;
     _webHelper                     = webHelper;
     _categoryService               = categoryService;
     _catalogModelFactory           = catalogModelService;
     _topicModelFactory             = topicModelFactory;
     _productService                = productService;
     _productTagService             = productTagService;
     _shoppingCartService           = shoppingCartService;
     _localizationService           = localizationService;
     _recentlyViewedProductsService = recentlyViewedProductsService;
     _aclService                    = aclService;
     _storeMappingService           = storeMappingService;
     _permissionService             = permissionService;
     _customerActivityService       = customerActivityService;
     _catalogSettings               = catalogSettings;
     _storeContext                  = storeContext;
     _productModelFactory           = productModelFactory;
     _workContext                   = workContext;
     _vendorService                 = vendorService;
     _eventPublisher                = eventPublisher;
     _customerService               = customerService;
     _dateTimeHelper                = dateTimeHelper;
     _staticCacheManager            = staticCacheManager;
     _settingService                = settingService;
 }
예제 #36
0
 public OverriddenProductController(AvalaraTaxManager avalaraTaxManager,
                                    IAclService aclService,
                                    IBackInStockSubscriptionService backInStockSubscriptionService,
                                    ICategoryService categoryService,
                                    ICopyProductService copyProductService,
                                    ICustomerActivityService customerActivityService,
                                    ICustomerService customerService,
                                    IDiscountService discountService,
                                    IDownloadService downloadService,
                                    IExportManager exportManager,
                                    IImportManager importManager,
                                    ILanguageService languageService,
                                    ILocalizationService localizationService,
                                    ILocalizedEntityService localizedEntityService,
                                    IManufacturerService manufacturerService,
                                    INopFileProvider fileProvider,
                                    INotificationService notificationService,
                                    IPdfService pdfService,
                                    IPermissionService permissionService,
                                    IPictureService pictureService,
                                    IProductAttributeParser productAttributeParser,
                                    IProductAttributeService productAttributeService,
                                    IProductModelFactory productModelFactory,
                                    IProductService productService,
                                    IProductTagService productTagService,
                                    ISettingService settingService,
                                    IShippingService shippingService,
                                    IShoppingCartService shoppingCartService,
                                    ISpecificationAttributeService specificationAttributeService,
                                    ITaxCategoryService taxCategoryService,
                                    ITaxPluginManager taxPluginManager,
                                    IUrlRecordService urlRecordService,
                                    IWorkContext workContext,
                                    VendorSettings vendorSettings) : base(aclService,
                                                                          backInStockSubscriptionService,
                                                                          categoryService,
                                                                          copyProductService,
                                                                          customerActivityService,
                                                                          customerService,
                                                                          discountService,
                                                                          downloadService,
                                                                          exportManager,
                                                                          importManager,
                                                                          languageService,
                                                                          localizationService,
                                                                          localizedEntityService,
                                                                          manufacturerService,
                                                                          fileProvider,
                                                                          notificationService,
                                                                          pdfService,
                                                                          permissionService,
                                                                          pictureService,
                                                                          productAttributeParser,
                                                                          productAttributeService,
                                                                          productModelFactory,
                                                                          productService,
                                                                          productTagService,
                                                                          settingService,
                                                                          shippingService,
                                                                          shoppingCartService,
                                                                          specificationAttributeService,
                                                                          urlRecordService,
                                                                          workContext,
                                                                          vendorSettings)
 {
     _avalaraTaxManager       = avalaraTaxManager;
     _localizationService     = localizationService;
     _notificationService     = notificationService;
     _permissionService       = permissionService;
     _productAttributeService = productAttributeService;
     _productService          = productService;
     _taxCategoryService      = taxCategoryService;
     _taxPluginManager        = taxPluginManager;
 }
예제 #37
0
        public static async Task <List <LocalizedProperty> > ToLocalizedProperty <T, E>(this IList <T> list, E entity, Expression <Func <T, string> > keySelector,
                                                                                        SeoSettings _seoSettings, IUrlRecordService _urlRecordService, ILanguageService _languageService) where T : ILocalizedModelLocal where E : BaseEntity, ISlugSupported
        {
            var local = new List <LocalizedProperty>();

            foreach (var item in list)
            {
                Type[]         interfaces = item.GetType().GetInterfaces();
                PropertyInfo[] props      = item.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
                foreach (var prop in props)
                {
                    bool insert = true;

                    foreach (var i in interfaces)
                    {
                        if (i.HasProperty(prop.Name) && typeof(ILocalizedModelLocal).IsAssignableFrom(i))
                        {
                            insert = false;
                        }
                        if (i.HasProperty(prop.Name) && typeof(ISlugModelLocal).IsAssignableFrom(i))
                        {
                            var member = keySelector.Body as MemberExpression;
                            if (member == null)
                            {
                                throw new ArgumentException(string.Format(
                                                                "Expression '{0}' refers to a method, not a property.",
                                                                keySelector));
                            }
                            var propInfo = member.Member as PropertyInfo;
                            if (propInfo == null)
                            {
                                throw new ArgumentException(string.Format(
                                                                "Expression '{0}' refers to a field, not a property.",
                                                                keySelector));
                            }
                            var value = item.GetType().GetProperty(propInfo.Name).GetValue(item, null);
                            if (value != null)
                            {
                                var name      = value.ToString();
                                var itemvalue = prop.GetValue(item) ?? "";
                                var seName    = await entity.ValidateSeName(itemvalue.ToString(), name, false, _seoSettings, _urlRecordService, _languageService);

                                prop.SetValue(item, seName);
                                await _urlRecordService.SaveSlug(entity, seName, item.LanguageId);
                            }
                            else
                            {
                                var itemvalue = prop.GetValue(item) ?? "";
                                if (itemvalue != null && !string.IsNullOrEmpty(itemvalue.ToString()))
                                {
                                    var seName = await entity.ValidateSeName(itemvalue.ToString(), "", false, _seoSettings, _urlRecordService, _languageService);

                                    prop.SetValue(item, seName);
                                    await _urlRecordService.SaveSlug(entity, seName, item.LanguageId);
                                }
                                else
                                {
                                    insert = false;
                                }
                            }
                        }
                    }

                    if (insert && prop.GetValue(item) != null)
                    {
                        local.Add(new LocalizedProperty()
                        {
                            LanguageId  = item.LanguageId,
                            LocaleKey   = prop.Name,
                            LocaleValue = prop.GetValue(item).ToString(),
                        });
                    }
                }
            }
            return(local);
        }
예제 #38
0
        public static string ValidateSeName <T>(this T entity,
                                                string seName,
                                                string name,
                                                bool ensureNotEmpty,
                                                IUrlRecordService urlRecordService,
                                                SeoSettings seoSettings,
                                                int?languageId = null,
                                                Func <string, UrlRecord> extraSlugLookup = null)
            where T : BaseEntity, ISlugSupported
        {
            Guard.NotNull(urlRecordService, nameof(urlRecordService));
            Guard.NotNull(seoSettings, nameof(seoSettings));
            Guard.NotNull(entity, nameof(entity));

            // use name if sename is not specified
            if (String.IsNullOrWhiteSpace(seName) && !String.IsNullOrWhiteSpace(name))
            {
                seName = name;
            }

            // validation
            seName = GetSeName(seName, seoSettings);

            // max length
            seName = seName.Truncate(400);

            if (String.IsNullOrWhiteSpace(seName))
            {
                if (ensureNotEmpty)
                {
                    // use entity identifier as sename if empty
                    seName = entity.Id.ToString();
                }
                else
                {
                    // return. no need for further processing
                    return(seName);
                }
            }

            // validate and alter SeName if it could be interpreted as SEO code
            if (LocalizationHelper.IsValidCultureCode(seName))
            {
                if (seName.Length == 2)
                {
                    seName += "-0";
                }
            }

            // ensure this sename is not reserved yet
            string entityName = entity.GetEntityName();
            int    i          = 2;
            var    tempSeName = seName;

            while (true)
            {
                // check whether such slug already exists (and that it's not the current entity)
                var urlRecord = urlRecordService.GetBySlug(tempSeName) ?? extraSlugLookup?.Invoke(tempSeName);
                var reserved1 = urlRecord != null && !(urlRecord.EntityId == entity.Id && urlRecord.EntityName.Equals(entityName, StringComparison.InvariantCultureIgnoreCase));

                if (!reserved1 && urlRecord != null && languageId.HasValue)
                {
                    reserved1 = (urlRecord.LanguageId != languageId.Value);
                }

                // and it's not in the list of reserved slugs
                var reserved2 = seoSettings.ReservedUrlRecordSlugs.Contains(tempSeName, StringComparer.InvariantCultureIgnoreCase);
                if (!reserved1 && !reserved2)
                {
                    break;
                }

                tempSeName = string.Format("{0}-{1}", seName, i);
                i++;
            }
            seName = tempSeName;

            return(seName);
        }
 public BlogPostDeletedEventHandler(IUrlRecordService urlRecordService)
 {
     _urlRecordService = urlRecordService;
 }
 public VendorViewModelService(IDiscountService discountService, IVendorService vendorService, ICustomerService customerService, ILocalizationService localizationService,
                               IDateTimeHelper dateTimeHelper, ICountryService countryService, IStateProvinceService stateProvinceService, IStoreService storeService, IUrlRecordService urlRecordService,
                               IPictureService pictureService, IMediator mediator, VendorSettings vendorSettings, ILanguageService languageService,
                               SeoSettings seoSettings)
 {
     _discountService      = discountService;
     _vendorService        = vendorService;
     _customerService      = customerService;
     _localizationService  = localizationService;
     _dateTimeHelper       = dateTimeHelper;
     _countryService       = countryService;
     _stateProvinceService = stateProvinceService;
     _storeService         = storeService;
     _urlRecordService     = urlRecordService;
     _pictureService       = pictureService;
     _mediator             = mediator;
     _languageService      = languageService;
     _vendorSettings       = vendorSettings;
     _seoSettings          = seoSettings;
 }
예제 #41
0
 protected BaseEntityService(IMobRepository <T> repository, IWorkContext workContext,
                             IUrlRecordService urlRecordService) : this(repository)
 {
     _workContext      = workContext;
     _urlRecordService = urlRecordService;
 }
예제 #42
0
        public CommodityModelFactory(CatalogSettings catalogSettings,
                                     CurrencySettings currencySettings,
                                     IAclSupportedModelFactory aclSupportedModelFactory,
                                     IBaseAdminModelFactory baseAdminModelFactory,
                                     ICategoryService categoryService,
                                     ICurrencyService currencyService,
                                     ICustomerService customerService,
                                     IDateTimeHelper dateTimeHelper,
                                     IDiscountService discountService,
                                     IDiscountSupportedModelFactory discountSupportedModelFactory,
                                     ILocalizationService localizationService,
                                     ILocalizedModelFactory localizedModelFactory,
                                     IManufacturerService manufacturerService,
                                     IMeasureService measureService,
                                     IOrderService orderService,
                                     IPictureService pictureService,
                                     IProductAttributeFormatter productAttributeFormatter,
                                     IProductAttributeParser productAttributeParser,
                                     IProductAttributeService productAttributeService,
                                     IProductService productService,
                                     IProductTagService productTagService,
                                     IProductTemplateService productTemplateService,
                                     ISettingModelFactory settingModelFactory,
                                     IShipmentService shipmentService,
                                     IShippingService shippingService,
                                     IShoppingCartService shoppingCartService,
                                     ISpecificationAttributeService specificationAttributeService,
                                     IStaticCacheManager cacheManager,
                                     IStoreMappingSupportedModelFactory storeMappingSupportedModelFactory,
                                     IStoreService storeService,
                                     IUrlRecordService urlRecordService,
                                     IWorkContext workContext,
                                     MeasureSettings measureSettings,
                                     TaxSettings taxSettings,
                                     VendorSettings vendorSettings,

                                     ICommodityService commodityService
                                     )
        {
            _catalogSettings                   = catalogSettings;
            _currencySettings                  = currencySettings;
            _aclSupportedModelFactory          = aclSupportedModelFactory;
            _baseAdminModelFactory             = baseAdminModelFactory;
            _cacheManager                      = cacheManager;
            _categoryService                   = categoryService;
            _currencyService                   = currencyService;
            _customerService                   = customerService;
            _dateTimeHelper                    = dateTimeHelper;
            _discountService                   = discountService;
            _discountSupportedModelFactory     = discountSupportedModelFactory;
            _localizationService               = localizationService;
            _localizedModelFactory             = localizedModelFactory;
            _manufacturerService               = manufacturerService;
            _measureService                    = measureService;
            _measureSettings                   = measureSettings;
            _orderService                      = orderService;
            _pictureService                    = pictureService;
            _productAttributeFormatter         = productAttributeFormatter;
            _productAttributeParser            = productAttributeParser;
            _productAttributeService           = productAttributeService;
            _productService                    = productService;
            _productTagService                 = productTagService;
            _productTemplateService            = productTemplateService;
            _settingModelFactory               = settingModelFactory;
            _shipmentService                   = shipmentService;
            _shippingService                   = shippingService;
            _shoppingCartService               = shoppingCartService;
            _specificationAttributeService     = specificationAttributeService;
            _storeMappingSupportedModelFactory = storeMappingSupportedModelFactory;
            _storeService                      = storeService;
            _urlRecordService                  = urlRecordService;
            _workContext    = workContext;
            _taxSettings    = taxSettings;
            _vendorSettings = vendorSettings;

            _commodityService = commodityService;
        }
 public BlogViewModelService(IBlogService blogService, IDateTimeHelper dateTimeHelper, IStoreService storeService, IUrlRecordService urlRecordService,
                             IStoreMappingService storeMappingService, IPictureService pictureService, ICustomerService customerService, ILocalizationService localizationService)
 {
     _blogService         = blogService;
     _dateTimeHelper      = dateTimeHelper;
     _storeService        = storeService;
     _storeMappingService = storeMappingService;
     _urlRecordService    = urlRecordService;
     _pictureService      = pictureService;
     _customerService     = customerService;
     _localizationService = localizationService;
 }
예제 #44
0
 public CategoryImageViewComponent(
     SpecificationAttributesSettings specificationAttributesSettings,
     ICustomerService customerService,
     ILanguageService languageService,
     ISettingService settingService,
     IStoreService storeService,
     IWorkContext workContext,
     ILocalizationService localizationService,
     IGenericAttributeService genericAttributeService,
     IVendorService vendorService,
     IProductService productService,
     IStoreContext storeContext,
     ISpecificationAttributeService specificationAttributeService,
     IWebHelper webHelper,
     IPriceFormatter priceFormatter,
     ICurrencyService currencyService,
     CatalogSettings catalogSettings,
     ICategoryService categoryService,
     ICacheManager cacheManager,
     MediaSettings mediaSettings,
     IPriceCalculationService priceCalculationService,
     IPermissionService permissionService,
     ITaxService taxService,
     IPictureService pictureService,
     IMeasureService measureService,
     IUrlRecordService urlRecordService,
     IProductModelFactory productModelFactory,
     IOrderService orderService,
     OrderSettings orderSettings,
     IOrderProcessingService orderProcessingService,
     IProductAttributeParser productAttributeParser,
     ILogger logger,
     ShoppingCartSettings shoppingCartSettings,
     IShoppingCartModelFactory shoppingCartModelFactory)
 {
     _specificationAttributesSettings = specificationAttributesSettings;
     _customerService               = customerService;
     _languageService               = languageService;
     _settingService                = settingService;
     _storeService                  = storeService;
     _localizationService           = localizationService;
     _workContext                   = workContext;
     _genericAttributeService       = genericAttributeService;
     _vendorService                 = vendorService;
     _productService                = productService;
     _storeContext                  = storeContext;
     _specificationAttributeService = specificationAttributeService;
     _webHelper               = webHelper;
     _priceFormatter          = priceFormatter;
     _currencyService         = currencyService;
     _catalogSettings         = catalogSettings;
     _categoryService         = categoryService;
     _cacheManager            = cacheManager;
     _mediaSettings           = mediaSettings;
     _priceCalculationService = priceCalculationService;
     _permissionService       = permissionService;
     _taxService              = taxService;
     _pictureService          = pictureService;
     _measureService          = measureService;
     _urlRecordService        = urlRecordService;
     _productModelFactory     = productModelFactory;
     _orderSettings           = orderSettings;
     _orderProcessingService  = orderProcessingService;
     _orderService            = orderService;
     _productAttributeParser  = productAttributeParser;
     _logger = logger;
     this._shoppingCartSettings     = shoppingCartSettings;
     this._shoppingCartModelFactory = shoppingCartModelFactory;
 }
예제 #45
0
 public BaseService(IRepository <T> repository, IRepository <P> pictureRepository, IWorkContext workContext, IUrlRecordService urlRecordService)
 {
     _repository        = repository;
     _pictureRepository = pictureRepository;
     _workContext       = workContext;
     _urlRecordService  = urlRecordService;
 }
        public CategoryApiService(IMongoDBContext mongoDBContext, ICategoryService categoryService, IUrlRecordService urlRecordService, IPictureService pictureService,
                                  ICustomerActivityService customerActivityService, ILocalizationService localizationService)
        {
            _mongoDBContext          = mongoDBContext;
            _categoryService         = categoryService;
            _urlRecordService        = urlRecordService;
            _pictureService          = pictureService;
            _customerActivityService = customerActivityService;
            _localizationService     = localizationService;

            _category = _mongoDBContext.Database().GetCollection <CategoryDto>(typeof(Core.Domain.Catalog.Category).Name);
        }
예제 #47
0
 public KnowledgebaseViewModelService(ILocalizationService localizationService,
                                      IKnowledgebaseService knowledgebaseService, ICustomerActivityService customerActivityService,
                                      ICustomerService customerService, IDateTimeHelper dateTimeHelper, IUrlRecordService urlRecordService)
 {
     _localizationService     = localizationService;
     _knowledgebaseService    = knowledgebaseService;
     _customerActivityService = customerActivityService;
     _customerService         = customerService;
     _dateTimeHelper          = dateTimeHelper;
     _urlRecordService        = urlRecordService;
 }
예제 #48
0
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           IBlogService blogService,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INewsService newsService,
                           INopFileProvider fileProvider,
                           INopHtmlHelper nopHtmlHelper,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           IShoppingCartService shoppingCartService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager staticCacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           MediaSettings mediaSettings,
                           NewsSettings newsSettings,
                           SitemapSettings sitemapSettings,
                           SitemapXmlSettings sitemapXmlSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     _blogSettings     = blogSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     _forumSettings           = forumSettings;
     _actionContextAccessor   = actionContextAccessor;
     _blogService             = blogService;
     _categoryService         = categoryService;
     _currencyService         = currencyService;
     _customerService         = customerService;
     _forumService            = forumService;
     _genericAttributeService = genericAttributeService;
     _httpContextAccessor     = httpContextAccessor;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _manufacturerService     = manufacturerService;
     _newsService             = newsService;
     _fileProvider            = fileProvider;
     _nopHtmlHelper           = nopHtmlHelper;
     _permissionService       = permissionService;
     _pictureService          = pictureService;
     _productService          = productService;
     _productTagService       = productTagService;
     _shoppingCartService     = shoppingCartService;
     _sitemapGenerator        = sitemapGenerator;
     _staticCacheManager      = staticCacheManager;
     _storeContext            = storeContext;
     _themeContext            = themeContext;
     _themeProvider           = themeProvider;
     _topicService            = topicService;
     _urlHelperFactory        = urlHelperFactory;
     _urlRecordService        = urlRecordService;
     _webHelper                = webHelper;
     _workContext              = workContext;
     _mediaSettings            = mediaSettings;
     _localizationSettings     = localizationSettings;
     _newsSettings             = newsSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }
예제 #49
0
 public CommonModelFactory(AdminAreaSettings adminAreaSettings,
                           CatalogSettings catalogSettings,
                           CurrencySettings currencySettings,
                           IActionContextAccessor actionContextAccessor,
                           IAuthenticationPluginManager authenticationPluginManager,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           INopDataProvider dataProvider,
                           IDateTimeHelper dateTimeHelper,
                           INopFileProvider fileProvider,
                           IExchangeRatePluginManager exchangeRatePluginManager,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IMaintenanceService maintenanceService,
                           IMeasureService measureService,
                           IOrderService orderService,
                           IPaymentPluginManager paymentPluginManager,
                           IPickupPluginManager pickupPluginManager,
                           IPluginService pluginService,
                           IProductService productService,
                           IReturnRequestService returnRequestService,
                           ISearchTermService searchTermService,
                           IShippingPluginManager shippingPluginManager,
                           IStaticCacheManager staticCacheManager,
                           IStoreContext storeContext,
                           IStoreService storeService,
                           ITaxPluginManager taxPluginManager,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWidgetPluginManager widgetPluginManager,
                           IWorkContext workContext,
                           MeasureSettings measureSettings,
                           NopConfig nopConfig,
                           NopHttpClient nopHttpClient,
                           ProxySettings proxySettings)
 {
     _adminAreaSettings           = adminAreaSettings;
     _catalogSettings             = catalogSettings;
     _currencySettings            = currencySettings;
     _actionContextAccessor       = actionContextAccessor;
     _authenticationPluginManager = authenticationPluginManager;
     _currencyService             = currencyService;
     _customerService             = customerService;
     _dataProvider              = dataProvider;
     _dateTimeHelper            = dateTimeHelper;
     _exchangeRatePluginManager = exchangeRatePluginManager;
     _httpContextAccessor       = httpContextAccessor;
     _languageService           = languageService;
     _localizationService       = localizationService;
     _maintenanceService        = maintenanceService;
     _measureService            = measureService;
     _fileProvider              = fileProvider;
     _orderService              = orderService;
     _paymentPluginManager      = paymentPluginManager;
     _pickupPluginManager       = pickupPluginManager;
     _pluginService             = pluginService;
     _productService            = productService;
     _returnRequestService      = returnRequestService;
     _searchTermService         = searchTermService;
     _shippingPluginManager     = shippingPluginManager;
     _staticCacheManager        = staticCacheManager;
     _storeContext              = storeContext;
     _storeService              = storeService;
     _taxPluginManager          = taxPluginManager;
     _urlHelperFactory          = urlHelperFactory;
     _urlRecordService          = urlRecordService;
     _webHelper           = webHelper;
     _widgetPluginManager = widgetPluginManager;
     _workContext         = workContext;
     _measureSettings     = measureSettings;
     _nopConfig           = nopConfig;
     _nopHttpClient       = nopHttpClient;
     _proxySettings       = proxySettings;
 }
예제 #50
0
        internal static void Import(КоммерческаяИнформация source,
                                    ICategoryService categoryService,
                                    ISpecificationAttributeService specificationAttributeService,
                                    IManufacturerService manufacturerService,
                                    IProductService productService,
                                    IUrlRecordService urlRecordService,
                                    IPictureService pictureService,
                                    List <Category> categories,
                                    Dictionary <string, int> categoryMappings,
                                    List <SpecificationAttribute> attributes,
                                    Dictionary <string, int> attributesMappings,
                                    List <Manufacturer> manufacturers,
                                    Dictionary <string, int> manufacturersMappings,
                                    string mappingsFile,
                                    string logFile,
                                    ImportCatalogSettings importSettings)

        {
            logFile.Log("Начало импорта товаров");
            var stats = new[] { 0, 0 };

            var mappings = File.Exists(mappingsFile)
                ? JsonConvert.DeserializeObject <Dictionary <string, int> >(File.ReadAllText(mappingsFile))
                : new Dictionary <string, int>();

            foreach (var prod in source.Каталог.Товары)
            {
                try
                {
                    var product = mappings.ContainsKey(prod.Ид)
                        ? productService.GetProductById(mappings[prod.Ид])
                        : null;

                    var deleted = prod.Статус == "Удален";
                    if (product == null)
                    {
                        product = new Product
                        {
                            CreatedOnUtc        = DateTime.Now,
                            UpdatedOnUtc        = DateTime.Now,
                            ProductType         = ProductType.SimpleProduct,
                            ProductTemplateId   = 1,
                            VisibleIndividually = true,
                            Name                 = prod.Наименование,
                            Sku                  = prod.Артикул,
                            ShortDescription     = prod.Описание,
                            FullDescription      = prod.Описание,
                            AllowCustomerReviews = true,
                            Deleted              = deleted,
                            Published            = !deleted,
                            OrderMinimumQuantity = 1,
                            OrderMaximumQuantity = 10000
                        };
                        productService.InsertProduct(product);
                        var seName = product.ValidateSeName(null, product.Name, true);
                        urlRecordService.SaveSlug(product, seName, 0);
                        //logFile.Log($"Новый товар {product.Name} ({product.Id}): {prod.Ид}");
                        stats[0]++;
                    }
                    else
                    {
                        if (!importSettings.UpdateExisting)
                        {
                            //logFile.Log($"Пропущен товар {product.Name} ({product.Id}): {prod.Ид}");
                            stats[1]++;
                            continue;
                        }
                        product.UpdatedOnUtc = DateTime.Now;
                        product.Deleted      = deleted;
                        product.Published    = !deleted;
                        productService.UpdateProduct(product);
                        //logFile.Log($"Обновлен товар {product.Name} ({product.Id}): {prod.Ид}");
                        stats[1]++;
                    }
                    mappings[prod.Ид] = product.Id;

                    if (importSettings.OverwriteManufacturers)
                    {
                        foreach (var manufacturer in product.ProductManufacturers.ToList())
                        {
                            manufacturerService.DeleteProductManufacturer(manufacturer);
                        }
                    }
                    if (prod.Изготовитель != null && manufacturersMappings.ContainsKey(prod.Изготовитель.Ид))
                    {
                        var manufacturerId = manufacturersMappings[prod.Изготовитель.Ид];
                        var manufacturer   = product.ProductManufacturers.FirstOrDefault(m => m.ManufacturerId == manufacturerId);
                        if (manufacturer == null)
                        {
                            manufacturer = new ProductManufacturer
                            {
                                ProductId      = product.Id,
                                ManufacturerId = manufacturerId
                            };
                            manufacturerService.InsertProductManufacturer(manufacturer);
                            product.ProductManufacturers.Add(manufacturer);
                        }
                    }

                    if (importSettings.OverwriteCategories)
                    {
                        foreach (var category in product.ProductCategories.ToList())
                        {
                            categoryService.DeleteProductCategory(category);
                        }
                    }
                    if (prod.Группы != null && categoryMappings.ContainsKey(prod.Группы.Ид))
                    {
                        var categoryId = categoryMappings[prod.Группы.Ид];
                        var category   = product.ProductCategories.FirstOrDefault(c => c.CategoryId == categoryId);
                        if (category == null)
                        {
                            category = new ProductCategory
                            {
                                ProductId  = product.Id,
                                CategoryId = categoryId
                            };
                            categoryService.InsertProductCategory(category);
                            product.ProductCategories.Add(category);
                        }
                    }

                    if (importSettings.ImportSpecificationAttributes && prod.ЗначенияСвойств != null)
                    {
                        foreach (var attr in prod.ЗначенияСвойств)
                        {
                            if (attributesMappings.ContainsKey(attr.Ид))
                            {
                                var emptyOptionKey = $"{attr.Ид}.";
                                if (attributesMappings.ContainsKey(emptyOptionKey))
                                {
                                    var option = product.ProductSpecificationAttributes
                                                 .FirstOrDefault(a => a.SpecificationAttributeOptionId == attributesMappings[emptyOptionKey]);
                                    if (option == null)
                                    {
                                        option = new ProductSpecificationAttribute
                                        {
                                            ProductId         = product.Id,
                                            ShowOnProductPage = true,
                                            AllowFiltering    = false,
                                            SpecificationAttributeOptionId = attributesMappings[emptyOptionKey],
                                            AttributeType = SpecificationAttributeType.CustomText,
                                            CustomValue   = attr.Значение
                                        };
                                        specificationAttributeService.InsertProductSpecificationAttribute(option);
                                        product.ProductSpecificationAttributes.Add(option);
                                    }
                                    else if (option.CustomValue != attr.Значение)
                                    {
                                        option.CustomValue = attr.Значение;
                                        specificationAttributeService.UpdateProductSpecificationAttribute(option);
                                    }
                                }
                                else
                                {
                                    var optionKey = $"{attr.Ид}.{attr.Значение}";

                                    var option = product.ProductSpecificationAttributes
                                                 .FirstOrDefault(o => o.SpecificationAttributeOptionId == attributesMappings[optionKey]);
                                    if (option == null)
                                    {
                                        var attribute = attributes.FirstOrDefault(a => a.Id == attributesMappings[attr.Ид]);
                                        var optionIds = attribute.SpecificationAttributeOptions.Select(o => o.Id);
                                        var options   = product.ProductSpecificationAttributes
                                                        .Where(a => optionIds.Contains(a.SpecificationAttributeOptionId)).ToList();
                                        if (options != null && options.Count > 0)
                                        {
                                            foreach (var opt in options)
                                            {
                                                product.ProductSpecificationAttributes.Remove(opt);
                                                specificationAttributeService.DeleteProductSpecificationAttribute(opt);
                                            }
                                        }

                                        option = new ProductSpecificationAttribute
                                        {
                                            ProductId         = product.Id,
                                            ShowOnProductPage = true,
                                            AllowFiltering    = true,
                                            SpecificationAttributeOptionId = attributesMappings[optionKey],
                                            AttributeType = SpecificationAttributeType.Option
                                        };
                                        specificationAttributeService.InsertProductSpecificationAttribute(option);
                                        product.ProductSpecificationAttributes.Add(option);
                                    }
                                }
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(prod.Картинка))
                    {
                        // todo: compare with existing images
                        var picturePath = HttpContext.Current.Request.MapPath($"~/Content/{prod.Картинка}");
                        var picture     = LoadPicture(pictureService, picturePath, product.Name);
                        if (picture != null)
                        {
                            product.ProductPictures.Add(new ProductPicture
                            {
                                DisplayOrder = 1,
                                PictureId    = picture.Id,
                                ProductId    = product.Id
                            });
                        }
                    }

                    File.WriteAllText(mappingsFile, JsonConvert.SerializeObject(mappings, Formatting.Indented), Encoding.UTF8);
                }
                catch (Exception ex)
                {
                    logFile.Log($"Ошибка при обработке товара {prod.Ид} ({prod.Наименование}): {ex}");
                }
            }

            logFile.Log($"Импорт товаров завершен. Добавлено: {stats[0]}. Обновлено: {stats[1]}.");
        }
예제 #51
0
 public BaseEntityWithPictureService(IMobRepository <T> repository, IMobRepository <P> pictureRepository, IPictureService pictureService, IWorkContext workContext, IUrlRecordService urlRecordService)
     : base(repository, workContext, urlRecordService)
 {
     _repository        = repository;
     _pictureRepository = pictureRepository;
     _pictureService    = pictureService;
     _workContext       = workContext;
     _urlRecordService  = urlRecordService;
 }
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHostingEnvironment hostingEnvironment,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INopFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           ISitemapGenerator sitemapGenerator,
                           IShoppingCartService shoppingCartService,
                           IStaticCacheManager cacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           NewsSettings newsSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     this._blogSettings     = blogSettings;
     this._captchaSettings  = captchaSettings;
     this._catalogSettings  = catalogSettings;
     this._commonSettings   = commonSettings;
     this._customerSettings = customerSettings;
     this._displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     this._forumSettings           = forumSettings;
     this._actionContextAccessor   = actionContextAccessor;
     this._categoryService         = categoryService;
     this._currencyService         = currencyService;
     this._customerService         = customerService;
     this._forumService            = forumService;
     this._genericAttributeService = genericAttributeService;
     this._hostingEnvironment      = hostingEnvironment;
     this._languageService         = languageService;
     this._localizationService     = localizationService;
     this._manufacturerService     = manufacturerService;
     this._fileProvider            = fileProvider;
     this._pageHeadBuilder         = pageHeadBuilder;
     this._permissionService       = permissionService;
     this._pictureService          = pictureService;
     this._productService          = productService;
     this._productTagService       = productTagService;
     this._sitemapGenerator        = sitemapGenerator;
     this._shoppingCartService     = shoppingCartService;
     this._cacheManager            = cacheManager;
     this._storeContext            = storeContext;
     this._themeContext            = themeContext;
     this._themeProvider           = themeProvider;
     this._topicService            = topicService;
     this._urlHelperFactory        = urlHelperFactory;
     this._urlRecordService        = urlRecordService;
     this._webHelper                = webHelper;
     this._workContext              = workContext;
     this._localizationSettings     = localizationSettings;
     this._newsSettings             = newsSettings;
     this._storeInformationSettings = storeInformationSettings;
     this._vendorSettings           = vendorSettings;
 }
예제 #53
0
        public static string ValidateSeName <T>(this T entity,
                                                string seName,
                                                string name,
                                                bool ensureNotEmpty,
                                                IUrlRecordService urlRecordService,
                                                SeoSettings seoSettings,
                                                int?languageId = null,
                                                Func <string, UrlRecord> extraSlugLookup = null)
            where T : BaseEntity, ISlugSupported
        {
            Guard.ArgumentNotNull(() => urlRecordService);
            Guard.ArgumentNotNull(() => seoSettings);

            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            //use name if sename is not specified
            if (String.IsNullOrWhiteSpace(seName) && !String.IsNullOrWhiteSpace(name))
            {
                seName = name;
            }

            //validation
            seName = GetSeName(seName, seoSettings);

            //max length
            seName = seName.Truncate(400);

            if (String.IsNullOrWhiteSpace(seName))
            {
                if (ensureNotEmpty)
                {
                    //use entity identifier as sename if empty
                    seName = entity.Id.ToString();
                }
                else
                {
                    //return. no need for further processing
                    return(seName);
                }
            }

            //ensure this sename is not reserved yet
            string entityName = typeof(T).Name;
            int    i          = 2;
            var    tempSeName = seName;

            extraSlugLookup = extraSlugLookup ?? ((s) => null);

            while (true)
            {
                // check whether such slug already exists (and that is not the current product)
                var urlRecord = urlRecordService.GetBySlug(tempSeName) ?? extraSlugLookup(tempSeName);
                var reserved1 = urlRecord != null && !(urlRecord.EntityId == entity.Id && urlRecord.EntityName.Equals(entityName, StringComparison.InvariantCultureIgnoreCase));

                if (!reserved1 && urlRecord != null && languageId.HasValue)
                {
                    reserved1 = (urlRecord.LanguageId != languageId.Value);
                }

                //and it's not in the list of reserved slugs
                var reserved2 = seoSettings.ReservedUrlRecordSlugs.Contains(tempSeName, StringComparer.InvariantCultureIgnoreCase);
                if (!reserved1 && !reserved2)
                {
                    break;
                }

                tempSeName = string.Format("{0}-{1}", seName, i);
                i++;
            }
            seName = tempSeName;

            return(seName);
        }
예제 #54
0
 public KnowledgebaseViewModelService(ILocalizationService localizationService,
                                      IKnowledgebaseService knowledgebaseService, ICustomerActivityService customerActivityService,
                                      ICustomerService customerService, IDateTimeHelper dateTimeHelper, IUrlRecordService urlRecordService,
                                      ILanguageService languageService, SeoSettings seoSettings)
 {
     _localizationService     = localizationService;
     _knowledgebaseService    = knowledgebaseService;
     _customerActivityService = customerActivityService;
     _customerService         = customerService;
     _dateTimeHelper          = dateTimeHelper;
     _urlRecordService        = urlRecordService;
     _languageService         = languageService;
     _seoSettings             = seoSettings;
 }
예제 #55
0
 public WebPageController(IWebPageService webPageService, ISectionService sectionService, IUrlRecordService urlRecordService, RoleManager <IdentityRole> roleManager)
 {
     _webPageService   = webPageService;
     _sectionService   = sectionService;
     _urlRecordService = urlRecordService;
     _roleManager      = roleManager;
 }
예제 #56
0
 public BlogViewModelService(IBlogService blogService, IDateTimeHelper dateTimeHelper, IStoreService storeService, IUrlRecordService urlRecordService,
                             IPictureService pictureService, ICustomerService customerService, ILocalizationService localizationService, IProductService productService,
                             ICategoryService categoryService, IManufacturerService manufacturerService, IVendorService vendorService,
                             ILanguageService languageService, IWorkContext workContext, SeoSettings seoSettings)
 {
     _blogService         = blogService;
     _dateTimeHelper      = dateTimeHelper;
     _storeService        = storeService;
     _urlRecordService    = urlRecordService;
     _pictureService      = pictureService;
     _customerService     = customerService;
     _localizationService = localizationService;
     _productService      = productService;
     _categoryService     = categoryService;
     _manufacturerService = manufacturerService;
     _vendorService       = vendorService;
     _languageService     = languageService;
     _workContext         = workContext;
     _seoSettings         = seoSettings;
 }
예제 #57
0
        public CatalogModelFactory(BlogSettings blogSettings,
                                   CatalogSettings catalogSettings,
                                   DisplayDefaultMenuItemSettings displayDefaultMenuItemSettings,
                                   ForumSettings forumSettings,
                                   IActionContextAccessor actionContextAccessor,
                                   ICategoryService categoryService,
                                   ICategoryTemplateService categoryTemplateService,
                                   ICurrencyService currencyService,
                                   IEventPublisher eventPublisher,
                                   IHttpContextAccessor httpContextAccessor,
                                   ILocalizationService localizationService,
                                   IManufacturerService manufacturerService,
                                   IManufacturerTemplateService manufacturerTemplateService,
                                   IPictureService pictureService,
                                   IPriceFormatter priceFormatter,
                                   IProductModelFactory productModelFactory,
                                   IProductService productService,
                                   IProductTagService productTagService,
                                   ISearchTermService searchTermService,
                                   ISpecificationAttributeService specificationAttributeService,
                                   IStaticCacheManager cacheManager,
                                   IStoreContext storeContext,
                                   ITopicService topicService,
                                   IUrlHelperFactory urlHelperFactory,
                                   IUrlRecordService urlRecordService,
                                   IVendorService vendorService,
                                   IWebHelper webHelper,
                                   IWorkContext workContext,
                                   MediaSettings mediaSettings,
                                   VendorSettings vendorSettings,
                                   LuceneSettings luceneSettings, ILuceneService luceneService,
                                   ICacheKeyService cacheKeyService, ICustomerService customerService, IStaticCacheManager staticCacheManager)
            : base(blogSettings,
                   catalogSettings,
                   displayDefaultMenuItemSettings,
                   forumSettings,
                   actionContextAccessor,
                   cacheKeyService,
                   categoryService,
                   categoryTemplateService,
                   currencyService,
                   customerService,
                   eventPublisher,
                   httpContextAccessor,
                   localizationService,
                   manufacturerService,
                   manufacturerTemplateService,
                   pictureService,
                   priceFormatter,
                   productModelFactory,
                   productService,
                   productTagService,
                   searchTermService,
                   specificationAttributeService,
                   staticCacheManager,
                   storeContext,
                   topicService,
                   urlHelperFactory,
                   urlRecordService,
                   vendorService,
                   webHelper,
                   workContext,
                   mediaSettings,
                   vendorSettings)
        {
            _blogSettings    = blogSettings;
            _catalogSettings = catalogSettings;
            _displayDefaultMenuItemSettings = displayDefaultMenuItemSettings;
            _forumSettings                 = forumSettings;
            _actionContextAccessor         = actionContextAccessor;
            _categoryService               = categoryService;
            _categoryTemplateService       = categoryTemplateService;
            _currencyService               = currencyService;
            _eventPublisher                = eventPublisher;
            _httpContextAccessor           = httpContextAccessor;
            _localizationService           = localizationService;
            _manufacturerService           = manufacturerService;
            _manufacturerTemplateService   = manufacturerTemplateService;
            _pictureService                = pictureService;
            _priceFormatter                = priceFormatter;
            _productModelFactory           = productModelFactory;
            _productService                = productService;
            _productTagService             = productTagService;
            _searchTermService             = searchTermService;
            _specificationAttributeService = specificationAttributeService;
            _cacheManager     = cacheManager;
            _storeContext     = storeContext;
            _topicService     = topicService;
            _urlHelperFactory = urlHelperFactory;
            _urlRecordService = urlRecordService;
            _vendorService    = vendorService;
            _webHelper        = webHelper;
            _workContext      = workContext;
            _mediaSettings    = mediaSettings;
            _vendorSettings   = vendorSettings;
            _customerService  = customerService;
            _cacheKeyService  = cacheKeyService;

            _luceneSettings = luceneSettings;
            _luceneService  = luceneService;
        }
        public CustomShoppingCartController(
            CaptchaSettings captchaSettings,
            CustomerSettings customerSettings,
            ICheckoutAttributeParser checkoutAttributeParser,
            ICheckoutAttributeService checkoutAttributeService,
            ICurrencyService currencyService,
            ICustomerActivityService customerActivityService,
            ICustomerService customerService,
            IDiscountService discountService,
            IDownloadService downloadService,
            IGenericAttributeService genericAttributeService,
            IGiftCardService giftCardService,
            ILocalizationService localizationService,
            INopFileProvider fileProvider,
            INotificationService notificationService,
            IPermissionService permissionService,
            IPictureService pictureService,
            IPriceFormatter priceFormatter,
            IProductAttributeParser productAttributeParser,
            IProductAttributeService productAttributeService,
            IProductService productService,
            IShippingService shippingService,
            IShoppingCartModelFactory shoppingCartModelFactory,
            IShoppingCartService shoppingCartService,
            IStaticCacheManager staticCacheManager,
            IStoreContext storeContext,
            ITaxService taxService,
            IUrlRecordService urlRecordService,
            IWebHelper webHelper,
            IWorkContext workContext,
            IWorkflowMessageService workflowMessageService,
            MediaSettings mediaSettings,
            OrderSettings orderSettings,
            ShoppingCartSettings shoppingCartSettings,
            ShippingSettings shippingSettings,
            // custom
            IAttributeUtilities attributeUtilities,
            IRepository <CustomerShopMapping> customerShopMappingRepository,
            IBackendStockService backendStockService,
            IProductAbcDescriptionService productAbcDescriptionService,
            IWidgetPluginManager widgetPluginManager
            ) : base(captchaSettings, customerSettings, checkoutAttributeParser, checkoutAttributeService,
                     currencyService, customerActivityService, customerService, discountService,
                     downloadService, genericAttributeService, giftCardService, localizationService,
                     fileProvider, notificationService, permissionService, pictureService,
                     priceFormatter, productAttributeParser, productAttributeService, productService,
                     shippingService, shoppingCartModelFactory, shoppingCartService, staticCacheManager,
                     storeContext, taxService, urlRecordService, webHelper,
                     workContext, workflowMessageService, mediaSettings, orderSettings,
                     shoppingCartSettings, shippingSettings)
        {
            _customerActivityService = customerActivityService;
            _localizationService     = localizationService;
            _productAttributeParser  = productAttributeParser;
            _productAttributeService = productAttributeService;
            _productService          = productService;
            _shoppingCartService     = shoppingCartService;
            _shoppingCartSettings    = shoppingCartSettings;
            _storeContext            = storeContext;
            _urlRecordService        = urlRecordService;
            _workContext             = workContext;

            _attributeUtilities            = attributeUtilities;
            _customerShopMappingRepository = customerShopMappingRepository;
            _backendStockService           = backendStockService;
            _productAbcDescriptionService  = productAbcDescriptionService;
            _widgetPluginManager           = widgetPluginManager;
        }
예제 #59
0
 public CustomerUpdatedEventHandler(IUrlRecordService urlRecordService, ICustomerService customerService, IRepository <UrlRecord> urlRecordRepository)
 {
     _urlRecordService    = urlRecordService;
     _customerService     = customerService;
     _urlRecordRepository = urlRecordRepository;
 }
예제 #60
0
 public CustomerModelFactory(AddressSettings addressSettings,
                             CaptchaSettings captchaSettings,
                             CatalogSettings catalogSettings,
                             CommonSettings commonSettings,
                             CustomerSettings customerSettings,
                             DateTimeSettings dateTimeSettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             ForumSettings forumSettings,
                             GdprSettings gdprSettings,
                             IAddressModelFactory addressModelFactory,
                             ICountryService countryService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             IDateTimeHelper dateTimeHelper,
                             IDownloadService downloadService,
                             IExternalAuthenticationService externalAuthenticationService,
                             IGdprService gdprService,
                             IGenericAttributeService genericAttributeService,
                             ILocalizationService localizationService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             IReturnRequestService returnRequestService,
                             IStateProvinceService stateProvinceService,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             IUrlRecordService urlRecordService,
                             IWorkContext workContext,
                             MediaSettings mediaSettings,
                             OrderSettings orderSettings,
                             RewardPointsSettings rewardPointsSettings,
                             SecuritySettings securitySettings,
                             TaxSettings taxSettings,
                             VendorSettings vendorSettings)
 {
     this._addressSettings  = addressSettings;
     this._captchaSettings  = captchaSettings;
     this._catalogSettings  = catalogSettings;
     this._commonSettings   = commonSettings;
     this._customerSettings = customerSettings;
     this._dateTimeSettings = dateTimeSettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._forumSettings                 = forumSettings;
     this._gdprSettings                  = gdprSettings;
     this._addressModelFactory           = addressModelFactory;
     this._countryService                = countryService;
     this._customerAttributeParser       = customerAttributeParser;
     this._customerAttributeService      = customerAttributeService;
     this._dateTimeHelper                = dateTimeHelper;
     this._downloadService               = downloadService;
     this._externalAuthenticationService = externalAuthenticationService;
     this._gdprService                   = gdprService;
     this._genericAttributeService       = genericAttributeService;
     this._localizationService           = localizationService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._orderService                  = orderService;
     this._pictureService                = pictureService;
     this._returnRequestService          = returnRequestService;
     this._stateProvinceService          = stateProvinceService;
     this._storeContext                  = storeContext;
     this._storeMappingService           = storeMappingService;
     this._urlRecordService              = urlRecordService;
     this._workContext                   = workContext;
     this._mediaSettings                 = mediaSettings;
     this._orderSettings                 = orderSettings;
     this._rewardPointsSettings          = rewardPointsSettings;
     this._securitySettings              = securitySettings;
     this._taxSettings                   = taxSettings;
     this._vendorSettings                = vendorSettings;
 }