Example #1
0
        public OrderController(IOrderService orderService, IWorkContext workContext,
            ICurrencyService currencyService, IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService,
            IDateTimeHelper dateTimeHelper, IMeasureService measureService,
            IPaymentService paymentService, ILocalizationService localizationService,
            IPdfService pdfService, ICustomerService customerService,
            IWorkflowMessageService workflowMessageService, 
            LocalizationSettings localizationSettings,
            MeasureSettings measureSettings, CatalogSettings catalogSettings,
            OrderSettings orderSettings, TaxSettings taxSettings, PdfSettings pdfSettings)
        {
            this._orderService = orderService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._measureService = measureService;
            this._paymentService = paymentService;
            this._localizationService = localizationService;
            this._pdfService = pdfService;
            this._customerService = customerService;
            this._workflowMessageService = workflowMessageService;

            this._localizationSettings = localizationSettings;
            this._measureSettings = measureSettings;
            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._taxSettings = taxSettings;
            this._pdfSettings = pdfSettings;
        }
Example #2
0
        //private readonly GoogleProductObjectContext _objectContext;

        #endregion

        #region Ctor
        public FroogleService(IGoogleService googleService,
            IPriceCalculationService priceCalculationService,
            ITaxService taxService, 
            IProductService productService,
            ICategoryService categoryService,
            IManufacturerService manufacturerService,
            IPictureService pictureService,
            ICurrencyService currencyService,
            ILanguageService languageService,
            ISettingService settingService,
            IWorkContext workContext,
            IMeasureService measureService,
            MeasureSettings measureSettings,
            FroogleSettings froogleSettings,
            CurrencySettings currencySettings)
        {
            this._googleService = googleService;
            this._priceCalculationService = priceCalculationService;
            this._taxService = taxService;
            this._productService = productService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._pictureService = pictureService;
            this._currencyService = currencyService;
            this._languageService = languageService;
            this._settingService = settingService;
            this._workContext = workContext;
            this._measureService = measureService;
            this._measureSettings = measureSettings;
            this._froogleSettings = froogleSettings;
            this._currencySettings = currencySettings;
            //this._objectContext = objectContext;
        }
Example #3
0
 public PdfService(ILocalizationService localizationService, IOrderService orderService,
     IPaymentService paymentService,
     IDateTimeHelper dateTimeHelper, IPriceFormatter priceFormatter,
     ICurrencyService currencyService, IMeasureService measureService,
     IPictureService pictureService, IProductService productService, 
     IProductAttributeParser productAttributeParser, IWebHelper webHelper, 
     CatalogSettings catalogSettings, CurrencySettings currencySettings,
     MeasureSettings measureSettings, PdfSettings pdfSettings, TaxSettings taxSettings,
     StoreInformationSettings storeInformationSettings, AddressSettings addressSettings)
 {
     this._localizationService = localizationService;
     this._orderService = orderService;
     this._paymentService = paymentService;
     this._dateTimeHelper = dateTimeHelper;
     this._priceFormatter = priceFormatter;
     this._currencyService = currencyService;
     this._measureService = measureService;
     this._pictureService = pictureService;
     this._productService = productService;
     this._productAttributeParser = productAttributeParser;
     this._webHelper = webHelper;
     this._currencySettings = currencySettings;
     this._catalogSettings = catalogSettings;
     this._measureSettings = measureSettings;
     this._pdfSettings = pdfSettings;
     this._taxSettings = taxSettings;
     this._storeInformationSettings = storeInformationSettings;
     this._addressSettings = addressSettings;
 }
 public CheckoutAttributeController(ICheckoutAttributeService checkoutAttributeService,
     ILanguageService languageService, 
     ILocalizedEntityService localizedEntityService,
     ILocalizationService localizationService,
     ITaxCategoryService taxCategoryService,
     IWorkContext workContext, 
     ICurrencyService currencyService, 
     ICustomerActivityService customerActivityService, 
     CurrencySettings currencySettings,
     IMeasureService measureService, 
     MeasureSettings measureSettings,
     IPermissionService permissionService,
     IStoreService storeService,
     IStoreMappingService storeMappingService)
 {
     this._checkoutAttributeService = checkoutAttributeService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._localizationService = localizationService;
     this._taxCategoryService = taxCategoryService;
     this._workContext = workContext;
     this._currencyService = currencyService;
     this._customerActivityService = customerActivityService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._permissionService = permissionService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
 }
 public FroogleService(IGoogleService googleService,
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     FroogleSettings froogleSettings,
     CurrencySettings currencySettings,
     GoogleProductObjectContext objectContext)
 {
     this._googleService = googleService;
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._froogleSettings = froogleSettings;
     this._currencySettings = currencySettings;
     this._objectContext = objectContext;
 }
 public ShippingByWeightController(IShippingService shippingService,
     IStoreService storeService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     ShippingByWeightSettings shippingByWeightSettings,
     IShippingByWeightService shippingByWeightService,
     ISettingService settingService,
     ILocalizationService localizationService,
     IPermissionService permissionService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings)
 {
     this._shippingService = shippingService;
     this._storeService = storeService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._shippingByWeightSettings = shippingByWeightSettings;
     this._shippingByWeightService = shippingByWeightService;
     this._settingService = settingService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
 }
Example #7
0
 public FroogleService(IScheduleTaskService scheduleTaskService,
     IGoogleService googleService,
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     IWebHelper webHelper,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     StoreInformationSettings storeInformationSettings,
     FroogleSettings froogleSettings,
     CurrencySettings currencySettings,
     GoogleProductObjectContext objectContext)
 {
     this._scheduleTaskService = scheduleTaskService;
     this._googleService = googleService;
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._webHelper = webHelper;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._storeInformationSettings = storeInformationSettings;
     this._froogleSettings = froogleSettings;
     this._currencySettings = currencySettings;
     this._objectContext = objectContext;
 }
 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 GoogleService(
			IRepository<GoogleProductRecord> gpRepository,
			IProductService productService,
			IManufacturerService manufacturerService,
			IStoreService storeService,
			ICategoryService categoryService,
			FroogleSettings settings,
			IMeasureService measureService,
			MeasureSettings measureSettings,
			IPriceCalculationService priceCalculationService,
			IWorkContext workContext)
        {
            _gpRepository = gpRepository;
			_productService = productService;
			_manufacturerService = manufacturerService;
			_storeService = storeService;
			_categoryService = categoryService;
			Settings = settings;
			_measureService = measureService;
			_measureSettings = measureSettings;
			_priceCalculationService = priceCalculationService;
			_workContext = workContext;

			_helper = new PluginHelperFeed("PromotionFeed.Froogle", "SmartStore.Plugin.Feed.Froogle", () =>
			{
				return Settings as PromotionFeedSettings;
			});
        }
Example #10
0
        public GoogleFeedService(
			IRepository<GoogleProductRecord> gpRepository,
			IProductService productService,
			IManufacturerService manufacturerService,
			FroogleSettings settings,
			IMeasureService measureService,
			MeasureSettings measureSettings,
			IDbContext dbContext,
			AdminAreaSettings adminAreaSettings,
			ICurrencyService currencyService,
			ICommonServices services,
			IComponentContext ctx)
        {
            _gpRepository = gpRepository;
            _productService = productService;
            _manufacturerService = manufacturerService;
            Settings = settings;
            _measureService = measureService;
            _measureSettings = measureSettings;
            _dbContext = dbContext;
            _adminAreaSettings = adminAreaSettings;
            _currencyService = currencyService;
            _services = services;

            _helper = new FeedPluginHelper(ctx, "SmartStore.GoogleMerchantCenter", "SmartStore.GoogleMerchantCenter", () =>
            {
                return Settings as PromotionFeedSettings;
            });
        }
 public RussianPostComputationMethod(IMeasureService measureService,
     IShippingService shippingService, ISettingService settingService,
     RussianPostSettings RussianPostSettings)
 {
     this._shippingService = shippingService;
     this._settingService = settingService;
     this._RussianPostSettings = RussianPostSettings;
 }
Example #12
0
 public MeasureController(IMeasureService measureService,
     MeasureSettings measureSettings, ISettingService settingService,
     IPermissionService permissionService)
 {
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._settingService = settingService;
     this._permissionService = permissionService;
 }
 public promoService(
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     CurrencySettings currencySettings,
     IProductAttributeService productAttributeService,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService,
     ILogger logger,
     IStoreService storeService,
     IPromoUtilities promoUtilities,
     PromoSettings promoSettings,
     IShippingService shippingService,
     IGenericAttributeService genericAttributeService,
     IStoreContext storeContext,
     IProductMappingService productMappingService,
     IShoppingCartService shoppingCartService,
     ICouponService qixolPromosCouponService,
     IAttributeValueService attributeValueService,
     IOrderService orderService,
     ICustomerService customerService,
     ILocalizationService localizationService)
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._currencySettings = currencySettings;
     this._productAttributeService = productAttributeService;
     this._priceCalculationService = priceCalculationService;
     this._taxService = taxService;
     this._logger = logger;
     this._promoUtilities = promoUtilities;
     this._storeService = storeService;
     this._shippingService = shippingService;
     this._genericAttributeService = genericAttributeService;
     this._storeContext = storeContext;
     this._productMappingService = productMappingService;
     this._shoppingCartService = shoppingCartService;
     this._couponService = qixolPromosCouponService;
     this._attributeValueService = attributeValueService;
     this._orderService = orderService;
     this._promoSettings = promoSettings;
     this._customerService = customerService;
     this._localizationService = localizationService;
 }
 public AustraliaPostComputationMethod(IMeasureService measureService,
     IShippingService shippingService, ISettingService settingService,
     AustraliaPostSettings australiaPostSettings)
 {
     this._measureService = measureService;
     this._shippingService = shippingService;
     this._settingService = settingService;
     this._australiaPostSettings = australiaPostSettings;
 }
 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;
 }
 public PdfService(ILocalizationService localizationService,
     ILanguageService languageService,
     IWorkContext workContext,
     IOrderService orderService,
     IPaymentService paymentService,
     IDateTimeHelper dateTimeHelper,
     IPriceFormatter priceFormatter,
     ICurrencyService currencyService,
     IMeasureService measureService,
     IPictureService pictureService,
     IProductService productService,
     IProductAttributeParser productAttributeParser,
     IStoreService storeService,
     IStoreContext storeContext,
     ISettingService settingContext,
     IWebHelper webHelper,
     IAddressAttributeFormatter addressAttributeFormatter,
     CatalogSettings catalogSettings,
     CurrencySettings currencySettings,
     MeasureSettings measureSettings,
     PdfSettings pdfSettings,
     TaxSettings taxSettings,
     AddressSettings addressSettings,
     PromoSettings promoSettings,
     IPromoOrderService promoOrderService)
     : base(localizationService, languageService, workContext, orderService, paymentService, dateTimeHelper, priceFormatter,
                                             currencyService, measureService, pictureService, productService, productAttributeParser, storeService, storeContext,
                                             settingContext, webHelper, addressAttributeFormatter, catalogSettings, currencySettings, measureSettings,
                                             pdfSettings, taxSettings, addressSettings)
 {
     this._localizationService = localizationService;
     this._languageService = languageService;
     this._workContext = workContext;
     this._orderService = orderService;
     this._paymentService = paymentService;
     this._dateTimeHelper = dateTimeHelper;
     this._priceFormatter = priceFormatter;
     this._currencyService = currencyService;
     this._measureService = measureService;
     this._pictureService = pictureService;
     this._productService = productService;
     this._productAttributeParser = productAttributeParser;
     this._storeService = storeService;
     this._storeContext = storeContext;
     this._settingContext = settingContext;
     this._webHelper = webHelper;
     this._addressAttributeFormatter = addressAttributeFormatter;
     this._currencySettings = currencySettings;
     this._catalogSettings = catalogSettings;
     this._measureSettings = measureSettings;
     this._pdfSettings = pdfSettings;
     this._taxSettings = taxSettings;
     this._addressSettings = addressSettings;
     this._promoSettings = promoSettings;
     this._promoOrderService = promoOrderService;
 }
Example #17
0
 public MeasuresJobHelper(IConfigurationProvider configProvider, IMeasureService service, IFtpClient ftpClient, IMeasureFileExtracter measureFileExtracter, IPlantPowerService plantPowerService, IPlantPowerFileExtracter plantPowerFileExtracter, IPlantService plantService)
 {
     _configProvider = configProvider;
     _service = service;
     _ftpClient = ftpClient;
     _measureFileExtracter = measureFileExtracter;
     _plantPowerService = plantPowerService;
     _plantPowerFileExtracter = plantPowerFileExtracter;
     _plantService = plantService;
 }
 public CanadaPostComputationMethod(IMeasureService measureService,
     IShippingService shippingService, ISettingService settingService,
     CanadaPostSettings canadaPostSettings, IWorkContext workContext)
 {
     this._measureService = measureService;
     this._shippingService = shippingService;
     this._settingService = settingService;
     this._canadaPostSettings = canadaPostSettings;
     this._workContext = workContext;
 }
        public GmcXmlExportProvider(
			IGoogleFeedService googleFeedService,
			IMeasureService measureService,
			MeasureSettings measureSettings)
        {
            _googleFeedService = googleFeedService;
            _measureService = measureService;
            _measureSettings = measureSettings;

            T = NullLocalizer.Instance;
        }
        public OrderController(IOrderService orderService, 
            IOrderReportService orderReportService, IOrderProcessingService orderProcessingService,
            IDateTimeHelper dateTimeHelper, IPriceFormatter priceFormatter, ILocalizationService localizationService,
            IWorkContext workContext, ICurrencyService currencyService,
            IEncryptionService encryptionService, IPaymentService paymentService,
            IMeasureService measureService, IPdfService pdfService,
            IAddressService addressService, ICountryService countryService,
            IStateProvinceService stateProvinceService, IProductService productService,
            IExportManager exportManager, IPermissionService permissionService,
            IWorkflowMessageService workflowMessageService,
            ICategoryService categoryService, IManufacturerService manufacturerService,
            IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser,
            IProductAttributeFormatter productAttributeFormatter, IShoppingCartService shoppingCartService,
            IGiftCardService giftCardService, IDownloadService downloadService,
            IShipmentService shipmentService,
            CatalogSettings catalogSettings, CurrencySettings currencySettings, TaxSettings taxSettings,
            MeasureSettings measureSettings, PdfSettings pdfSettings, AddressSettings addressSettings)
        {
            this._orderService = orderService;
            this._orderReportService = orderReportService;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._encryptionService = encryptionService;
            this._paymentService = paymentService;
            this._measureService = measureService;
            this._pdfService = pdfService;
            this._addressService = addressService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._productService = productService;
            this._exportManager = exportManager;
            this._permissionService = permissionService;
            this._workflowMessageService = workflowMessageService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._shoppingCartService = shoppingCartService;
            this._giftCardService = giftCardService;
            this._downloadService = downloadService;
            this._shipmentService = shipmentService;

            this._catalogSettings = catalogSettings;
            this._currencySettings = currencySettings;
            this._taxSettings = taxSettings;
            this._measureSettings = measureSettings;
            this._pdfSettings = pdfSettings;
            this._addressSettings = addressSettings;
        }
 public USPSComputationMethod(IMeasureService measureService,
     IShippingService shippingService, ISettingService settingService,
     USPSSettings uspsSettings, MeasureSettings measureSettings,
     IPriceCalculationService priceCalculationService)
 {
     this._measureService = measureService;
     this._shippingService = shippingService;
     this._settingService = settingService;
     this._uspsSettings = uspsSettings;
     this._measureSettings = measureSettings;
     this._priceCalculationService = priceCalculationService;
 }
        /// <summary>
        /// Format base price (PAngV)
        /// </summary>
        /// <param name="product">Product</param>
        /// <param name="productPrice">Product price (in primary currency). Pass null if you want to use a default produce price</param>
        /// <param name="localizationService">Localization service</param>
        /// <param name="measureService">Measure service</param>
        /// <param name="currencyService">Currency service</param>
        /// <param name="workContext">Work context</param>
        /// <param name="priceFormatter">Price formatter</param>
        /// <returns>Base price</returns>
        public static string FormatBasePrice(this Product product, decimal? productPrice, ILocalizationService localizationService,
            IMeasureService measureService, ICurrencyService currencyService,
            IWorkContext workContext, IPriceFormatter priceFormatter)
        {
            if (product == null)
                throw new ArgumentNullException("product");

            if (localizationService == null)
                throw new ArgumentNullException("localizationService");

            if (measureService == null)
                throw new ArgumentNullException("measureService");

            if (currencyService == null)
                throw new ArgumentNullException("currencyService");

            if (workContext == null)
                throw new ArgumentNullException("workContext");

            if (priceFormatter == null)
                throw new ArgumentNullException("priceFormatter");

            if (!product.BasepriceEnabled)
                return null;

            var productAmount = product.BasepriceAmount;
            //Amount in product cannot be 0
            if (productAmount == 0)
                return null;
            var referenceAmount = product.BasepriceBaseAmount;
            var productUnit = measureService.GetMeasureWeightById(product.BasepriceUnitId);
            //measure weight cannot be loaded
            if (productUnit == null)
                return null;
            var referenceUnit = measureService.GetMeasureWeightById(product.BasepriceBaseUnitId);
            //measure weight cannot be loaded
            if (referenceUnit == null)
                return null;

            productPrice = productPrice.HasValue ? productPrice.Value : product.Price;

            decimal basePrice = productPrice.Value /
                //do not round. otherwise, it can cause issues
                measureService.ConvertWeight(productAmount, productUnit, referenceUnit, false) *
                referenceAmount;
            decimal basePriceInCurrentCurrency = currencyService.ConvertFromPrimaryStoreCurrency(basePrice, workContext.WorkingCurrency);
            string basePriceStr = priceFormatter.FormatPrice(basePriceInCurrentCurrency, true, false);

            var result = string.Format(localizationService.GetResource("Products.BasePrice"),
                basePriceStr, referenceAmount.ToString("G29"), referenceUnit.Name);
            return result;
        }
 public FedexComputationMethod(IMeasureService measureService,
     IShippingService shippingService, ISettingService settingService,
     FedexSettings fedexSettings, IOrderTotalCalculationService orderTotalCalculationService,
     ICurrencyService currencyService, CurrencySettings currencySettings)
 {
     this._measureService = measureService;
     this._shippingService = shippingService;
     this._settingService = settingService;
     this._fedexSettings = fedexSettings;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
 }
        //private readonly TaxSettings _taxSettings;
        //private readonly AddressSettings _addressSettings;

        #endregion

        #region Ctor

        public PhilatelicPdfService(
            ILocalizationService localizationService,
            ILanguageService languageService,
            IWorkContext workContext,
            //IOrderService orderService,
            //IPaymentService paymentService,
            //IDateTimeHelper dateTimeHelper,
            IPriceFormatter priceFormatter,
            ICurrencyService currencyService,
            IMeasureService measureService,
            IPictureService pictureService,
            IProductService productService, 
            //IProductAttributeParser productAttributeParser,
            //IStoreService storeService,
            //IStoreContext storeContext,
            //ISettingService settingContext,
            IWebHelper webHelper,
            //IAddressAttributeFormatter addressAttributeFormatter,
            //CatalogSettings catalogSettings, 
            CurrencySettings currencySettings,
            MeasureSettings measureSettings,
            PdfSettings pdfSettings
            //TaxSettings taxSettings,
            //AddressSettings addressSettings
            )
        {
            this._localizationService = localizationService;
            //this._languageService = languageService;
            this._workContext = workContext;
            //this._orderService = orderService;
            //this._paymentService = paymentService;
            //this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._currencyService = currencyService;
            this._measureService = measureService;
            this._pictureService = pictureService;
            this._productService = productService;
            //this._productAttributeParser = productAttributeParser;
            //this._storeService = storeService;
            //this._storeContext = storeContext;
            //this._settingContext = settingContext;
            this._webHelper = webHelper;
            //this._addressAttributeFormatter = addressAttributeFormatter;
            this._currencySettings = currencySettings;
            //this._catalogSettings = catalogSettings;
            this._measureSettings = measureSettings;
            this._pdfSettings = pdfSettings;
            //this._taxSettings = taxSettings;
            //this._addressSettings = addressSettings;
        }
 public CanadaPostComputationMethod(CanadaPostSettings canadaPostSettings,
     ICurrencyService currencyService,
     ILogger logger,
     IMeasureService measureService,
     ISettingService settingService,
     IShippingService shippingService)
 {
     this._canadaPostSettings = canadaPostSettings;
     this._currencyService = currencyService;
     this._logger = logger;
     this._measureService = measureService;
     this._settingService = settingService;
     this._shippingService = shippingService;
 }
Example #26
0
 public UPSComputationMethod(IMeasureService measureService,
     IShippingService shippingService, ISettingService settingService,
     UPSSettings upsSettings, ICountryService countryService,
     ICurrencyService currencyService, CurrencySettings currencySettings,
     IOrderTotalCalculationService orderTotalCalculationService)
 {
     this._measureService = measureService;
     this._shippingService = shippingService;
     this._settingService = settingService;
     this._upsSettings = upsSettings;
     this._countryService = countryService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._orderTotalCalculationService = orderTotalCalculationService;
 }
        public CorreiosComputationMethod(IMeasureService measureService,
			IShippingService shippingService, ISettingService settingService,
			CorreiosSettings correiosSettings, IOrderTotalCalculationService orderTotalCalculationService,
			ICurrencyService currencyService, CurrencySettings currencySettings, ShippingSettings shippingSettings, IAddressService addressService, ILogger logger)
        {
            this._measureService = measureService;
            this._shippingService = shippingService;
            this._settingService = settingService;
            this._correiosSettings = correiosSettings;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._currencyService = currencyService;
            this._currencySettings = currencySettings;
            this._shippingSettings = shippingSettings;
            this._addressService = addressService;
            this._logger = logger;
        }
 public PromoPlugin(
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     PromoSettings promosFeedSettings,
     CurrencySettings currencySettings,
     IProductAttributeService productAttributeService,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService,
     ILogger logger,
     IPromoService promosFeedService,
     IScheduleTaskService scheduleTaskService,
     NopPromoContext nopPromoContext,
     IProductAttributeConfigService productAttributeConfigService,
     WidgetSettings widgetSettings,
     IPluginFinder pluginFinder,
     ILocalizationService localizationService)
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._promoSettings = promosFeedSettings;
     this._currencySettings = currencySettings;
     this._productAttributeService = productAttributeService;
     this._priceCalculationService = priceCalculationService;
     this._taxService = taxService;
     this._logger = logger;
     this._promosFeedService = promosFeedService;
     this._scheduleTaskService = scheduleTaskService;
     this._nopPromoContext = nopPromoContext;
     this._productAttributeConfigService = productAttributeConfigService;
     this._widgetSettings = widgetSettings;
     this._pluginFinder = pluginFinder;
     this._localizationService = localizationService;
 }
        public ShippingByWeightController(IShippingService shippingService,
            ICountryService countryService, ShippingByWeightSettings shippingByWeightSettings,
            IShippingByWeightService shippingByWeightService, ISettingService settingService,
            ICurrencyService currencyService, CurrencySettings currencySettings,
            IMeasureService measureService, MeasureSettings measureSettings)
        {
            this._shippingService = shippingService;
            this._countryService = countryService;
            this._shippingByWeightSettings = shippingByWeightSettings;
            this._shippingByWeightService = shippingByWeightService;
            this._settingService = settingService;

            this._currencyService = currencyService;
            this._currencySettings = currencySettings;
            this._measureService = measureService;
            this._measureSettings = measureSettings;
        }
        public CheckoutAttributeController(ICheckoutAttributeService checkoutAttributeService,
            ILanguageService languageService, 
			ILocalizedEntityService localizedEntityService,
            ITaxCategoryService taxCategoryService,
            ICustomerActivityService customerActivityService,
            IMeasureService measureService, 
			MeasureSettings measureSettings,
			ICommonServices services)
        {
            this._checkoutAttributeService = checkoutAttributeService;
            this._languageService = languageService;
            this._localizedEntityService = localizedEntityService;
            this._taxCategoryService = taxCategoryService;
            this._customerActivityService = customerActivityService;
            this._measureService = measureService;
            this._measureSettings = measureSettings;
            this._services = services;
        }
 public LogoutCommandHandler(IHttpContextAccessor httpContextAccessor, IMeasureService measure)
 {
     _measure  = measure;
     _accessor = httpContextAccessor;
 }
Example #32
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;
 }
Example #33
0
 public BsQuickViewController(
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductService productService,
     IVendorService vendorService,
     IProductTemplateService productTemplateService,
     IProductAttributeService productAttributeService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPictureService pictureService,
     ILocalizationService localizationService,
     //change-3.7
     IMeasureService measureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IWebHelper webHelper,
     ISpecificationAttributeService specificationAttributeService,
     IDateTimeHelper dateTimeHelper,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     ICompareProductsService compareProductsService,
     IWorkflowMessageService workflowMessageService,
     IProductTagService productTagService,
     IOrderReportService orderReportService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     IPermissionService permissionService,
     ICustomerActivityService customerActivityService,
     IProductAttributeParser productAttributeParser,
     IShippingService shippingService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     VendorSettings vendorSettings,
     ShoppingCartSettings shoppingCartSettings,
     LocalizationSettings localizationSettings,
     CustomerSettings customerSettings,
     CaptchaSettings captchaSettings,
     SeoSettings seoSettings,
     ICacheManager cacheManager,
     ISettingService settingService,
     IDownloadService downloadService, IProductModelFactory productModelFactory, IDateRangeService dateRangeService)
 {
     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;
     //change-3.7
     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._backInStockSubscriptionService = backInStockSubscriptionService;
     this._aclService              = aclService;
     this._storeMappingService     = storeMappingService;
     this._permissionService       = permissionService;
     this._customerActivityService = customerActivityService;
     this._productAttributeParser  = productAttributeParser;
     this._shippingService         = shippingService;
     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;
     this._settingService          = settingService;
     this._downloadService         = downloadService;
     _productModelFactory          = productModelFactory;
     _dateRangeService             = dateRangeService;
 }
Example #34
0
 public CommonModelFactory(AdminAreaSettings adminAreaSettings,
                           CatalogSettings catalogSettings,
                           CurrencySettings currencySettings,
                           IActionContextAccessor actionContextAccessor,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IDateTimeHelper dateTimeHelper,
                           INopFileProvider fileProvider,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IMaintenanceService maintenanceService,
                           IMeasureService measureService,
                           IOrderService orderService,
                           IPaymentService paymentService,
                           IPluginFinder pluginFinder,
                           IProductService productService,
                           IReturnRequestService returnRequestService,
                           ISearchTermService searchTermService,
                           IStoreContext storeContext,
                           IStoreService storeService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           ExternalAuthenticationSettings externalAuthenticationSettings,
                           MeasureSettings measureSettings,
                           PaymentSettings paymentSettings,
                           ShippingSettings shippingSettings,
                           TaxSettings taxSettings,
                           WidgetSettings widgetSettings)
 {
     this._adminAreaSettings              = adminAreaSettings;
     this._catalogSettings                = catalogSettings;
     this._currencySettings               = currencySettings;
     this._actionContextAccessor          = actionContextAccessor;
     this._currencyService                = currencyService;
     this._customerService                = customerService;
     this._dateTimeHelper                 = dateTimeHelper;
     this._fileProvider                   = fileProvider;
     this._httpContextAccessor            = httpContextAccessor;
     this._languageService                = languageService;
     this._localizationService            = localizationService;
     this._maintenanceService             = maintenanceService;
     this._measureService                 = measureService;
     this._orderService                   = orderService;
     this._paymentService                 = paymentService;
     this._pluginFinder                   = pluginFinder;
     this._productService                 = productService;
     this._returnRequestService           = returnRequestService;
     this._searchTermService              = searchTermService;
     this._storeContext                   = storeContext;
     this._storeService                   = storeService;
     this._urlHelperFactory               = urlHelperFactory;
     this._urlRecordService               = urlRecordService;
     this._webHelper                      = webHelper;
     this._workContext                    = workContext;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._measureSettings                = measureSettings;
     this._paymentSettings                = paymentSettings;
     this._shippingSettings               = shippingSettings;
     this._taxSettings                    = taxSettings;
     this._widgetSettings                 = widgetSettings;
 }
Example #35
0
        public new void SetUp()
        {
            measureDimension1 = new MeasureDimension()
            {
                Id            = 1,
                Name          = "inch(es)",
                SystemKeyword = "inch",
                Ratio         = 1M,
                DisplayOrder  = 1,
            };
            measureDimension2 = new MeasureDimension()
            {
                Id            = 2,
                Name          = "feet",
                SystemKeyword = "ft",
                Ratio         = 0.08333333M,
                DisplayOrder  = 2,
            };
            measureDimension3 = new MeasureDimension()
            {
                Id            = 3,
                Name          = "meter(s)",
                SystemKeyword = "m",
                Ratio         = 0.0254M,
                DisplayOrder  = 3,
            };
            measureDimension4 = new MeasureDimension()
            {
                Id            = 4,
                Name          = "millimetre(s)",
                SystemKeyword = "mm",
                Ratio         = 25.4M,
                DisplayOrder  = 4,
            };



            measureWeight1 = new MeasureWeight()
            {
                Id            = 1,
                Name          = "ounce(s)",
                SystemKeyword = "oz",
                Ratio         = 16M,
                DisplayOrder  = 1,
            };
            measureWeight2 = new MeasureWeight()
            {
                Id            = 2,
                Name          = "lb(s)",
                SystemKeyword = "lb",
                Ratio         = 1M,
                DisplayOrder  = 2,
            };
            measureWeight3 = new MeasureWeight()
            {
                Id            = 3,
                Name          = "kg(s)",
                SystemKeyword = "kg",
                Ratio         = 0.45359237M,
                DisplayOrder  = 3,
            };
            measureWeight4 = new MeasureWeight()
            {
                Id            = 4,
                Name          = "gram(s)",
                SystemKeyword = "g",
                Ratio         = 453.59237M,
                DisplayOrder  = 4,
            };

            _measureDimensionRepository = MockRepository.GenerateMock <IRepository <MeasureDimension> >();
            _measureDimensionRepository.Expect(x => x.Table).Return(new List <MeasureDimension>()
            {
                measureDimension1, measureDimension2, measureDimension3, measureDimension4
            }.AsQueryable());
            _measureDimensionRepository.Expect(x => x.GetById(measureDimension1.Id)).Return(measureDimension1);
            _measureDimensionRepository.Expect(x => x.GetById(measureDimension2.Id)).Return(measureDimension2);
            _measureDimensionRepository.Expect(x => x.GetById(measureDimension3.Id)).Return(measureDimension3);
            _measureDimensionRepository.Expect(x => x.GetById(measureDimension4.Id)).Return(measureDimension4);

            _measureWeightRepository = MockRepository.GenerateMock <IRepository <MeasureWeight> >();
            _measureWeightRepository.Expect(x => x.Table).Return(new List <MeasureWeight>()
            {
                measureWeight1, measureWeight2, measureWeight3, measureWeight4
            }.AsQueryable());
            _measureWeightRepository.Expect(x => x.GetById(measureWeight1.Id)).Return(measureWeight1);
            _measureWeightRepository.Expect(x => x.GetById(measureWeight2.Id)).Return(measureWeight2);
            _measureWeightRepository.Expect(x => x.GetById(measureWeight3.Id)).Return(measureWeight3);
            _measureWeightRepository.Expect(x => x.GetById(measureWeight4.Id)).Return(measureWeight4);


            _measureSettings = new MeasureSettings();
            _measureSettings.BaseDimensionId = measureDimension1.Id; //inch(es)
            _measureSettings.BaseWeightId    = measureWeight2.Id;    //lb(s)

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _measureService = new MeasureService(
                _measureDimensionRepository,
                _measureWeightRepository,
                _measureSettings);
        }
 public USPSVolumetricsService(IMeasureService measureService, IShippingService shippingService, MeasureSettings measureSettings)
 {
     _measureService  = measureService;
     _shippingService = shippingService;
     _measureSettings = measureSettings;
 }
Example #37
0
        /// <summary>
        /// Format base price (PAngV)
        /// </summary>
        /// <param name="product">Product</param>
        /// <param name="productPrice">Product price (in primary currency). Pass null if you want to use a default produce price</param>
        /// <param name="localizationService">Localization service</param>
        /// <param name="measureService">Measure service</param>
        /// <param name="currencyService">Currency service</param>
        /// <param name="workContext">Work context</param>
        /// <param name="priceFormatter">Price formatter</param>
        /// <returns>Base price</returns>
        public static string FormatBasePrice(this Product product, decimal?productPrice, ILocalizationService localizationService,
                                             IMeasureService measureService, ICurrencyService currencyService,
                                             IWorkContext workContext, IPriceFormatter priceFormatter)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

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

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

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

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

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

            if (!product.BasepriceEnabled)
            {
                return(null);
            }

            var productAmount = product.BasepriceAmount;

            //Amount in product cannot be 0
            if (productAmount == 0)
            {
                return(null);
            }
            var referenceAmount = product.BasepriceBaseAmount;
            var productUnit     = measureService.GetMeasureWeightById(product.BasepriceUnitId);

            //measure weight cannot be loaded
            if (productUnit == null)
            {
                return(null);
            }
            var referenceUnit = measureService.GetMeasureWeightById(product.BasepriceBaseUnitId);

            //measure weight cannot be loaded
            if (referenceUnit == null)
            {
                return(null);
            }

            productPrice = productPrice.HasValue ? productPrice.Value : product.Price;

            decimal basePrice = productPrice.Value /
                                //do not round. otherwise, it can cause issues
                                measureService.ConvertWeight(productAmount, productUnit, referenceUnit, false) *
                                referenceAmount;
            decimal basePriceInCurrentCurrency = currencyService.ConvertFromPrimaryStoreCurrency(basePrice, workContext.WorkingCurrency);
            string  basePriceStr = priceFormatter.FormatPrice(basePriceInCurrentCurrency, true, false);

            var result = string.Format(localizationService.GetResource("Products.BasePrice"),
                                       basePriceStr, referenceAmount.ToString("G29"), referenceUnit.Name);

            return(result);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AhrqModuleBase{T}"/> class.
 /// </summary>
 /// <param name="measureService">The measure service.</param>
 public AhrqModuleBase(IMeasureService measureService)
 {
     MeasureSvc = measureService;
 }
 public MeasureController(IMeasureService measureService, IMapper mapper, IMessageSession messageSession)
 {//026368732
     _measureService = measureService;
     _mapper         = mapper;
     _messageSession = messageSession;
 }
 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)
 {
 }
Example #41
0
        public new void SetUp()
        {
            measureDimension1 = new MeasureDimension
            {
                Id            = 1,
                Name          = "inch(es)",
                SystemKeyword = "inches",
                Ratio         = 1M,
                DisplayOrder  = 1
            };
            measureDimension2 = new MeasureDimension
            {
                Id            = 2,
                Name          = "feet",
                SystemKeyword = "feet",
                Ratio         = 0.08333333M,
                DisplayOrder  = 2
            };
            measureDimension3 = new MeasureDimension
            {
                Id            = 3,
                Name          = "meter(s)",
                SystemKeyword = "meters",
                Ratio         = 0.0254M,
                DisplayOrder  = 3
            };
            measureDimension4 = new MeasureDimension
            {
                Id            = 4,
                Name          = "millimetre(s)",
                SystemKeyword = "millimetres",
                Ratio         = 25.4M,
                DisplayOrder  = 4
            };

            measureWeight1 = new MeasureWeight
            {
                Id            = 1,
                Name          = "ounce(s)",
                SystemKeyword = "ounce",
                Ratio         = 16M,
                DisplayOrder  = 1
            };
            measureWeight2 = new MeasureWeight
            {
                Id            = 2,
                Name          = "lb(s)",
                SystemKeyword = "lb",
                Ratio         = 1M,
                DisplayOrder  = 2
            };
            measureWeight3 = new MeasureWeight
            {
                Id            = 3,
                Name          = "kg(s)",
                SystemKeyword = "kg",
                Ratio         = 0.45359237M,
                DisplayOrder  = 3
            };
            measureWeight4 = new MeasureWeight
            {
                Id            = 4,
                Name          = "gram(s)",
                SystemKeyword = "grams",
                Ratio         = 453.59237M,
                DisplayOrder  = 4
            };

            _measureDimensionRepository = new Mock <IRepository <MeasureDimension> >();
            _measureDimensionRepository.Setup(x => x.Table).Returns(new List <MeasureDimension> {
                measureDimension1, measureDimension2, measureDimension3, measureDimension4
            }.AsQueryable());
            _measureDimensionRepository.Setup(x => x.GetById(measureDimension1.Id)).Returns(measureDimension1);
            _measureDimensionRepository.Setup(x => x.GetById(measureDimension2.Id)).Returns(measureDimension2);
            _measureDimensionRepository.Setup(x => x.GetById(measureDimension3.Id)).Returns(measureDimension3);
            _measureDimensionRepository.Setup(x => x.GetById(measureDimension4.Id)).Returns(measureDimension4);

            _measureWeightRepository = new Mock <IRepository <MeasureWeight> >();
            _measureWeightRepository.Setup(x => x.Table).Returns(new List <MeasureWeight> {
                measureWeight1, measureWeight2, measureWeight3, measureWeight4
            }.AsQueryable());
            _measureWeightRepository.Setup(x => x.GetById(measureWeight1.Id)).Returns(measureWeight1);
            _measureWeightRepository.Setup(x => x.GetById(measureWeight2.Id)).Returns(measureWeight2);
            _measureWeightRepository.Setup(x => x.GetById(measureWeight3.Id)).Returns(measureWeight3);
            _measureWeightRepository.Setup(x => x.GetById(measureWeight4.Id)).Returns(measureWeight4);

            var cacheManager = new TestCacheManager();

            _measureSettings = new MeasureSettings
            {
                BaseDimensionId = measureDimension1.Id, //inch(es)
                BaseWeightId    = measureWeight2.Id     //lb(s)
            };

            _eventPublisher = new Mock <IEventPublisher>();
            _eventPublisher.Setup(x => x.Publish(It.IsAny <object>()));

            _measureService = new MeasureService(cacheManager,
                                                 _eventPublisher.Object,
                                                 _measureDimensionRepository.Object,
                                                 _measureWeightRepository.Object,
                                                 _measureSettings);
        }
Example #42
0
 public ShipmentController(
     IShipmentViewModelService shipmentViewModelService,
     IOrderService orderService,
     IOrderProcessingService orderProcessingService,
     ILocalizationService localizationService,
     IWorkContext workContext,
     IMeasureService measureService,
     IPdfService pdfService,
     IProductService productService,
     IExportManager exportManager,
     IWorkflowMessageService workflowMessageService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductAttributeService productAttributeService,
     IProductAttributeParser productAttributeParser,
     IProductAttributeFormatter productAttributeFormatter,
     IShoppingCartService shoppingCartService,
     IGiftCardService giftCardService,
     IDownloadService downloadService,
     IShipmentService shipmentService,
     IShippingService shippingService,
     IStoreService storeService,
     IVendorService vendorService,
     IAddressAttributeParser addressAttributeParser,
     IAddressAttributeService addressAttributeService,
     IAddressAttributeFormatter addressAttributeFormatter,
     IAffiliateService affiliateService,
     IPictureService pictureService,
     ITaxService taxService,
     IReturnRequestService returnRequestService,
     ICustomerService customerService,
     ICustomerActivityService customerActivityService,
     CurrencySettings currencySettings,
     TaxSettings taxSettings,
     MeasureSettings measureSettings,
     AddressSettings addressSettings,
     ShippingSettings shippingSettings,
     MediaSettings mediaSettings)
 {
     _shipmentViewModelService = shipmentViewModelService;
     _orderService             = orderService;
     _orderProcessingService   = orderProcessingService;
     _localizationService      = localizationService;
     _workContext               = workContext;
     _measureService            = measureService;
     _pdfService                = pdfService;
     _productService            = productService;
     _exportManager             = exportManager;
     _workflowMessageService    = workflowMessageService;
     _categoryService           = categoryService;
     _manufacturerService       = manufacturerService;
     _productAttributeService   = productAttributeService;
     _productAttributeParser    = productAttributeParser;
     _productAttributeFormatter = productAttributeFormatter;
     _shoppingCartService       = shoppingCartService;
     _giftCardService           = giftCardService;
     _downloadService           = downloadService;
     _shipmentService           = shipmentService;
     _shippingService           = shippingService;
     _storeService              = storeService;
     _vendorService             = vendorService;
     _addressAttributeParser    = addressAttributeParser;
     _addressAttributeService   = addressAttributeService;
     _addressAttributeFormatter = addressAttributeFormatter;
     _affiliateService          = affiliateService;
     _pictureService            = pictureService;
     _taxService                = taxService;
     _returnRequestService      = returnRequestService;
     _customerActivityService   = customerActivityService;
     _currencySettings          = currencySettings;
     _taxSettings               = taxSettings;
     _measureSettings           = measureSettings;
     _addressSettings           = addressSettings;
     _shippingSettings          = shippingSettings;
     _customerService           = customerService;
     _mediaSettings             = mediaSettings;
 }
Example #43
0
        public void TestInitialize()
        {
            _measureDimensionInches = new MeasureDimension {
                Id            = "1",
                Name          = "inch(es)",
                SystemKeyword = "inches",
                Ratio         = 1M,
                DisplayOrder  = 1,
            };
            _measureDimensionFeets = new MeasureDimension {
                Id            = "2",
                Name          = "feet",
                SystemKeyword = "feet",
                Ratio         = 0.08333333M,
                DisplayOrder  = 2,
            };
            _measureDimensionMeters = new MeasureDimension {
                Id            = "3",
                Name          = "meter(s)",
                SystemKeyword = "meters",
                Ratio         = 0.0254M,
                DisplayOrder  = 3,
            };
            _measureDimensionMilimeters = new MeasureDimension {
                Id            = "4",
                Name          = "millimetre(s)",
                SystemKeyword = "millimetres",
                Ratio         = 25.4M,
                DisplayOrder  = 4,
            };

            _measureWeightOunces = new MeasureWeight {
                Id            = "1",
                Name          = "ounce(s)",
                SystemKeyword = "ounce",
                Ratio         = 16M,
                DisplayOrder  = 1,
            };
            _measureWeightPounds = new MeasureWeight {
                Id            = "2",
                Name          = "lb(s)",
                SystemKeyword = "lb",
                Ratio         = 1M,
                DisplayOrder  = 2,
            };
            _measureWeightKilograms = new MeasureWeight {
                Id            = "3",
                Name          = "kg(s)",
                SystemKeyword = "kg",
                Ratio         = 0.45359237M,
                DisplayOrder  = 3,
            };
            _measureWeightGrams = new MeasureWeight {
                Id            = "4",
                Name          = "gram(s)",
                SystemKeyword = "grams",
                Ratio         = 453.59237M,
                DisplayOrder  = 4,
            };


            var tempMeasureDimensionRepository = new Mock <IRepository <MeasureDimension> >();
            {
                var IMongoCollection = new Mock <IMongoCollection <MeasureDimension> >().Object;
                IMongoCollection.InsertOne(_measureDimensionInches);
                IMongoCollection.InsertOne(_measureDimensionFeets);
                IMongoCollection.InsertOne(_measureDimensionMeters);
                IMongoCollection.InsertOne(_measureDimensionMilimeters);
                tempMeasureDimensionRepository.Setup(x => x.Table).Returns(IMongoCollection.AsQueryable());
                tempMeasureDimensionRepository.Setup(x => x.GetById(_measureDimensionInches.Id)).Returns(_measureDimensionInches);
                tempMeasureDimensionRepository.Setup(x => x.GetById(_measureDimensionFeets.Id)).Returns(_measureDimensionFeets);
                tempMeasureDimensionRepository.Setup(x => x.GetById(_measureDimensionMeters.Id)).Returns(_measureDimensionMeters);
                tempMeasureDimensionRepository.Setup(x => x.GetById(_measureDimensionMilimeters.Id)).Returns(_measureDimensionMilimeters);
                _measureDimensionRepository = tempMeasureDimensionRepository.Object;
            }

            var tempMeasureWeightRepository = new Mock <IRepository <MeasureWeight> >();

            {
                var IMongoCollection = new Mock <IMongoCollection <MeasureWeight> >().Object;
                IMongoCollection.InsertOne(_measureWeightOunces);
                IMongoCollection.InsertOne(_measureWeightPounds);
                IMongoCollection.InsertOne(_measureWeightKilograms);
                IMongoCollection.InsertOne(_measureWeightGrams);
                tempMeasureWeightRepository.Setup(x => x.Table).Returns(IMongoCollection.AsQueryable());
                tempMeasureWeightRepository.Setup(x => x.GetById(_measureWeightOunces.Id)).Returns(_measureWeightOunces);
                tempMeasureWeightRepository.Setup(x => x.GetById(_measureWeightPounds.Id)).Returns(_measureWeightPounds);
                tempMeasureWeightRepository.Setup(x => x.GetById(_measureWeightKilograms.Id)).Returns(_measureWeightKilograms);
                tempMeasureWeightRepository.Setup(x => x.GetById(_measureWeightGrams.Id)).Returns(_measureWeightGrams);
                _measureWeightRepository = tempMeasureWeightRepository.Object;
            }

            _measureUnits = new MeasureUnit
            {
                Id   = "1",
                Name = "pcs.",
            };
            var tempMeasureUnitRepository = new Mock <IRepository <MeasureUnit> >();

            {
                var IMongoCollection = new Mock <IMongoCollection <MeasureUnit> >().Object;
                IMongoCollection.InsertOne(_measureUnits);
                tempMeasureUnitRepository.Setup(x => x.Table).Returns(IMongoCollection.AsQueryable());
                tempMeasureUnitRepository.Setup(x => x.GetById(_measureUnits.Id)).Returns(_measureUnits);
                _measureUnitRepository = tempMeasureUnitRepository.Object;
            }

            _measureSettings = new MeasureSettings();
            _measureSettings.BaseDimensionId = _measureDimensionInches.Id; //inch(es) because all other dimensions are in relation to  inches
            _measureSettings.BaseWeightId    = _measureWeightPounds.Id;    //lb(s) because all other weights are in relation to pounds

            var tempEventPublisher = new Mock <IEventPublisher>();

            {
                tempEventPublisher.Setup(x => x.Publish(It.IsAny <object>()));
                _eventPublisher = tempEventPublisher.Object;
            }

            _measureService = new MeasureService(new GrandNullCache(), _measureDimensionRepository,
                                                 _measureWeightRepository, _measureUnitRepository, _measureSettings, _eventPublisher);
        }
Example #44
0
 public ProductFactory(IMeasureService measureService, MeasureSettings measureSettings)
 {
     _measureService  = measureService;
     _measureSettings = measureSettings;
 }
 public MeasurePolicy(IMeasureService measureService)
 {
     _measureService = measureService;
 }
Example #46
0
 public ProductController(
     SmartDbContext db,
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlService urlService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     IMediaService mediaService,
     IProductTagService productTagService,
     IProductCloner productCloner,
     IActivityLogger activityLogger,
     IAclService aclService,
     IStoreContext storeContext,
     IStoreMappingService storeMappingService,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     //IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     //IProductAttributeParser productAttributeParser,
     CatalogSettings catalogSettings,
     IDownloadService downloadService,
     IDeliveryTimeService deliveryTimesService,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     IEventPublisher eventPublisher,
     IGenericAttributeService genericAttributeService,
     ICommonServices services,
     ICatalogSearchService catalogSearchService,
     ProductUrlHelper productUrlHelper,
     SeoSettings seoSettings,
     MediaSettings mediaSettings,
     SearchSettings searchSettings)
 {
     _db                      = db;
     _productService          = productService;
     _categoryService         = categoryService;
     _manufacturerService     = manufacturerService;
     _customerService         = customerService;
     _urlService              = urlService;
     _workContext             = workContext;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _localizedEntityService  = localizedEntityService;
     _mediaService            = mediaService;
     _productTagService       = productTagService;
     _productCloner           = productCloner;
     _activityLogger          = activityLogger;
     _aclService              = aclService;
     _storeContext            = storeContext;
     _storeMappingService     = storeMappingService;
     _adminAreaSettings       = adminAreaSettings;
     _dateTimeHelper          = dateTimeHelper;
     _discountService         = discountService;
     _productAttributeService = productAttributeService;
     //_backInStockSubscriptionService = backInStockSubscriptionService;
     _shoppingCartService       = shoppingCartService;
     _productAttributeFormatter = productAttributeFormatter;
     //_productAttributeParser = productAttributeParser;
     _catalogSettings         = catalogSettings;
     _downloadService         = downloadService;
     _deliveryTimesService    = deliveryTimesService;
     _measureService          = measureService;
     _measureSettings         = measureSettings;
     _eventPublisher          = eventPublisher;
     _genericAttributeService = genericAttributeService;
     _services             = services;
     _catalogSearchService = catalogSearchService;
     _productUrlHelper     = productUrlHelper;
     _seoSettings          = seoSettings;
     _mediaSettings        = mediaSettings;
     _searchSettings       = searchSettings;
 }
Example #47
0
 public HomeController(IRecipeService recipeService, IMeasureService measureService)
 {
     this.recipeService  = recipeService;
     this.measureService = measureService;
 }
Example #48
0
 public USPSPackageSplitterService(IMeasureService measureService, IShippingService shippingService, MeasureSettings measureSettings)
 {
     _uspsVolumetricsService = new USPSVolumetricsService(measureService, shippingService, measureSettings);
 }
Example #49
0
 public Module(IMeasureService measureService)
     : base(measureService)
 {
 }
Example #50
0
 public MeasureModelFactory(IMeasureService measureService,
                            MeasureSettings measureSettings)
 {
     _measureService  = measureService;
     _measureSettings = measureSettings;
 }
 public ProductModelFactoryExtended(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) : base(
         catalogSettings,
         currencySettings,
         aclSupportedModelFactory,
         baseAdminModelFactory,
         categoryService,
         currencyService,
         customerService,
         dateTimeHelper,
         discountService,
         discountSupportedModelFactory,
         localizationService,
         localizedModelFactory,
         manufacturerService,
         measureService,
         orderService,
         pictureService,
         productAttributeFormatter,
         productAttributeParser,
         productAttributeService,
         productService,
         productTagService,
         productTemplateService,
         settingModelFactory,
         shipmentService,
         shippingService,
         shoppingCartService,
         specificationAttributeService,
         cacheManager,
         storeMappingSupportedModelFactory,
         storeService,
         urlRecordService,
         workContext,
         measureSettings,
         taxSettings,
         vendorSettings
         )
 {
     _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;
 }
 public HomeController(UserManager <ApplicationUser> manager, IPurchaseService serv, IMeasureService serv2, IHostingEnvironment ien, IStringLocalizer <SharedResource> _sr)
 {
     _userManager        = manager;
     _iserv              = serv;
     _iservmes           = serv2;
     _hostingEnvironment = ien;
     _sharedLocalizer    = _sr;
 }
Example #53
0
 public CatalogHelper(
     SmartDbContext db,
     ICommonServices services,
     IMenuService menuService,
     IManufacturerService manufacturerService,
     IProductService productService,
     //IProductTemplateService productTemplateService,
     IProductAttributeService productAttributeService,
     IProductAttributeMaterializer productAttributeMaterializer,
     IProductAttributeFormatter productAttributeFormatter,
     ITaxService taxService,
     ICurrencyService currencyService,
     IMediaService mediaService,
     IPriceCalculationService priceCalculationService,
     //IPriceFormatter priceFormatter,
     //ISpecificationAttributeService specificationAttributeService,
     IDateTimeHelper dateTimeHelper,
     //IBackInStockSubscriptionService backInStockSubscriptionService,
     IDownloadService downloadService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     CustomerSettings customerSettings,
     CaptchaSettings captchaSettings,
     IMeasureService measureService,
     //IQuantityUnitService quantityUnitService,
     MeasureSettings measureSettings,
     TaxSettings taxSettings,
     PerformanceSettings performanceSettings,
     IDeliveryTimeService deliveryTimeService,
     Lazy <IDataExporter> dataExporter,
     ICatalogSearchService catalogSearchService,
     ICatalogSearchQueryFactory catalogSearchQueryFactory,
     IUrlHelper urlHelper,
     ProductUrlHelper productUrlHelper,
     ILocalizedEntityService localizedEntityService,
     IUrlService urlService,
     ILinkResolver linkResolver)
 {
     _db                  = db;
     _services            = services;
     _workContext         = services.WorkContext;
     _storeContext        = services.StoreContext;
     _cache               = services.Cache;
     _menuService         = menuService;
     _manufacturerService = manufacturerService;
     _productService      = productService;
     //_productTemplateService = productTemplateService;
     _productAttributeService      = productAttributeService;
     _productAttributeMaterializer = productAttributeMaterializer;
     _productAttributeFormatter    = productAttributeFormatter;
     _taxService              = taxService;
     _currencyService         = currencyService;
     _mediaService            = mediaService;
     _localizationService     = _services.Localization;
     _priceCalculationService = priceCalculationService;
     //_priceFormatter = priceFormatter;
     //_specificationAttributeService = specificationAttributeService;
     _dateTimeHelper = dateTimeHelper;
     //_backInStockSubscriptionService = backInStockSubscriptionService;
     _downloadService = downloadService;
     _measureService  = measureService;
     //_quantityUnitService = quantityUnitService;
     _measureSettings           = measureSettings;
     _taxSettings               = taxSettings;
     _performanceSettings       = performanceSettings;
     _deliveryTimeService       = deliveryTimeService;
     _mediaSettings             = mediaSettings;
     _catalogSettings           = catalogSettings;
     _customerSettings          = customerSettings;
     _captchaSettings           = captchaSettings;
     _dataExporter              = dataExporter;
     _catalogSearchService      = catalogSearchService;
     _catalogSearchQueryFactory = catalogSearchQueryFactory;
     _urlHelper              = urlHelper;
     _productUrlHelper       = productUrlHelper;
     _localizedEntityService = localizedEntityService;
     _urlService             = urlService;
     _linkResolver           = linkResolver;
     _httpRequest            = _urlHelper.ActionContext.HttpContext.Request;
 }
Example #54
0
 public CardUpdatedHandler(IMeasureService measureService)
 {
     _measureService = measureService;
 }
Example #55
0
        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,
                                                                                      IMeasureService measureService,
                                                                                      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(),
                    ProductType      = product.ProductType,
                    MarkAsNew        = product.MarkAsNew &&
                                       (!product.MarkAsNewStartDateTimeUtc.HasValue || product.MarkAsNewStartDateTimeUtc.Value < DateTime.UtcNow) &&
                                       (!product.MarkAsNewEndDateTimeUtc.HasValue || product.MarkAsNewEndDateTimeUtc.Value > DateTime.UtcNow)
                };
                //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);

                        //add to cart button (ignore "DisableBuyButton" property for grouped products)
                        priceModel.DisableBuyButton = !permissionService.Authorize(StandardPermissionProvider.EnableShoppingCart) ||
                                                      !permissionService.Authorize(StandardPermissionProvider.DisplayPrices);

                        //add to wishlist button (ignore "DisableWishlistButton" property for grouped products)
                        priceModel.DisableWishlistButton = !permissionService.Authorize(StandardPermissionProvider.EnableWishlist) ||
                                                           !permissionService.Authorize(StandardPermissionProvider.DisplayPrices);

                        //compare products
                        priceModel.DisableAddToCompareListButton = !catalogSettings.CompareProductsEnabled;
                        switch (associatedProducts.Count)
                        {
                        case 0:
                        {
                            //no associated products
                        }
                        break;

                        default:
                        {
                            //we have at least one associated product
                            //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)
                                {
                                    //` 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));
                                            priceModel.PriceValue = finalPrice;

                                            //PAngV baseprice (used in Germany)
                                            priceModel.BasePricePAngV = product.FormatBasePrice(finalPrice,
                                                                                                localizationService, measureService, currencyService, workContext, priceFormatter);
                                        }
                                        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.Any() &&
                                                              !(tierPrices.Count == 1 && tierPrices[0].Quantity <= 1);
                                    if (displayFromMessage)
                                    {
                                        priceModel.OldPrice   = null;
                                        priceModel.Price      = String.Format(localizationService.GetResource("Products.PriceRangeFrom"), priceFormatter.FormatPrice(finalPrice));
                                        priceModel.PriceValue = finalPrice;
                                    }
                                    else
                                    {
                                        if (finalPriceBase != oldPriceBase && oldPriceBase != decimal.Zero)
                                        {
                                            priceModel.OldPrice   = priceFormatter.FormatPrice(oldPrice);
                                            priceModel.Price      = priceFormatter.FormatPrice(finalPrice);
                                            priceModel.PriceValue = 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;


                                        //PAngV baseprice (used in Germany)
                                        priceModel.BasePricePAngV = product.FormatBasePrice(finalPrice,
                                                                                            localizationService, measureService, currencyService, workContext, priceFormatter);
                                    }
                                }
                            }
                            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, () =>
                    {
                        // GetPicturesByProductId 找出product所有的图片,DisplayOrder排序, 软后选出第一个作为默认的图片
                        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 = controller.PrepareProductReviewOverviewModel(storeContext, catalogSettings, cacheManager, product);

                models.Add(model);
            }

            return(models);
        }
Example #56
0
        public InvoicesController(IOrderService orderService,
                                  IOrderReportService orderReportService,
                                  IOrderProcessingService orderProcessingService,
                                  IPriceCalculationService priceCalculationService,
                                  IDateTimeHelper dateTimeHelper,
                                  IPriceFormatter priceFormatter,
                                  IDiscountService discountService,
                                  ILocalizationService localizationService,
                                  IWorkContext workContext,
                                  ICurrencyService currencyService,
                                  IEncryptionService encryptionService,
                                  IPaymentService paymentService,
                                  IMeasureService measureService,
                                  IPdfService pdfService,
                                  IAddressService addressService,
                                  ICountryService countryService,
                                  IStateProvinceService stateProvinceService,
                                  Nop.Services.Catalog.IProductService productService,
                                  IExportManager exportManager,
                                  IPermissionService permissionService,
                                  IWorkflowMessageService workflowMessageService,
                                  ICategoryService categoryService,
                                  IManufacturerService manufacturerService,
                                  IProductAttributeService productAttributeService,
                                  IProductAttributeParser productAttributeParser,
                                  IProductAttributeFormatter productAttributeFormatter,
                                  IShoppingCartService shoppingCartService,
                                  IGiftCardService giftCardService,
                                  IDownloadService downloadService,
                                  IShipmentService shipmentService,
                                  IShippingService shippingService,
                                  IStoreService storeService,
                                  IVendorService vendorService,
                                  IAddressAttributeParser addressAttributeParser,
                                  IAddressAttributeService addressAttributeService,
                                  IAddressAttributeFormatter addressAttributeFormatter,
                                  IAffiliateService affiliateService,
                                  IPictureService pictureService,
                                  CurrencySettings currencySettings,
                                  TaxSettings taxSettings,
                                  MeasureSettings measureSettings,
                                  AddressSettings addressSettings,
                                  ShippingSettings shippingSettings,
                                  IInvoiceService invoiceService,
                                  IGenericAttributeService genericAttributeService,
                                  IProductTemplateService productTemplateService,
                                  IStoreContext storeContext,
                                  ISettingService settingService,
                                  IGroupDealService groupDealService)
        {
            this._orderService            = orderService;
            this._orderReportService      = orderReportService;
            this._orderProcessingService  = orderProcessingService;
            this._priceCalculationService = priceCalculationService;
            this._dateTimeHelper          = dateTimeHelper;
            this._priceFormatter          = priceFormatter;
            this._discountService         = discountService;
            this._localizationService     = localizationService;
            this._workContext             = workContext;
            this._currencyService         = currencyService;
            this._encryptionService       = encryptionService;
            this._paymentService          = paymentService;
            this._measureService          = measureService;
            this._pdfService                = pdfService;
            this._addressService            = addressService;
            this._countryService            = countryService;
            this._stateProvinceService      = stateProvinceService;
            this._productService            = productService;
            this._exportManager             = exportManager;
            this._permissionService         = permissionService;
            this._workflowMessageService    = workflowMessageService;
            this._categoryService           = categoryService;
            this._manufacturerService       = manufacturerService;
            this._productAttributeService   = productAttributeService;
            this._productAttributeParser    = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._shoppingCartService       = shoppingCartService;
            this._giftCardService           = giftCardService;
            this._downloadService           = downloadService;
            this._shipmentService           = shipmentService;
            this._shippingService           = shippingService;
            this._storeService              = storeService;
            this._vendorService             = vendorService;
            this._addressAttributeParser    = addressAttributeParser;
            this._addressAttributeService   = addressAttributeService;
            this._addressAttributeFormatter = addressAttributeFormatter;
            this._affiliateService          = affiliateService;
            this._pictureService            = pictureService;

            this._currencySettings        = currencySettings;
            this._taxSettings             = taxSettings;
            this._measureSettings         = measureSettings;
            this._addressSettings         = addressSettings;
            this._shippingSettings        = shippingSettings;
            this._invoiceService          = invoiceService;
            this._genericAttributeService = genericAttributeService;
            this._productTemplateService  = productTemplateService;
            this._storeContext            = storeContext;
            this._settingService          = settingService;
            this._groupDealService        = groupDealService;
        }