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;
 }
Example #2
0
        public NewsController(INewsService newsService, 
            IWorkContext workContext, IStoreContext storeContext, 
            IPictureService pictureService, ILocalizationService localizationService,
            IDateTimeHelper dateTimeHelper,
            IWorkflowMessageService workflowMessageService, IWebHelper webHelper,
            ICacheManager cacheManager, ICustomerActivityService customerActivityService,
            IStoreMappingService storeMappingService,
            MediaSettings mediaSettings, NewsSettings newsSettings,
            LocalizationSettings localizationSettings, CustomerSettings customerSettings,
            CaptchaSettings captchaSettings)
        {
            this._newsService = newsService;
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._dateTimeHelper = dateTimeHelper;
            this._workflowMessageService = workflowMessageService;
            this._webHelper = webHelper;
            this._cacheManager = cacheManager;
            this._customerActivityService = customerActivityService;
            this._storeMappingService = storeMappingService;

            this._mediaSettings = mediaSettings;
            this._newsSettings = newsSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings = customerSettings;
            this._captchaSettings = captchaSettings;
        }
Example #3
0
        public BlogController(IBlogService blogService, 
            IWorkContext workContext, IPictureService pictureService, ILocalizationService localizationService,
            ICustomerContentService customerContentService, IDateTimeHelper dateTimeHelper,
            IWorkflowMessageService workflowMessageService, IWebHelper webHelper,
            ICacheManager cacheManager, ICustomerActivityService customerActivityService,
            MediaSettings mediaSettings, BlogSettings blogSettings,
            LocalizationSettings localizationSettings, CustomerSettings customerSettings,
            StoreInformationSettings storeInformationSettings, CaptchaSettings captchaSettings)
        {
            this._blogService = blogService;
            this._workContext = workContext;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._customerContentService = customerContentService;
            this._dateTimeHelper = dateTimeHelper;
            this._workflowMessageService = workflowMessageService;
            this._webHelper = webHelper;
            this._cacheManager = cacheManager;
            this._customerActivityService = customerActivityService;

            this._mediaSettings = mediaSettings;
            this._blogSettings = blogSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings = customerSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._captchaSettings = captchaSettings;
        }
        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;
        }
Example #5
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="pictureRepository">Picture repository</param>
 /// <param name="productPictureRepository">Product picture repository</param>
 /// <param name="settingService">Setting service</param>
 /// <param name="webHelper">Web helper</param>
 /// <param name="mediaSettings">Media settings</param>
 public PictureService(IRepository<Picture> pictureRepository,
     IRepository<ProductPicture> productPictureRepository,
     ISettingService settingService, IWebHelper webHelper,
     MediaSettings mediaSettings)
 {
     this._pictureRepository = pictureRepository;
     this._productPictureRepository = productPictureRepository;
     this._settingService = settingService;
     this._webHelper = webHelper;
     this._mediaSettings = mediaSettings;
 }
Example #6
0
 public GalleryService(IRepository<Product> productRepository, IPictureService pictureService, ICacheManager cacheManager, MediaSettings mediaSettings, ILocalizationService localizationService, IWorkContext workContext, IWebHelper webHelper, IStoreContext storeContext)
 {
     _productRepository = productRepository;
     _pictureService = pictureService;
     _cacheManager = cacheManager;
     _mediaSettings = mediaSettings;
     _localizationService = localizationService;
     _workContext = workContext;
     _webHelper = webHelper;
     _storeContext = storeContext;
 }
Example #7
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="pictureRepository">Picture repository</param>
 /// <param name="productPictureRepository">Product picture repository</param>
 /// <param name="settingService">Setting service</param>
 /// <param name="webHelper">Web helper</param>
 /// <param name="mediaSettings">Media settings</param>
 /// <param name="httpContext">HTTP context</param>
 public PictureService(IRepository<Picture> pictureRepository,
     IRepository<ProductPicture> productPictureRepository,
     ISettingService settingService, IWebHelper webHelper,
     MediaSettings mediaSettings, HttpContextBase httpContext)
 {
     this._pictureRepository = pictureRepository;
     this._productPictureRepository = productPictureRepository;
     this._settingService = settingService;
     this._webHelper = webHelper;
     this._mediaSettings = mediaSettings;
     this._httpContext = httpContext;
 }
Example #8
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="pictureRepository">Picture repository</param>
 /// <param name="productPictureRepository">Product picture repository</param>
 /// <param name="settingService">Setting service</param>
 /// <param name="webHelper">Web helper</param>
 /// <param name="logger">Logger</param>
 /// <param name="eventPublisher">Event publisher</param>
 /// <param name="mediaSettings">Media settings</param>
 public PictureService(IRepository<Picture> pictureRepository,
     IRepository<ProductPicture> productPictureRepository,
     ISettingService settingService, IWebHelper webHelper,
     ILogger logger, IEventPublisher eventPublisher,
     MediaSettings mediaSettings)
 {
     this._pictureRepository = pictureRepository;
     this._productPictureRepository = productPictureRepository;
     this._settingService = settingService;
     this._webHelper = webHelper;
     this._logger = logger;
     this._eventPublisher = eventPublisher;
     this._mediaSettings = mediaSettings;
 }
        public AzurePictureService(IRepository<Picture> pictureRepository,
            IRepository<ProductPicture> productPictureRepository,
            IRepository<Product> productRepository,
            ISettingService settingService,
            IWebHelper webHelper,
            ILogger logger,
            IDbContext dbContext,
            IEventPublisher eventPublisher,
            MediaSettings mediaSettings,
            NopConfig config)
            : base(pictureRepository,
                productPictureRepository,
                productRepository,
                settingService,
                webHelper,
                logger,
                dbContext,
                eventPublisher,
                mediaSettings)
        {
            this._config = config;

            if (String.IsNullOrEmpty(_config.AzureBlobStorageConnectionString))
                throw new Exception("Azure connection string for BLOB is not specified");
            if (String.IsNullOrEmpty(_config.AzureBlobStorageContainerName))
                throw new Exception("Azure container name for BLOB is not specified");
            if (String.IsNullOrEmpty(_config.AzureBlobStorageEndPoint))
                throw new Exception("Azure end point for BLOB is not specified");

            _storageAccount = CloudStorageAccount.Parse(_config.AzureBlobStorageConnectionString);
            if (_storageAccount == null)
                throw new Exception("Azure connection string for BLOB is not wrong");

            //should we do it for each HTTP request?
            blobClient = _storageAccount.CreateCloudBlobClient();
            BlobContainerPermissions containerPermissions = new BlobContainerPermissions();
            containerPermissions.PublicAccess = BlobContainerPublicAccessType.Blob;
            //container.SetPermissions(containerPermissions);
            container_thumb = blobClient.GetContainerReference(_config.AzureBlobStorageContainerName);
            container_thumb.CreateIfNotExists();
            container_thumb.SetPermissions(containerPermissions);
        }
Example #10
0
 public ProfileController(IForumService forumService,
     ILocalizationService localizationService,
     IPictureService pictureService,
     ICountryService countryService,
     ICustomerService customerService,
     IDateTimeHelper dateTimeHelper,
     ForumSettings forumSettings,
     CustomerSettings customerSettings,
     MediaSettings mediaSettings)
 {
     this._forumService = forumService;
     this._localizationService = localizationService;
     this._pictureService = pictureService;
     this._countryService = countryService;
     this._customerService = customerService;
     this._dateTimeHelper = dateTimeHelper;
     this._forumSettings = forumSettings;
     this._customerSettings = customerSettings;
     this._mediaSettings = mediaSettings;
 }
Example #11
0
 public ImportManager(IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     IUrlRecordService urlRecordService,
     IStoreContext storeContext,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IEncryptionService encryptionService,
     IDataProvider dataProvider,
     MediaSettings mediaSettings,
     IVendorService vendorService,
     IProductTemplateService productTemplateService,
     IShippingService shippingService,
     ITaxCategoryService taxCategoryService,
     IMeasureService measureService,
     IProductAttributeService productAttributeService,
     CatalogSettings catalogSettings)
 {
     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._encryptionService = encryptionService;
     this._dataProvider = dataProvider;
     this._mediaSettings = mediaSettings;
     this._vendorService = vendorService;
     this._productTemplateService = productTemplateService;
     this._shippingService = shippingService;
     this._taxCategoryService = taxCategoryService;
     this._measureService = measureService;
     this._productAttributeService = productAttributeService;
     this._catalogSettings = catalogSettings;
 }
 public CustomerProfileApiController(CustomerProfileService customerProfileService,
     CustomerProfileViewService customerProfileViewService,
     ICustomerService customerService,
     IMobSocialService mobSocialService,
     ICustomerFavoriteSongService customerFavoriteSongService,
     IMusicService musicService,
     IWorkContext workContext, IFriendService friendService, IPictureService pictureService, mobSocialSettings mobSocialSettings, MediaSettings mediaSettings, IGenericAttributeService genericAttributeService, ICustomerFollowService customerFollowService)
 {
     _customerProfileService = customerProfileService;
     _customerProfileViewService = customerProfileViewService;
     _customerService = customerService;
     _customerFavoriteSongService = customerFavoriteSongService;
     _mobSocialService = mobSocialService;
     _musicService = musicService;
     _workContext = workContext;
     _friendService = friendService;
     _pictureService = pictureService;
     _mobSocialSettings = mobSocialSettings;
     _mediaSettings = mediaSettings;
     _genericAttributeService = genericAttributeService;
     _customerFollowService = customerFollowService;
 }
 public WidgetsCustomBestSellerController(IWorkContext workContext,
     IStoreContext storeContext,
     IStoreService storeService, 
     IPictureService pictureService,
     ISettingService settingService,
     ICacheManager cacheManager,
     ILocalizationService localizationService, CatalogSettings catalogSettings, IProductService productService, IOrderReportService orderReportService, IAclService aclService, IStoreMappingService storeMappingService, IWebHelper webHelper, MediaSettings mediaSettings)
 {
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._storeService = storeService;
     this._pictureService = pictureService;
     this._settingService = settingService;
     this._cacheManager = cacheManager;
     this._localizationService = localizationService;
     _catalogSettings = catalogSettings;
     _productService = productService;
     _orderReportService = orderReportService;
     _aclService = aclService;
     _storeMappingService = storeMappingService;
     _webHelper = webHelper;
     _mediaSettings = mediaSettings;
 }
 public BusinessPageApiController(IForumService forumService, ILocalizationService localizationService,
     IPictureService pictureService, ICountryService countryService,
     ICustomerService customerService, IDateTimeHelper dateTimeHelper,
     ForumSettings forumSettings, CustomerSettings customerSettings,
     MediaSettings mediaSettings, IBusinessPageService businessPageService,
     mobSocialSettings mobSocialSettings, IEventPageAttendanceService eventPageAttendanceService,
     IMobSocialService mobSocialService, IWorkContext workContext, IStateProvinceService stateProvinceService)
 {
     _localizationService = localizationService;
     _pictureService = pictureService;
     _countryService = countryService;
     _customerService = customerService;
     _dateTimeHelper = dateTimeHelper;
     _forumSettings = forumSettings;
     _customerSettings = customerSettings;
     _mediaSettings = mediaSettings;
     _businessPageService = businessPageService;
     _eventPageAttendanceService = eventPageAttendanceService;
     _mobSocialSettings = mobSocialSettings;
     _mobSocialService = mobSocialService;
     _workContext = workContext;
     _stateProvinceService = stateProvinceService;
 }
 public EventPageController(IForumService forumService, ILocalizationService localizationService,
     IPictureService pictureService, ICountryService countryService,
     ICustomerService customerService, IDateTimeHelper dateTimeHelper,
     ForumSettings forumSettings, CustomerSettings customerSettings,
     MediaSettings mediaSettings, IEventPageService eventPageService,
     mobSocialSettings mobSocialSettings, IEventPageAttendanceService eventPageAttendanceService,
     IMobSocialService mobSocialService, IWorkContext workContext)
 {
     _forumService = forumService;
     _localizationService = localizationService;
     _pictureService = pictureService;
     _countryService = countryService;
     _customerService = customerService;
     _dateTimeHelper = dateTimeHelper;
     _forumSettings = forumSettings;
     _customerSettings = customerSettings;
     _mediaSettings = mediaSettings;
     _eventPageService = eventPageService;
     _eventPageAttendanceService = eventPageAttendanceService;
     _mobSocialSettings = mobSocialSettings;
     _mobSocialService = mobSocialService;
     _workContext = workContext;
 }
Example #16
0
        public NewsController(INewsService newsService, 
            IWorkContext workContext, IPictureService pictureService, ILocalizationService localizationService,
            ICustomerContentService customerContentService, IDateTimeHelper dateTimeHelper,
            IWorkflowMessageService workflowMessageService, IWebHelper webHelper,
            MediaSettings mediaSettings, NewsSettings newsSettings,
            LocalizationSettings localizationSettings, CustomerSettings customerSettings,
            StoreInformationSettings storeInformationSettings)
        {
            this._newsService = newsService;
            this._workContext = workContext;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._customerContentService = customerContentService;
            this._dateTimeHelper = dateTimeHelper;
            this._workflowMessageService = workflowMessageService;
            this._webHelper = webHelper;

            this._mediaSettings = mediaSettings;
            this._newsSettings = newsSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings = customerSettings;
            this._storeInformationSettings = storeInformationSettings;
        }
Example #17
0
 public BoardsController(IForumService forumService,
     ILocalizationService localizationService,
     IPictureService pictureService,
     ICountryService countryService,
     IWebHelper webHelper,
     IWorkContext workContext,
     IStoreContext storeContext,
     ForumSettings forumSettings,
     CustomerSettings customerSettings,
     MediaSettings mediaSettings,
     IDateTimeHelper dateTimeHelper)
 {
     this._forumService = forumService;
     this._localizationService = localizationService;
     this._pictureService = pictureService;
     this._countryService = countryService;
     this._webHelper = webHelper;
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._forumSettings = forumSettings;
     this._customerSettings = customerSettings;
     this._mediaSettings = mediaSettings;
     this._dateTimeHelper = dateTimeHelper;
 }
        public IEnumerable<ProductOverviewModel> PrepareProductOverviewModels(
            IWorkContext workContext,
            IStoreContext storeContext,
            IProductService productService,
            ILocalizationService localizationService,
            IPictureService pictureService,
            IWebHelper webHelper,
            ICacheManager cacheManager,
            CatalogSettings catalogSettings,
            MediaSettings mediaSettings,
            IEnumerable<Product> products,
            int? productThumbPictureSize = null)
        {
            if (products == null)
                throw new ArgumentNullException("products");

            var models = new List<ProductOverviewModel>();
            foreach (var product in products)
            {
                var model = new ProductOverviewModel
                {
                    Id = product.Id,
                    Name = product.GetLocalized(x => x.Name),
                    ShortDescription = product.GetLocalized(x => x.ShortDescription),
                    FullDescription = product.GetLocalized(x => x.FullDescription),
                    SeName = product.GetSeName(),
                };

                //picture
                #region Prepare product picture

                //If a size has been set in the view, we use it in priority
                int pictureSize = productThumbPictureSize.HasValue ? productThumbPictureSize.Value : mediaSettings.ProductThumbPictureSize;
                //prepare picture model
                var defaultProductPictureCacheKey = string.Format(ModelCacheEventConsumer.PRODUCT_DEFAULTPICTURE_MODEL_KEY, product.Id, pictureSize, true, workContext.WorkingLanguage.Id, webHelper.IsCurrentConnectionSecured(), storeContext.CurrentStore.Id);
                model.DefaultPictureModel = cacheManager.Get(defaultProductPictureCacheKey, () =>
                {
                    var picture = pictureService.GetPicturesByProductId(product.Id, 1).FirstOrDefault();
                    var pictureModel = new PictureModel
                    {
                        ImageUrl = pictureService.GetPictureUrl(picture, pictureSize),
                        FullSizeImageUrl = pictureService.GetPictureUrl(picture)
                    };
                    //"title" attribute
                    pictureModel.Title = (picture != null && !string.IsNullOrEmpty(picture.TitleAttribute)) ?
                        picture.TitleAttribute :
                        string.Format(localizationService.GetResource("Media.Product.ImageLinkTitleFormat"), model.Name);
                    //"alt" attribute
                    pictureModel.AlternateText = (picture != null && !string.IsNullOrEmpty(picture.AltAttribute)) ?
                        picture.AltAttribute :
                        string.Format(localizationService.GetResource("Media.Product.ImageAlternateTextFormat"), model.Name);

                    return pictureModel;
                });

                #endregion

                models.Add(model);
            }
            return models;
        }
        public static IEnumerable<ProductOverviewModel> PrepareProductOverviewModels(this Controller controller,
            IWorkContext workContext,
            IStoreContext storeContext,
            ICategoryService categoryService,
            IProductService productService,
            ISpecificationAttributeService specificationAttributeService,
            IPriceCalculationService priceCalculationService,
            IPriceFormatter priceFormatter,
            IPermissionService permissionService,
            ILocalizationService localizationService,
            ITaxService taxService,
            ICurrencyService currencyService,
            IPictureService pictureService,
            IWebHelper webHelper,
            ICacheManager cacheManager,
            CatalogSettings catalogSettings,
            MediaSettings mediaSettings,
            IEnumerable<Product> products,
            bool preparePriceModel = true, bool preparePictureModel = true,
            int? productThumbPictureSize = null, bool prepareSpecificationAttributes = false,
            bool forceRedirectionAfterAddingToCart = false)
        {
            if (products == null)
                throw new ArgumentNullException("products");

            var models = new List<ProductOverviewModel>();
            foreach (var product in products)
            {
                var model = new ProductOverviewModel
                {
                    Id = product.Id,
                    Name = product.GetLocalized(x => x.Name),
                    ShortDescription = product.GetLocalized(x => x.ShortDescription),
                    FullDescription = product.GetLocalized(x => x.FullDescription),
                    SeName = product.GetSeName(),
                };
                //price
                if (preparePriceModel)
                {
                    #region Prepare product price

                    var priceModel = new ProductOverviewModel.ProductPriceModel
                    {
                        ForceRedirectionAfterAddingToCart = forceRedirectionAfterAddingToCart
                    };

                    switch (product.ProductType)
                    {
                        case ProductType.GroupedProduct:
                            {
                                #region Grouped product

                                var associatedProducts = productService.GetAssociatedProducts(product.Id, storeContext.CurrentStore.Id);

                                switch (associatedProducts.Count)
                                {
                                    case 0:
                                        {
                                            //no associated products
                                            //priceModel.DisableBuyButton = true;
                                            //priceModel.DisableWishlistButton = true;
                                            //compare products
                                            priceModel.DisableAddToCompareListButton = !catalogSettings.CompareProductsEnabled;
                                            //priceModel.AvailableForPreOrder = false;
                                        }
                                        break;
                                    default:
                                        {
                                            //we have at least one associated product
                                            //priceModel.DisableBuyButton = true;
                                            //priceModel.DisableWishlistButton = true;
                                            //compare products
                                            priceModel.DisableAddToCompareListButton = !catalogSettings.CompareProductsEnabled;
                                            //priceModel.AvailableForPreOrder = false;

                                            if (permissionService.Authorize(StandardPermissionProvider.DisplayPrices))
                                            {
                                                //find a minimum possible price
                                                decimal? minPossiblePrice = null;
                                                Product minPriceProduct = null;
                                                foreach (var associatedProduct in associatedProducts)
                                                {
                                                    //calculate for the maximum quantity (in case if we have tier prices)
                                                    var tmpPrice = priceCalculationService.GetFinalPrice(associatedProduct,
                                                        workContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);
                                                    if (!minPossiblePrice.HasValue || tmpPrice < minPossiblePrice.Value)
                                                    {
                                                        minPriceProduct = associatedProduct;
                                                        minPossiblePrice = tmpPrice;
                                                    }
                                                }
                                                if (minPriceProduct != null && !minPriceProduct.CustomerEntersPrice)
                                                {
                                                    if (minPriceProduct.CallForPrice)
                                                    {
                                                        priceModel.OldPrice = null;
                                                        priceModel.Price = localizationService.GetResource("Products.CallForPrice");
                                                    }
                                                    else if (minPossiblePrice.HasValue)
                                                    {
                                                        //calculate prices
                                                        decimal taxRate;
                                                        decimal finalPriceBase = taxService.GetProductPrice(minPriceProduct, minPossiblePrice.Value, out taxRate);
                                                        decimal finalPrice = currencyService.ConvertFromPrimaryStoreCurrency(finalPriceBase, workContext.WorkingCurrency);

                                                        priceModel.OldPrice = null;
                                                        priceModel.Price = String.Format(localizationService.GetResource("Products.PriceRangeFrom"), priceFormatter.FormatPrice(finalPrice));

                                                    }
                                                    else
                                                    {
                                                        //Actually it's not possible (we presume that minimalPrice always has a value)
                                                        //We never should get here
                                                        Debug.WriteLine("Cannot calculate minPrice for product #{0}", product.Id);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                //hide prices
                                                priceModel.OldPrice = null;
                                                priceModel.Price = null;
                                            }
                                        }
                                        break;
                                }

                                #endregion
                            }
                            break;
                        case ProductType.SimpleProduct:
                        default:
                            {
                                #region Simple product

                                //add to cart button
                                priceModel.DisableBuyButton = product.DisableBuyButton ||
                                    !permissionService.Authorize(StandardPermissionProvider.EnableShoppingCart) ||
                                    !permissionService.Authorize(StandardPermissionProvider.DisplayPrices);

                                //add to wishlist button
                                priceModel.DisableWishlistButton = product.DisableWishlistButton ||
                                    !permissionService.Authorize(StandardPermissionProvider.EnableWishlist) ||
                                    !permissionService.Authorize(StandardPermissionProvider.DisplayPrices);
                                //compare products
                                priceModel.DisableAddToCompareListButton = !catalogSettings.CompareProductsEnabled;

                                //rental
                                priceModel.IsRental = product.IsRental;

                                //pre-order
                                if (product.AvailableForPreOrder)
                                {
                                    priceModel.AvailableForPreOrder = !product.PreOrderAvailabilityStartDateTimeUtc.HasValue ||
                                        product.PreOrderAvailabilityStartDateTimeUtc.Value >= DateTime.UtcNow;
                                    priceModel.PreOrderAvailabilityStartDateTimeUtc = product.PreOrderAvailabilityStartDateTimeUtc;
                                }

                                //prices
                                if (permissionService.Authorize(StandardPermissionProvider.DisplayPrices))
                                {
                                    if (!product.CustomerEntersPrice)
                                    {
                                        if (product.CallForPrice)
                                        {
                                            //call for price
                                            priceModel.OldPrice = null;
                                            priceModel.Price = localizationService.GetResource("Products.CallForPrice");
                                        }
                                        else
                                        {
                                            //prices

                                            //calculate for the maximum quantity (in case if we have tier prices)
                                            decimal minPossiblePrice = priceCalculationService.GetFinalPrice(product,
                                                workContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);

                                            decimal taxRate;
                                            decimal oldPriceBase = taxService.GetProductPrice(product, product.OldPrice, out taxRate);
                                            decimal finalPriceBase = taxService.GetProductPrice(product, minPossiblePrice, out taxRate);

                                            decimal oldPrice = currencyService.ConvertFromPrimaryStoreCurrency(oldPriceBase, workContext.WorkingCurrency);
                                            decimal finalPrice = currencyService.ConvertFromPrimaryStoreCurrency(finalPriceBase, workContext.WorkingCurrency);

                                            //do we have tier prices configured?
                                            var tierPrices = new List<TierPrice>();
                                            if (product.HasTierPrices)
                                            {
                                                tierPrices.AddRange(product.TierPrices
                                                    .OrderBy(tp => tp.Quantity)
                                                    .ToList()
                                                    .FilterByStore(storeContext.CurrentStore.Id)
                                                    .FilterForCustomer(workContext.CurrentCustomer)
                                                    .RemoveDuplicatedQuantities());
                                            }
                                            //When there is just one tier (with  qty 1),
                                            //there are no actual savings in the list.
                                            bool displayFromMessage = tierPrices.Count > 0 &&
                                                !(tierPrices.Count == 1 && tierPrices[0].Quantity <= 1);
                                            if (displayFromMessage)
                                            {
                                                priceModel.OldPrice = null;
                                                priceModel.Price = String.Format(localizationService.GetResource("Products.PriceRangeFrom"), priceFormatter.FormatPrice(finalPrice));
                                            }
                                            else
                                            {
                                                if (finalPriceBase != oldPriceBase && oldPriceBase != decimal.Zero)
                                                {
                                                    priceModel.OldPrice = priceFormatter.FormatPrice(oldPrice);
                                                    priceModel.Price = priceFormatter.FormatPrice(finalPrice);
                                                }
                                                else
                                                {
                                                    priceModel.OldPrice = null;
                                                    priceModel.Price = priceFormatter.FormatPrice(finalPrice);
                                                }
                                            }
                                            if (product.IsRental)
                                            {
                                                //rental product
                                                priceModel.OldPrice = priceFormatter.FormatRentalProductPeriod(product, priceModel.OldPrice);
                                                priceModel.Price = priceFormatter.FormatRentalProductPeriod(product, priceModel.Price);
                                            }

                                            //property for German market
                                            //we display tax/shipping info only with "shipping enabled" for this product
                                            //we also ensure this it's not free shipping
                                            priceModel.DisplayTaxShippingInfo = catalogSettings.DisplayTaxShippingInfoProductBoxes
                                                && product.IsShipEnabled &&
                                                !product.IsFreeShipping;
                                        }
                                    }
                                }
                                else
                                {
                                    //hide prices
                                    priceModel.OldPrice = null;
                                    priceModel.Price = null;
                                }

                                #endregion
                            }
                            break;
                    }

                    model.ProductPrice = priceModel;

                    #endregion
                }

                //picture
                if (preparePictureModel)
                {
                    #region Prepare product picture

                    //If a size has been set in the view, we use it in priority
                    int pictureSize = productThumbPictureSize.HasValue ? productThumbPictureSize.Value : mediaSettings.ProductThumbPictureSize;
                    //prepare picture model
                    var defaultProductPictureCacheKey = string.Format(ModelCacheEventConsumer.PRODUCT_DEFAULTPICTURE_MODEL_KEY, product.Id, pictureSize, true, workContext.WorkingLanguage.Id, webHelper.IsCurrentConnectionSecured(), storeContext.CurrentStore.Id);
                    model.DefaultPictureModel = cacheManager.Get(defaultProductPictureCacheKey, () =>
                    {
                        var picture = pictureService.GetPicturesByProductId(product.Id, 1).FirstOrDefault();
                        var pictureModel = new PictureModel
                        {
                            ImageUrl = pictureService.GetPictureUrl(picture, pictureSize),
                            FullSizeImageUrl = pictureService.GetPictureUrl(picture)
                        };
                        //"title" attribute
                        pictureModel.Title = (picture != null && !string.IsNullOrEmpty(picture.TitleAttribute)) ?
                            picture.TitleAttribute :
                            string.Format(localizationService.GetResource("Media.Product.ImageLinkTitleFormat"), model.Name);
                        //"alt" attribute
                        pictureModel.AlternateText = (picture != null && !string.IsNullOrEmpty(picture.AltAttribute)) ?
                            picture.AltAttribute :
                            string.Format(localizationService.GetResource("Media.Product.ImageAlternateTextFormat"), model.Name);

                        return pictureModel;
                    });

                    #endregion
                }

                //specs
                if (prepareSpecificationAttributes)
                {
                    model.SpecificationAttributeModels = PrepareProductSpecificationModel(controller, workContext,
                         specificationAttributeService, cacheManager, product);
                }

                //reviews
                model.ReviewOverviewModel = new ProductReviewOverviewModel
                {
                    ProductId = product.Id,
                    RatingSum = product.ApprovedRatingSum,
                    TotalReviews = product.ApprovedTotalReviews,
                    AllowCustomerReviews = product.AllowCustomerReviews
                };

                models.Add(model);
            }
            return models;
        }
        public ShoppingCartController(IProductService productService, 
            IStoreContext storeContext,
            IWorkContext workContext,
            IShoppingCartService shoppingCartService,
            IPictureService pictureService,
            ILocalizationService localizationService,
            IProductAttributeService productAttributeService,
            IProductAttributeFormatter productAttributeFormatter,
            IProductAttributeParser productAttributeParser,
            ITaxService taxService, ICurrencyService currencyService,
            IPriceCalculationService priceCalculationService,
            IPriceFormatter priceFormatter,
            ICheckoutAttributeParser checkoutAttributeParser,
            ICheckoutAttributeFormatter checkoutAttributeFormatter,
            IOrderProcessingService orderProcessingService,
            IDiscountService discountService,
            ICustomerService customerService,
            IGiftCardService giftCardService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            IShippingService shippingService,
            IOrderTotalCalculationService orderTotalCalculationService,
            ICheckoutAttributeService checkoutAttributeService,
            IPaymentService paymentService,
            IWorkflowMessageService workflowMessageService,
            IPermissionService permissionService,
            IDownloadService downloadService,
            ICacheManager cacheManager,
            IWebHelper webHelper,
            ICustomerActivityService customerActivityService,
            IGenericAttributeService genericAttributeService,
            MediaSettings mediaSettings,
            ShoppingCartSettings shoppingCartSettings,
            CatalogSettings catalogSettings,
            OrderSettings orderSettings,
            ShippingSettings shippingSettings,
            TaxSettings taxSettings,
            CaptchaSettings captchaSettings,
            AddressSettings addressSettings)
        {
            this._productService = productService;
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._shoppingCartService = shoppingCartService;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._productAttributeService = productAttributeService;
            this._productAttributeFormatter = productAttributeFormatter;
            this._productAttributeParser = productAttributeParser;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._checkoutAttributeParser = checkoutAttributeParser;
            this._checkoutAttributeFormatter = checkoutAttributeFormatter;
            this._orderProcessingService = orderProcessingService;
            this._discountService = discountService;
            this._customerService = customerService;
            this._giftCardService = giftCardService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._shippingService = shippingService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._checkoutAttributeService = checkoutAttributeService;
            this._paymentService = paymentService;
            this._workflowMessageService = workflowMessageService;
            this._permissionService = permissionService;
            this._downloadService = downloadService;
            this._cacheManager = cacheManager;
            this._webHelper = webHelper;
            this._customerActivityService = customerActivityService;
            this._genericAttributeService = genericAttributeService;

            this._mediaSettings = mediaSettings;
            this._shoppingCartSettings = shoppingCartSettings;
            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._shippingSettings = shippingSettings;
            this._taxSettings = taxSettings;
            this._captchaSettings = captchaSettings;
            this._addressSettings = addressSettings;
        }
        //I think this is the method that uses dependancy injection to create the repos - as opposed to manual
        //see:http://alexwolfthoughts.com/creating-a-generic-repository-with-entity-framework-and-mvc
        public AUPublicController(IRepository<AUConsignorRecord> consignorRepo,
                                        IRepository<AUConsignmentRecord> consignmentRepo,
                                        IRepository<AUConsignorConsignmentRecord> consignorconsignmentRepo,
                                        IRepository<AUConsignorList> consignorlistRepo,
                                        IRepository<AUSaleRecord> saleRepo,
                                        IRepository<AUSessionRecord> sessionRepo,
                                        IRepository<AUIncrementRecord> incrementRepo,
                                        IRepository<AUAddressRecord> addressRepo,
                                        IRepository<AUCombAddress> combAddressRepo,
                                        IRepository<AULotList> lotlistRepo,
                                        IRepository<AUFeesRecord> feesRepo,
                                        IRepository<AUBidHistoryRecord> bidhistoryRepo,

                                        ICacheManager cacheManager,
                                        IPictureService pictureService,
                                        IConsignmentService consignmentservice,
                                        ILotService lotService,
                                        IForumService forumservice,

                                        IConsignorService consignorservice,
                                        IDateTimeHelper dateTimeHelper,
                                        IAuthenticationService authenticationService,
                                        ILocalizationService localizationService,
                                        ICountryService countryService,
                                        IStateProvinceService stateProvinceService, 
                                        IWorkContext workContext,                                        
                                        ICollectibleImportService collectibleimportService, 
                                        //IRepository<AUCombConsignorConsignment> combinedRepo,
                                        ICategoryService categoryService,
                                        IStoreService storeService,
                                        IShippingService shippingService,
                                        IPermissionService permissionService,
                                        IEventPublisher eventPublisher,
                                        ISettingService settings,
                                        IProductService productService,
                                        IDbContext dbContext,
                                        IPhilatelicPdfService philatelicpdfService,
                                        ICollectibleExportService collectibleexportService,
                                        IAUSaleService ausaleService,
                                        IAclService aclService,
                                        IStoreMappingService storeMappingService,
                                        CatalogSettings catalogSettings,
                                        IWebHelper webHelper,
                                        IPriceFormatter priceFormatter,
                                        ICurrencyService currencyService,
                                        IStoreContext storeContext,
                                        MediaSettings mediaSettings,
                                        IPriceCalculationService priceCalculationService,
                                        ISpecificationAttributeService specificationAttributeService,
                                        ITaxService taxService,
                                        ICategoryTemplateService categoryTemplateService,
                                        ICustomerActivityService customerActivityService,
                                        ShoppingCartSettings shoppingCartSettings,
                                        IAUCatalogService AUcatalogService,     
                                        IForumService forumService,             
                                        ICustomerService customerService,      
                                        ForumSettings forumSettings,          
                                        ILogger logger,
                                        IRecentlyViewedProductsService recentlyViewedProductsService,
                                        SeoSettings seoSettings,
                                        IVendorService vendorService,
                                        VendorSettings vendorSettings,
                                        IProductTagService productTagService,
                                        IProductTemplateService productTemplateService,
                                        IProductAttributeParser productAttributeParser,
                                        IManufacturerService manufacturerService,
                                        IMeasureService measureService,
                                        IProductAttributeService productAttributeService,
                                        CustomerSettings customerSettings,
                                        IGenericAttributeService genericAttributeService,
                                        ISearchTermService searchTermService,
                                        IShoppingCartService shoppingCartService,
                                        IProductAttributeFormatter productAttributeFormatter)                         
        {
            _cacheManager = cacheManager;
            _pictureService = pictureService;
            _lotService = lotService;
            _forumservice = forumservice;

            _consignorRepo = consignorRepo;
            _consignmentRepo = consignmentRepo;
            _consignorconsignmentRepo = consignorconsignmentRepo;
            _consignorService = consignorservice;
            _consignmentService = consignmentservice;
            _consignorlistRepo = consignorlistRepo;
            _saleRepo = saleRepo;
            _sessionRepo = sessionRepo;
            _incrementRepo = incrementRepo;
            _addressRepo = addressRepo;
            _combAddressRepo = combAddressRepo;
            _lotlistRepo = lotlistRepo;
            _feesRepo = feesRepo;
            _bidhistoryRepo = bidhistoryRepo;
            _dateTimeHelper = dateTimeHelper;
            _authenticationService = authenticationService;
            _localizationService = localizationService;
            _countryService = countryService;
            _stateProvinceService = stateProvinceService;
            _workContext = workContext;
            _collectibleimportService = collectibleimportService;
            _categoryService = categoryService;
            _storeService = storeService;
            _shippingService = shippingService;
            _permissionService = permissionService;
            _eventPublisher = eventPublisher;
            _settings = settings;
            _productService = productService;
            _dbContext = dbContext;
            _philatelicpdfService = philatelicpdfService;
            _collectibleexportService = collectibleexportService;
            _ausaleService = ausaleService;
            _aclService = aclService;
            _storeMappingService = storeMappingService;
            _catalogSettings = catalogSettings;
            _webHelper = webHelper;
            _priceFormatter = priceFormatter;
            _currencyService = currencyService;
            _storeContext = storeContext;
            _mediaSettings = mediaSettings;
            _priceCalculationService = priceCalculationService;
            _specificationAttributeService = specificationAttributeService;
            _taxService = taxService;
            _categoryTemplateService = categoryTemplateService;
            _customerActivityService = customerActivityService;
            _shoppingCartSettings = shoppingCartSettings;
            _AUcatalogService = AUcatalogService;      
            _forumService = forumService;              
            _customerService = customerService;       
            _forumSettings = forumSettings;            
            _logger = logger;
            _recentlyViewedProductsService = recentlyViewedProductsService;          
            _seoSettings = seoSettings;
            _vendorService = vendorService;
            _vendorSettings = vendorSettings;
            _productTemplateService = productTemplateService;
            _productTagService = productTagService;
            _productAttributeParser = productAttributeParser;
            _manufacturerService = manufacturerService;
            _measureService = measureService;
            _productAttributeService = productAttributeService;
            _customerSettings = customerSettings;
            _genericAttributeService = genericAttributeService;
            _searchTermService = searchTermService;
            _shoppingCartService = shoppingCartService;
            _productAttributeFormatter = productAttributeFormatter;
        }
Example #22
0
        public SettingController(ISettingService settingService,
            ICountryService countryService, IStateProvinceService stateProvinceService,
            IAddressService addressService, ITaxCategoryService taxCategoryService,
            ICurrencyService currencyService, IPictureService pictureService, 
            ILocalizationService localizationService, IDateTimeHelper dateTimeHelper,
            IOrderService orderService, IEncryptionService encryptionService,
            IThemeProvider themeProvider, ICustomerService customerService, 
            ICustomerActivityService customerActivityService, IPermissionService permissionService,
            IWebHelper webHelper, IFulltextService fulltextService,
            BlogSettings blogSettings,
            ForumSettings forumSettings, NewsSettings newsSettings,
            ShippingSettings shippingSettings, TaxSettings taxSettings,
            CatalogSettings catalogSettings, RewardPointsSettings rewardPointsSettings,
            CurrencySettings currencySettings, OrderSettings orderSettings,
            ShoppingCartSettings shoppingCartSettings, MediaSettings mediaSettings,
            CustomerSettings customerSettings,
            DateTimeSettings dateTimeSettings, StoreInformationSettings storeInformationSettings,
            SeoSettings seoSettings,SecuritySettings securitySettings, PdfSettings pdfSettings,
            LocalizationSettings localizationSettings, AdminAreaSettings adminAreaSettings,
            CaptchaSettings captchaSettings, ExternalAuthenticationSettings externalAuthenticationSettings,
            CommonSettings commonSettings)
        {
            this._settingService = settingService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._addressService = addressService;
            this._taxCategoryService = taxCategoryService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._dateTimeHelper = dateTimeHelper;
            this._orderService = orderService;
            this._encryptionService = encryptionService;
            this._themeProvider = themeProvider;
            this._customerService = customerService;
            this._customerActivityService = customerActivityService;
            this._permissionService = permissionService;
            this._webHelper = webHelper;
            this._fulltextService = fulltextService;

            this._blogSettings = blogSettings;
            this._forumSettings = forumSettings;
            this._newsSettings = newsSettings;
            this._shippingSettings = shippingSettings;
            this._taxSettings = taxSettings;
            this._catalogSettings = catalogSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._currencySettings = currencySettings;
            this._orderSettings = orderSettings;
            this._shoppingCartSettings = shoppingCartSettings;
            this._mediaSettings = mediaSettings;
            this._customerSettings = customerSettings;
            this._dateTimeSettings = dateTimeSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._seoSettings = seoSettings;
            this._securitySettings = securitySettings;
            this._pdfSettings = pdfSettings;
            this._localizationSettings = localizationSettings;
            this._adminAreaSettings = adminAreaSettings;
            this._captchaSettings = captchaSettings;
            this._externalAuthenticationSettings = externalAuthenticationSettings;
            this._commonSettings = commonSettings;
        }
 public CustomerController(IAuthenticationService authenticationService,
     IDateTimeHelper dateTimeHelper,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     ILocalizationService localizationService,
     IWorkContext workContext,
     IStoreContext storeContext,
     IStoreMappingService storeMappingService,
     ICustomerService customerService,
     ICustomerAttributeParser customerAttributeParser,
     ICustomerAttributeService customerAttributeService,
     IGenericAttributeService genericAttributeService,
     ICustomerRegistrationService customerRegistrationService,
     ITaxService taxService,
     RewardPointsSettings rewardPointsSettings,
     CustomerSettings customerSettings,
     AddressSettings addressSettings,
     ForumSettings forumSettings,
     OrderSettings orderSettings,
     IAddressService addressService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IOrderService orderService,
     IPictureService pictureService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IShoppingCartService shoppingCartService,
     IOpenAuthenticationService openAuthenticationService,
     IDownloadService downloadService,
     IWebHelper webHelper,
     ICustomerActivityService customerActivityService,
     IAddressAttributeParser addressAttributeParser,
     IAddressAttributeService addressAttributeService,
     IAddressAttributeFormatter addressAttributeFormatter,
     IReturnRequestService returnRequestService,
     IEventPublisher eventPublisher,
     MediaSettings mediaSettings,
     IWorkflowMessageService workflowMessageService,
     LocalizationSettings localizationSettings,
     CaptchaSettings captchaSettings,
     SecuritySettings securitySettings,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     StoreInformationSettings storeInformationSettings)
 {
     this._authenticationService = authenticationService;
     this._dateTimeHelper = dateTimeHelper;
     this._dateTimeSettings = dateTimeSettings;
     this._taxSettings = taxSettings;
     this._localizationService = localizationService;
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._storeMappingService = storeMappingService;
     this._customerService = customerService;
     this._customerAttributeParser = customerAttributeParser;
     this._customerAttributeService = customerAttributeService;
     this._genericAttributeService = genericAttributeService;
     this._customerRegistrationService = customerRegistrationService;
     this._taxService = taxService;
     this._rewardPointsSettings = rewardPointsSettings;
     this._customerSettings = customerSettings;
     this._addressSettings = addressSettings;
     this._forumSettings = forumSettings;
     this._orderSettings = orderSettings;
     this._addressService = addressService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._orderService = orderService;
     this._pictureService = pictureService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._shoppingCartService = shoppingCartService;
     this._openAuthenticationService = openAuthenticationService;
     this._downloadService = downloadService;
     this._webHelper = webHelper;
     this._customerActivityService = customerActivityService;
     this._addressAttributeParser = addressAttributeParser;
     this._addressAttributeService = addressAttributeService;
     this._addressAttributeFormatter = addressAttributeFormatter;
     this._returnRequestService = returnRequestService;
     this._eventPublisher = eventPublisher;
     this._mediaSettings = mediaSettings;
     this._workflowMessageService = workflowMessageService;
     this._localizationSettings = localizationSettings;
     this._captchaSettings = captchaSettings;
     this._securitySettings = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._storeInformationSettings = storeInformationSettings;
 }
Example #24
0
        public CatalogController(ICategoryService categoryService, 
            IManufacturerService manufacturerService, IProductService productService, 
            IProductTemplateService productTemplateService,
            ICategoryTemplateService categoryTemplateService,
            IManufacturerTemplateService manufacturerTemplateService,
            IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser, 
            IWorkContext workContext, ITaxService taxService, ICurrencyService currencyService,
            IPictureService pictureService, ILocalizationService localizationService,
            IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
            IWebHelper webHelper, ISpecificationAttributeService specificationAttributeService,
            ICustomerContentService customerContentService, IDateTimeHelper dateTimeHelper,
            IShoppingCartService shoppingCartService,
            IRecentlyViewedProductsService recentlyViewedProductsService, ICompareProductsService compareProductsService,
            IWorkflowMessageService workflowMessageService, IProductTagService productTagService,
            IOrderReportService orderReportService, ICustomerService customerService,
            IBackInStockSubscriptionService backInStockSubscriptionService,
            IPermissionService permissionService, IDownloadService downloadService,
            MediaSettings mediaSetting, CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings, StoreInformationSettings storeInformationSettings,
            LocalizationSettings localizationSettings, CustomerSettings customerSettings, 
            CaptchaSettings captchaSettings,
            ICacheManager cacheManager)
        {
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productService = productService;
            this._productTemplateService = productTemplateService;
            this._categoryTemplateService = categoryTemplateService;
            this._manufacturerTemplateService = manufacturerTemplateService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._workContext = workContext;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._webHelper = webHelper;
            this._specificationAttributeService = specificationAttributeService;
            this._customerContentService = customerContentService;
            this._dateTimeHelper = dateTimeHelper;
            this._shoppingCartService = shoppingCartService;
            this._recentlyViewedProductsService = recentlyViewedProductsService;
            this._compareProductsService = compareProductsService;
            this._workflowMessageService = workflowMessageService;
            this._productTagService = productTagService;
            this._orderReportService = orderReportService;
            this._customerService = customerService;
            this._backInStockSubscriptionService = backInStockSubscriptionService;
            this._permissionService = permissionService;
            this._downloadService = downloadService;

            this._mediaSetting = mediaSetting;
            this._catalogSettings = catalogSettings;
            this._shoppingCartSettings = shoppingCartSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings = customerSettings;
            this._captchaSettings = captchaSettings;

            this._cacheManager = cacheManager;
        }
Example #25
0
        public ActionResult Media(MediaSettingsModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings))
                return AccessDeniedView();

            _mediaSettings = model.ToEntity(_mediaSettings);
            _settingService.SaveSetting(_mediaSettings);

            //activity log
            _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings"));

            SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated"));
            return RedirectToAction("Media");
        }
Example #26
0
        public VendorController(
            IProductService productService, 
            IProductTemplateService productTemplateService,
            IWorkContext workContext, 
            ITaxService taxService, 
            ICurrencyService currencyService,
            IPictureService pictureService, 
            ILocalizationService localizationService,
            IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
            IWebHelper webHelper, ISpecificationAttributeService specificationAttributeService,
            IGenericAttributeService genericAttributeService,
            IPermissionService permissionService, 
            ICustomerActivityService customerActivityService, 
            IAclService aclService,
            MediaSettings mediaSettings, CatalogSettings catalogSettings,
        
            ICacheManager cacheManager
            , IVendorService vendorService //add by hz
            , IVendorTemplateService vendorTemplateService //add by hz
            )
        {
            this._productService = productService;
            this._productTemplateService = productTemplateService;
            this._workContext = workContext;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._webHelper = webHelper;
            this._specificationAttributeService = specificationAttributeService;
            this._genericAttributeService = genericAttributeService;
            this._permissionService = permissionService;
            this._customerActivityService = customerActivityService;
            this._aclService = aclService;

            this._mediaSettings = mediaSettings;
            this._catalogSettings = catalogSettings;

            this._cacheManager = cacheManager;
            this._vendorService = vendorService; //add by hz
            this._vendorTemplateService = vendorTemplateService; // add by hz
        }
Example #27
0
 public static MediaSettings ToEntity(this MediaSettingsModel model, MediaSettings destination)
 {
     return Mapper.Map(model, destination);
 }
 public ProductController(ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductService productService,
     IVendorService vendorService,
     IProductTemplateService productTemplateService,
     IProductAttributeService productAttributeService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPictureService pictureService,
     ILocalizationService localizationService,
     IMeasureService measureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IWebHelper webHelper,
     ISpecificationAttributeService specificationAttributeService,
     IDateTimeHelper dateTimeHelper,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     ICompareProductsService compareProductsService,
     IWorkflowMessageService workflowMessageService,
     IProductTagService productTagService,
     IOrderReportService orderReportService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     IPermissionService permissionService,
     IDownloadService downloadService,
     ICustomerActivityService customerActivityService,
     IProductAttributeParser productAttributeParser,
     IShippingService shippingService,
     IEventPublisher eventPublisher,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     VendorSettings vendorSettings,
     ShoppingCartSettings shoppingCartSettings,
     LocalizationSettings localizationSettings,
     CustomerSettings customerSettings,
     CaptchaSettings captchaSettings,
     SeoSettings seoSettings,
     ICacheManager cacheManager)
 {
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._vendorService = vendorService;
     this._productTemplateService = productTemplateService;
     this._productAttributeService = productAttributeService;
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._taxService = taxService;
     this._currencyService = currencyService;
     this._pictureService = pictureService;
     this._localizationService = localizationService;
     this._measureService = measureService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._webHelper = webHelper;
     this._specificationAttributeService = specificationAttributeService;
     this._dateTimeHelper = dateTimeHelper;
     this._recentlyViewedProductsService = recentlyViewedProductsService;
     this._compareProductsService = compareProductsService;
     this._workflowMessageService = workflowMessageService;
     this._productTagService = productTagService;
     this._orderReportService = orderReportService;
     this._aclService = aclService;
     this._storeMappingService = storeMappingService;
     this._permissionService = permissionService;
     this._downloadService = downloadService;
     this._customerActivityService = customerActivityService;
     this._productAttributeParser = productAttributeParser;
     this._shippingService = shippingService;
     this._eventPublisher = eventPublisher;
     this._mediaSettings = mediaSettings;
     this._catalogSettings = catalogSettings;
     this._vendorSettings = vendorSettings;
     this._shoppingCartSettings = shoppingCartSettings;
     this._localizationSettings = localizationSettings;
     this._customerSettings = customerSettings;
     this._captchaSettings = captchaSettings;
     this._seoSettings = seoSettings;
     this._cacheManager = cacheManager;
 }
Example #29
0
 public CatalogController(ICategoryService categoryService, 
     IManufacturerService manufacturerService,
     IProductService productService, 
     IVendorService vendorService,
     ICategoryTemplateService categoryTemplateService,
     IManufacturerTemplateService manufacturerTemplateService,
     IWorkContext workContext, 
     IStoreContext storeContext,
     ITaxService taxService, 
     ICurrencyService currencyService,
     IPictureService pictureService, 
     ILocalizationService localizationService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IWebHelper webHelper, 
     ISpecificationAttributeService specificationAttributeService,
     IProductTagService productTagService,
     IGenericAttributeService genericAttributeService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     IPermissionService permissionService, 
     ICustomerActivityService customerActivityService,
     ITopicService topicService,
     IEventPublisher eventPublisher,
     ISearchTermService searchTermService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     VendorSettings vendorSettings,
     BlogSettings blogSettings,
     ForumSettings  forumSettings,
     ICacheManager cacheManager)
 {
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._vendorService = vendorService;
     this._categoryTemplateService = categoryTemplateService;
     this._manufacturerTemplateService = manufacturerTemplateService;
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._taxService = taxService;
     this._currencyService = currencyService;
     this._pictureService = pictureService;
     this._localizationService = localizationService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._webHelper = webHelper;
     this._specificationAttributeService = specificationAttributeService;
     this._productTagService = productTagService;
     this._genericAttributeService = genericAttributeService;
     this._aclService = aclService;
     this._storeMappingService = storeMappingService;
     this._permissionService = permissionService;
     this._customerActivityService = customerActivityService;
     this._topicService = topicService;
     this._eventPublisher = eventPublisher;
     this._searchTermService = searchTermService;
     this._mediaSettings = mediaSettings;
     this._catalogSettings = catalogSettings;
     this._vendorSettings = vendorSettings;
     this._blogSettings = blogSettings;
     this._forumSettings = forumSettings;
     this._cacheManager = cacheManager;
 }
        public CustomerController(IAuthenticationService authenticationService,
            IDateTimeHelper dateTimeHelper,
            DateTimeSettings dateTimeSettings,
            TaxSettings taxSettings,
            ILocalizationService localizationService,
            IWorkContext workContext,
            IStoreContext storeContext,
            ICustomerService customerService,
            IGenericAttributeService genericAttributeService,
            ICustomerRegistrationService customerRegistrationService,
            ITaxService taxService, RewardPointsSettings rewardPointsSettings,
            CustomerSettings customerSettings,AddressSettings addressSettings, ForumSettings forumSettings,
            OrderSettings orderSettings, IAddressService addressService,
            ICountryService countryService, IStateProvinceService stateProvinceService,
            IOrderTotalCalculationService orderTotalCalculationService,
            IOrderProcessingService orderProcessingService, IOrderService orderService,
            ICurrencyService currencyService, IPriceFormatter priceFormatter,
            IPictureService pictureService, INewsLetterSubscriptionService newsLetterSubscriptionService,
            IForumService forumService, IShoppingCartService shoppingCartService,
            IOpenAuthenticationService openAuthenticationService,
            IBackInStockSubscriptionService backInStockSubscriptionService,
            IDownloadService downloadService, IWebHelper webHelper,
            ICustomerActivityService customerActivityService, MediaSettings mediaSettings,
            IWorkflowMessageService workflowMessageService, LocalizationSettings localizationSettings,
            CaptchaSettings captchaSettings, ExternalAuthenticationSettings externalAuthenticationSettings)
        {
            this._authenticationService = authenticationService;
            this._dateTimeHelper = dateTimeHelper;
            this._dateTimeSettings = dateTimeSettings;
            this._taxSettings = taxSettings;
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._customerService = customerService;
            this._genericAttributeService = genericAttributeService;
            this._customerRegistrationService = customerRegistrationService;
            this._taxService = taxService;
            this._rewardPointsSettings = rewardPointsSettings;
            this._customerSettings = customerSettings;
            this._addressSettings = addressSettings;
            this._forumSettings = forumSettings;
            this._orderSettings = orderSettings;
            this._addressService = addressService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._orderProcessingService = orderProcessingService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._orderService = orderService;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._pictureService = pictureService;
            this._newsLetterSubscriptionService = newsLetterSubscriptionService;
            this._forumService = forumService;
            this._shoppingCartService = shoppingCartService;
            this._openAuthenticationService = openAuthenticationService;
            this._backInStockSubscriptionService = backInStockSubscriptionService;
            this._downloadService = downloadService;
            this._webHelper = webHelper;
            this._customerActivityService = customerActivityService;

            this._mediaSettings = mediaSettings;
            this._workflowMessageService = workflowMessageService;
            this._localizationSettings = localizationSettings;
            this._captchaSettings = captchaSettings;
            this._externalAuthenticationSettings = externalAuthenticationSettings;
        }