protected override void OnListItemClick(ListView l, View v, int position, long id)
		{

			switch (position) {
			case 0:
				Android.Widget.Toast.MakeText(this, Config.Version, Android.Widget.ToastLength.Short).Show();
				break;
			case 1:
				Android.Widget.Toast.MakeText(this, Config.PrivacyStatus.ToString(), Android.Widget.ToastLength.Short).Show();
				break;
			case 2:
				Config.PrivacyStatus = MobilePrivacyStatus.MobilePrivacyStatusOptIn;
				break;
			case 3:
				Config.PrivacyStatus = MobilePrivacyStatus.MobilePrivacyStatusOptOut;
				break;
			case 4:
				Config.PrivacyStatus = MobilePrivacyStatus.MobilePrivacyStatusUnknown;
				break;
			case 5:
				Android.Widget.Toast.MakeText(this, Config.LifetimeValue.ToString(), Android.Widget.ToastLength.Short).Show();
				break;
			case 6:
				Android.Widget.Toast.MakeText(this, Config.UserIdentifier, Android.Widget.ToastLength.Short).Show();
				break;
			case 7:
				Config.UserIdentifier = "customUserIdentifier";
				break;
			case 8:
				Android.Widget.Toast.MakeText(this, Config.DebugLogging.ToString(), Android.Widget.ToastLength.Short).Show();
				break;
			case 9:
				Config.DebugLogging = (Java.Lang.Boolean)true;
				break;
			case 10:
				Config.DebugLogging = (Java.Lang.Boolean)false;
				break;
			case 11:
				Config.SetSmallIconResourceId (Resource.Drawable.Icon);
				break;
			case 12:
				Config.SetLargeIconResourceId (Resource.Drawable.Icon);
				break;
			case 13:
				Stream st = Assets.Open("ADBMobileConfig-Another.json");
				Config.OverrideConfigStream (st);
				break;
			case 14:
				var sd = new Dictionary<string, Java.Lang.Object> ();
				sd.Add ("key", (Java.Lang.Object)"value");

				Analytics.TrackState ("stateName", (IDictionary<string, Java.Lang.Object>)sd);
				break;
			case 15:
				Analytics.TrackAction ("actionName", cData);
				break;
			case 16:
				Location loc = new Location(LocationManager.GpsProvider);;
				loc.Latitude = 111;
				loc.Longitude = 44;
				loc.Accuracy = 5;

				Analytics.TrackLocation (loc, cData);
				break;
			case 17:
				Analytics.TrackBeacon ("UUID", "1", "2", Analytics.BEACON_PROXIMITY.ProximityImmediate, cData);
				break;
			case 18:
				Analytics.ClearBeacon ();
				break;
			case 19:
				Analytics.TrackLifetimeValueIncrease (new Java.Math.BigDecimal("1.11"), null);
				break;
			case 20:
				Analytics.TrackTimedActionStart ("timedAction", null);
				break;
			case 21:
				IDictionary<string, Java.Lang.Object> updateCData = new Dictionary<string, Java.Lang.Object> ();
				updateCData.Add ("key", "value");
				Analytics.TrackTimedActionUpdate ("timedAction", (IDictionary<string, Java.Lang.Object>)updateCData);
				break;
			case 22:
				Analytics.TrackTimedActionEnd ("timedAction", new TimedActionBlock());
				break;
			case 23:
				Android.Widget.Toast.MakeText(this, Analytics.TrackingTimedActionExists("timedAction").ToString(), Android.Widget.ToastLength.Short).Show();
				break;
			case 24:
				Android.Widget.Toast.MakeText(this, Analytics.TrackingIdentifier, Android.Widget.ToastLength.Short).Show();
				break;
			case 25:
				Android.Widget.Toast.MakeText(this, Analytics.QueueSize.ToString(), Android.Widget.ToastLength.Short).Show();
				break;
			case 26:
				Analytics.ClearQueue ();
				break;
			case 27:
				Analytics.SendQueuedHits ();
				break;
				// AAM
			case 28:
				Android.Widget.Toast.MakeText(this, AudienceManager.Dpuuid, Android.Widget.ToastLength.Short).Show();
				Android.Widget.Toast.MakeText(this, AudienceManager.Dpid, Android.Widget.ToastLength.Short).Show();
				break;
			case 29:
				Android.Widget.Toast.MakeText(this, AudienceManager.VisitorProfile!=null? AudienceManager.VisitorProfile.ToString():"", Android.Widget.ToastLength.Short).Show();
				break;
			case 30:
				AudienceManager.SetDpidAndDpuuid ("testDppid", "testDpuuid");
				break;
			case 31:
				IDictionary<string, Java.Lang.Object> traits = new Dictionary<string, Java.Lang.Object> ();
				traits.Add ("trait", "b");

				AudienceManager.SignalWithData (traits, new AudienceManagerCallback());
				break;
			case 32:
				AudienceManager.Reset ();
				break;
				//Target
			case 33:
				IDictionary<string, Java.Lang.Object> parameters = new Dictionary<string, Java.Lang.Object> ();
				parameters.Add ("key", "value");
				var req = Target.CreateRequest ("AndroidTest", "defGal", parameters);
				Target.LoadRequest (req, new TargetCallback());
				break;
			case 34:
				var orderConfirm = Target.CreateOrderConfirmRequest ("myOrder", "12345", "29.41", "cool stuff", null);
				Target.LoadRequest (orderConfirm,  new TargetCallback());
				break;
			case 35:
				Target.ClearCookies ();
				break;
			case 36:
				Android.Widget.Toast.MakeText(this, Target.PcID, Android.Widget.ToastLength.Short).Show();
				break;
			case 37:
				Android.Widget.Toast.MakeText(this, Target.SessionID, Android.Widget.ToastLength.Short).Show();
				break;
				//VisitorID
			case 38:
				Android.Widget.Toast.MakeText(this, Visitor.MarketingCloudId, Android.Widget.ToastLength.Short).Show();
				break;
			case 39:
				IDictionary<string, string> ids = new Dictionary<string, string> ();
				ids.Add ("pushID", "value2");
				Visitor.SyncIdentifiers (ids);
				break;
				//Media
			case 40:
				settings = Media.SettingsWith ("name1", 10, "playerName1", "playerID1");
				settings.Milestones = "25,50,75";
				break;
			case 41:
				MediaSettings adSettings = Media.AdSettingsWith ("adName1", 2, "playerName1", "name1", "podName1", 4, "CPM1");
				break;
			case 42:
				Media.Open (settings, new MediaCallback());
				break;
			case 43:
				Media.Close ("name1");
				break;
			case 44:
				Media.Play ("name1", 0);
				break;
			case 45:
				Media.Complete ("name1", 3);
				break;
			case 46:
				Media.Stop ("name1", 3);
				break;
			case 47:
				Media.Click ("adName1", 3);
				break;	
			case 48:
				Media.Track ("name1",null);
				break;
			
			}
		}
Esempio n. 2
0
 public static MediaSettingsModel ToModel(this MediaSettings entity)
 {
     return(entity.MapTo <MediaSettings, MediaSettingsModel>());
 }
 protected virtual void FillMediaSettingsData(MediaSettings settings)
 {
     ViewData["AllowedMediaExtensions"] = settings.AllowedMediaExtensions;
 }
Esempio n. 4
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,
                                                                                      IWebHelper webHelper,
                                                                                      ICacheManager cacheManager,
                                                                                      CatalogSettings catalogSettings,
                                                                                      MediaSettings mediaSettings,
                                                                                      IEnumerable <Product> products,
                                                                                      bool preparePriceModel                 = true, bool preparePictureModel = true,
                                                                                      int?productThumbPictureSize            = null, bool prepareSpecificationAttributes = false,
                                                                                      bool forceRedirectionAfterAddingToCart = false)
        {
            if (products == null)
            {
                throw new ArgumentNullException("products");
            }

            var models = new List <ProductOverviewModel>();

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

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

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

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

                        switch (associatedProducts.Count)
                        {
                        case 0:
                        {
                            //no associated products
                            priceModel.OldPrice              = null;
                            priceModel.Price                 = null;
                            priceModel.DisableBuyButton      = true;
                            priceModel.DisableWishlistButton = true;
                            priceModel.AvailableForPreOrder  = false;
                        }
                        break;

                        default:
                        {
                            //we have at least one associated product
                            priceModel.DisableBuyButton      = true;
                            priceModel.DisableWishlistButton = true;
                            priceModel.AvailableForPreOrder  = false;

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

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

                        #endregion
                    }
                    break;

                    case ProductType.SimpleProduct:
                    default:
                    {
                        #region Simple product

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

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

                        //rental
                        priceModel.IsRental = product.IsRental;

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

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

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

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

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

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


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

                        #endregion
                    }
                    break;
                    }

                    model.ProductPrice = priceModel;

                    #endregion
                }

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

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

                    #endregion
                }

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

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

                models.Add(model);
            }
            return(models);
        }
Esempio n. 5
0
        private OrderDetailsModel.OrderItemModel PrepareOrderItemModel(
            Order order,
            OrderItem orderItem,
            CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings,
            MediaSettings mediaSettings)
        {
            var language = _services.WorkContext.WorkingLanguage;

            orderItem.Product.MergeWithCombination(orderItem.AttributesXml);

            var model = new OrderDetailsModel.OrderItemModel
            {
                Id            = orderItem.Id,
                Sku           = orderItem.Product.Sku,
                ProductId     = orderItem.Product.Id,
                ProductName   = orderItem.Product.GetLocalized(x => x.Name),
                ProductSeName = orderItem.Product.GetSeName(),
                ProductType   = orderItem.Product.ProductType,
                Quantity      = orderItem.Quantity,
                AttributeInfo = orderItem.AttributeDescription
            };

            var quantityUnit = _quantityUnitService.GetQuantityUnitById(orderItem.Product.QuantityUnitId);

            model.QuantityUnit = quantityUnit == null ? "" : quantityUnit.GetLocalized(x => x.Name);

            if (orderItem.Product.ProductType == ProductType.BundledProduct && orderItem.BundleData.HasValue())
            {
                var bundleData  = orderItem.GetBundleData();
                var bundleItems = shoppingCartSettings.ShowProductBundleImagesOnShoppingCart
                    ? _productService.GetBundleItems(orderItem.ProductId).ToDictionarySafe(x => x.Item.ProductId)
                    : new Dictionary <int, ProductBundleItemData>();

                model.BundlePerItemPricing      = orderItem.Product.BundlePerItemPricing;
                model.BundlePerItemShoppingCart = bundleData.Any(x => x.PerItemShoppingCart);

                foreach (var bid in bundleData)
                {
                    var bundleItemModel = new OrderDetailsModel.BundleItemModel
                    {
                        Sku                 = bid.Sku,
                        ProductName         = bid.ProductName,
                        ProductSeName       = bid.ProductSeName,
                        VisibleIndividually = bid.VisibleIndividually,
                        Quantity            = bid.Quantity,
                        DisplayOrder        = bid.DisplayOrder,
                        AttributeInfo       = bid.AttributesInfo
                    };

                    bundleItemModel.ProductUrl = _productUrlHelper.GetProductUrl(bid.ProductId, bundleItemModel.ProductSeName, bid.AttributesXml);

                    if (model.BundlePerItemShoppingCart)
                    {
                        var priceWithDiscount = _currencyService.ConvertCurrency(bid.PriceWithDiscount, order.CurrencyRate);
                        bundleItemModel.PriceWithDiscount = _priceFormatter.FormatPrice(priceWithDiscount, true, order.CustomerCurrencyCode, language, false, false);
                    }

                    // Bundle item picture.
                    if (shoppingCartSettings.ShowProductBundleImagesOnShoppingCart && bundleItems.TryGetValue(bid.ProductId, out var bundleItem))
                    {
                        bundleItemModel.HideThumbnail = bundleItem.Item.HideThumbnail;

                        bundleItemModel.Picture = PrepareOrderItemPictureModel(
                            bundleItem.Item.Product,
                            mediaSettings.CartThumbBundleItemPictureSize,
                            bid.ProductName,
                            bid.AttributesXml,
                            catalogSettings);
                    }

                    model.BundleItems.Add(bundleItemModel);
                }
            }

            // Unit price, subtotal.
            switch (order.CustomerTaxDisplayType)
            {
            case TaxDisplayType.ExcludingTax:
            {
                var unitPriceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceExclTax, order.CurrencyRate);
                model.UnitPrice = _priceFormatter.FormatPrice(unitPriceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false, false);

                var priceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceExclTax, order.CurrencyRate);
                model.SubTotal = _priceFormatter.FormatPrice(priceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false, false);
            }
            break;

            case TaxDisplayType.IncludingTax:
            {
                var unitPriceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceInclTax, order.CurrencyRate);
                model.UnitPrice = _priceFormatter.FormatPrice(unitPriceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true, false);

                var priceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceInclTax, order.CurrencyRate);
                model.SubTotal = _priceFormatter.FormatPrice(priceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true, false);
            }
            break;
            }

            model.ProductUrl = _productUrlHelper.GetProductUrl(model.ProductSeName, orderItem);

            if (shoppingCartSettings.ShowProductImagesOnShoppingCart)
            {
                model.Picture = PrepareOrderItemPictureModel(
                    orderItem.Product,
                    mediaSettings.CartThumbPictureSize,
                    model.ProductName,
                    orderItem.AttributesXml,
                    catalogSettings);
            }

            return(model);
        }
Esempio n. 6
0
        /// <summary>
        /// Creates a customer avatar model.
        /// </summary>
        /// <param name="customer">Customer entity.</param>
        /// <param name="genericAttributeService">Generic attribute service.</param>
        /// <param name="pictureService">Picture service.</param>
        /// <param name="customerSettings">Customer settings.</param>
        /// <param name="mediaSettings">Media settings.</param>
        /// <param name="urlHelper">URL helper.</param>
        /// <param name="userName">User name.</param>
        /// <param name="large">Large size.</param>
        /// <returns>Customer avatar model.</returns>
        public static CustomerAvatarModel ToAvatarModel(
            this Customer customer,
            IGenericAttributeService genericAttributeService,
            IPictureService pictureService,
            CustomerSettings customerSettings,
            MediaSettings mediaSettings,
            UrlHelper urlHelper,
            string userName = null,
            bool large      = false)
        {
            Guard.NotNull(customer, nameof(customer));

            var model = new CustomerAvatarModel
            {
                Large    = large,
                UserName = userName
            };

            if (customer.IsGuest())
            {
                model.AvatarLetter = 'G';
                model.AvatarColor  = "light";
            }
            else
            {
                if (customer.FirstName.HasValue())
                {
                    model.AvatarLetter = customer.FirstName.First();
                }
                else if (customer.LastName.HasValue())
                {
                    model.AvatarLetter = customer.LastName.First();
                }
                else if (customer.FullName.HasValue())
                {
                    model.AvatarLetter = customer.FullName.First();
                }
                else if (customer.Username.HasValue())
                {
                    model.AvatarLetter = customer.Username.First();
                }
                else if (userName.HasValue())
                {
                    model.AvatarLetter = userName.First();
                }
                else
                {
                    model.AvatarLetter = '?';
                }

                if (customerSettings.AllowViewingProfiles)
                {
                    model.LinkUrl = urlHelper.RouteUrl("CustomerProfile", new { id = customer.Id });
                }

                if (customerSettings.AllowCustomersToUploadAvatars)
                {
                    var avatarId = customer.GetAttribute <int>(SystemCustomerAttributeNames.AvatarPictureId, genericAttributeService);
                    model.PictureUrl = pictureService.GetUrl(avatarId, mediaSettings.AvatarPictureSize, FallbackPictureType.NoFallback);
                }

                if (model.PictureUrl.IsEmpty())
                {
                    model.AvatarColor = customer.GetAvatarColor(genericAttributeService);
                }
            }

            return(model);
        }
        public GovernmentUnitValidator(IGovernmentService governmentService, CommonSettings commonSettings, MediaSettings mediaSettings)
        {
            _governmentService = governmentService;
            _commonSettings    = commonSettings;
            _mediaSettings     = mediaSettings;

            RuleFor(s => s.Name).NotEmpty().WithMessage("单位名称不能为空").Must(BeUniqueName).WithMessage("名称 {0} 已存在", s => s.Name);
            RuleFor(s => s.Person).NotEmpty().WithMessage("联系人不能为空");
            RuleFor(s => s.Tel).NotEmpty().WithMessage("联系方式不能为空").Matches(commonSettings.TelAndMobliePartten).WithMessage("联系方式不是正确的电话号码格式");
        }
Esempio n. 8
0
 public OverriddenShoppingCartModelFactory(AddressSettings addressSettings,
                                           CaptchaSettings captchaSettings,
                                           CatalogSettings catalogSettings,
                                           CommonSettings commonSettings,
                                           CustomerSettings customerSettings,
                                           IAddressModelFactory addressModelFactory,
                                           ICheckoutAttributeFormatter checkoutAttributeFormatter,
                                           ICheckoutAttributeParser checkoutAttributeParser,
                                           ICheckoutAttributeService checkoutAttributeService,
                                           ICountryService countryService,
                                           ICurrencyService currencyService,
                                           ICustomerService customerService,
                                           IDiscountService discountService,
                                           IDownloadService downloadService,
                                           IGenericAttributeService genericAttributeService,
                                           IGiftCardService giftCardService,
                                           IHttpContextAccessor httpContextAccessor,
                                           ILocalizationService localizationService,
                                           IOrderProcessingService orderProcessingService,
                                           IOrderTotalCalculationService orderTotalCalculationService,
                                           IPaymentService paymentService,
                                           IPermissionService permissionService,
                                           IPictureService pictureService,
                                           IPriceCalculationService priceCalculationService,
                                           IPriceFormatter priceFormatter,
                                           IProductAttributeFormatter productAttributeFormatter,
                                           IProductService productService,
                                           IShippingService shippingService,
                                           IShoppingCartService shoppingCartService,
                                           IStateProvinceService stateProvinceService,
                                           IStaticCacheManager cacheManager,
                                           IStoreContext storeContext,
                                           ITaxService taxService,
                                           IUrlRecordService urlRecordService,
                                           IVendorService vendorService,
                                           IWebHelper webHelper,
                                           IWorkContext workContext,
                                           MediaSettings mediaSettings,
                                           OrderSettings orderSettings,
                                           RewardPointsSettings rewardPointsSettings,
                                           ShippingSettings shippingSettings,
                                           ShoppingCartSettings shoppingCartSettings,
                                           TaxSettings taxSettings,
                                           VendorSettings vendorSettings) : base(addressSettings,
                                                                                 captchaSettings,
                                                                                 catalogSettings,
                                                                                 commonSettings,
                                                                                 customerSettings,
                                                                                 addressModelFactory,
                                                                                 checkoutAttributeFormatter,
                                                                                 checkoutAttributeParser,
                                                                                 checkoutAttributeService,
                                                                                 countryService,
                                                                                 currencyService,
                                                                                 customerService,
                                                                                 discountService,
                                                                                 downloadService,
                                                                                 genericAttributeService,
                                                                                 giftCardService,
                                                                                 httpContextAccessor,
                                                                                 localizationService,
                                                                                 orderProcessingService,
                                                                                 orderTotalCalculationService,
                                                                                 paymentService,
                                                                                 permissionService,
                                                                                 pictureService,
                                                                                 priceCalculationService,
                                                                                 priceFormatter,
                                                                                 productAttributeFormatter,
                                                                                 productService,
                                                                                 shippingService,
                                                                                 shoppingCartService,
                                                                                 stateProvinceService,
                                                                                 cacheManager,
                                                                                 storeContext,
                                                                                 taxService,
                                                                                 urlRecordService,
                                                                                 vendorService,
                                                                                 webHelper,
                                                                                 workContext,
                                                                                 mediaSettings,
                                                                                 orderSettings,
                                                                                 rewardPointsSettings,
                                                                                 shippingSettings,
                                                                                 shoppingCartSettings,
                                                                                 taxSettings,
                                                                                 vendorSettings)
 {
     this._countryService               = countryService;
     this._currencyService              = currencyService;
     this._genericAttributeService      = genericAttributeService;
     this._giftCardService              = giftCardService;
     this._httpContextAccessor          = httpContextAccessor;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._paymentService               = paymentService;
     this._priceCalculationService      = priceCalculationService;
     this._priceFormatter               = priceFormatter;
     this._shoppingCartService          = shoppingCartService;
     this._stateProvinceService         = stateProvinceService;
     this._storeContext         = storeContext;
     this._taxService           = taxService;
     this._workContext          = workContext;
     this._rewardPointsSettings = rewardPointsSettings;
     this._shippingSettings     = shippingSettings;
     this._taxSettings          = taxSettings;
 }
Esempio n. 9
0
 public static MediaSettingsModel ToModel(this MediaSettings entity)
 {
     return(Mapper.Map <MediaSettings, MediaSettingsModel>(entity));
 }
Esempio n. 10
0
 public GetShoppingCartHandler(
     IPaymentService paymentService,
     IProductService productService,
     IPictureService pictureService,
     IProductAttributeParser productAttributeParser,
     ITranslationService translationService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     ICurrencyService currencyService,
     IDiscountService discountService,
     ICheckoutAttributeService checkoutAttributeService,
     IPermissionService permissionService,
     ITaxService taxService,
     IPriceFormatter priceFormatter,
     ICheckoutAttributeParser checkoutAttributeParser,
     IDownloadService downloadService,
     ICountryService countryService,
     IWarehouseService warehouseService,
     IProductAttributeFormatter productAttributeFormatter,
     IPricingService priceCalculationService,
     IDateTimeService dateTimeService,
     IVendorService vendorService,
     IGroupService groupService,
     IMediator mediator,
     IShoppingCartValidator shoppingCartValidator,
     IHttpContextAccessor httpContextAccessor,
     LinkGenerator linkGenerator,
     MediaSettings mediaSettings,
     OrderSettings orderSettings,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     ShippingSettings shippingSettings,
     CommonSettings commonSettings)
 {
     _paymentService             = paymentService;
     _productService             = productService;
     _pictureService             = pictureService;
     _productAttributeParser     = productAttributeParser;
     _translationService         = translationService;
     _checkoutAttributeFormatter = checkoutAttributeFormatter;
     _currencyService            = currencyService;
     _discountService            = discountService;
     _checkoutAttributeService   = checkoutAttributeService;
     _permissionService          = permissionService;
     _taxService                = taxService;
     _priceFormatter            = priceFormatter;
     _checkoutAttributeParser   = checkoutAttributeParser;
     _downloadService           = downloadService;
     _countryService            = countryService;
     _warehouseService          = warehouseService;
     _productAttributeFormatter = productAttributeFormatter;
     _pricingService            = priceCalculationService;
     _dateTimeService           = dateTimeService;
     _vendorService             = vendorService;
     _groupService              = groupService;
     _mediator = mediator;
     _shoppingCartValidator = shoppingCartValidator;
     _httpContextAccessor   = httpContextAccessor;
     _linkGenerator         = linkGenerator;
     _mediaSettings         = mediaSettings;
     _orderSettings         = orderSettings;
     _shoppingCartSettings  = shoppingCartSettings;
     _catalogSettings       = catalogSettings;
     _shippingSettings      = shippingSettings;
     _commonSettings        = commonSettings;
 }
Esempio n. 11
0
 public GetAvatarHandler(IPictureService pictureService,
                         MediaSettings mediaSettings)
 {
     _pictureService = pictureService;
     _mediaSettings  = mediaSettings;
 }
Esempio n. 12
0
 public CustomerWebService(
     IExternalAuthenticationService externalAuthenticationService,
     ICustomerAttributeParser customerAttributeParser,
     ICustomerAttributeService customerAttributeService,
     ILocalizationService localizationService,
     IDateTimeHelper dateTimeHelper,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IGenericAttributeService genericAttributeService,
     IWorkflowMessageService workflowMessageService,
     IReturnRequestService returnRequestService,
     IStoreMappingService storeMappingService,
     IAddressWebService addressWebService,
     IOrderService orderService,
     IDownloadService downloadService,
     IPictureService pictureService,
     IProductService productService,
     IAuctionService auctionService,
     CustomerSettings customerSettings,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     ForumSettings forumSettings,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     SecuritySettings securitySettings,
     CaptchaSettings captchaSettings,
     RewardPointsSettings rewardPointsSettings,
     OrderSettings orderSettings,
     MediaSettings mediaSettings,
     VendorSettings vendorSettings
     )
 {
     this._externalAuthenticationService = externalAuthenticationService;
     this._customerAttributeParser       = customerAttributeParser;
     this._customerAttributeService      = customerAttributeService;
     this._localizationService           = localizationService;
     this._dateTimeHelper = dateTimeHelper;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._workContext                    = workContext;
     this._storeContext                   = storeContext;
     this._countryService                 = countryService;
     this._stateProvinceService           = stateProvinceService;
     this._genericAttributeService        = genericAttributeService;
     this._workflowMessageService         = workflowMessageService;
     this._returnRequestService           = returnRequestService;
     this._storeMappingService            = storeMappingService;
     this._addressWebService              = addressWebService;
     this._orderService                   = orderService;
     this._downloadService                = downloadService;
     this._pictureService                 = pictureService;
     this._productService                 = productService;
     this._auctionService                 = auctionService;
     this._customerSettings               = customerSettings;
     this._dateTimeSettings               = dateTimeSettings;
     this._taxSettings                    = taxSettings;
     this._forumSettings                  = forumSettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._securitySettings               = securitySettings;
     this._captchaSettings                = captchaSettings;
     this._rewardPointsSettings           = rewardPointsSettings;
     this._orderSettings                  = orderSettings;
     this._mediaSettings                  = mediaSettings;
     this._vendorSettings                 = vendorSettings;
 }
 public JbimagesController(IPermissionService permissionService, MediaSettings mediaSettings)
 {
     _permissionService = permissionService;
     _mediaSettings     = mediaSettings;
 }
Esempio n. 14
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            switch (position)
            {
            case 0:
                Android.Widget.Toast.MakeText(this, Config.Version, Android.Widget.ToastLength.Short).Show();
                break;

            case 1:
                Android.Widget.Toast.MakeText(this, Config.PrivacyStatus.ToString(), Android.Widget.ToastLength.Short).Show();
                break;

            case 2:
                Config.PrivacyStatus = MobilePrivacyStatus.MobilePrivacyStatusOptIn;
                break;

            case 3:
                Config.PrivacyStatus = MobilePrivacyStatus.MobilePrivacyStatusOptOut;
                break;

            case 4:
                Config.PrivacyStatus = MobilePrivacyStatus.MobilePrivacyStatusUnknown;
                break;

            case 5:
                Android.Widget.Toast.MakeText(this, Config.LifetimeValue.ToString(), Android.Widget.ToastLength.Short).Show();
                break;

            case 6:
                Android.Widget.Toast.MakeText(this, Config.UserIdentifier, Android.Widget.ToastLength.Short).Show();
                break;

            case 7:
                Config.UserIdentifier = "customUserIdentifier";
                break;

            case 8:
                Android.Widget.Toast.MakeText(this, Config.DebugLogging.ToString(), Android.Widget.ToastLength.Short).Show();
                break;

            case 9:
                Config.DebugLogging = (Java.Lang.Boolean)true;
                break;

            case 10:
                Config.DebugLogging = (Java.Lang.Boolean)false;
                break;

            case 11:
                Config.SetSmallIconResourceId(Resource.Drawable.Icon);
                break;

            case 12:
                Config.SetLargeIconResourceId(Resource.Drawable.Icon);
                break;

            case 13:
                Stream st = Assets.Open("ADBMobileConfig-Another.json");
                Config.OverrideConfigStream(st);
                break;

            case 14:
                var sd = new Dictionary <string, Java.Lang.Object> ();
                sd.Add("key", (Java.Lang.Object) "value");

                Analytics.TrackState("stateName", (IDictionary <string, Java.Lang.Object>)sd);
                break;

            case 15:
                Analytics.TrackAction("actionName", cData);
                break;

            case 16:
                Location loc = new Location(LocationManager.GpsProvider);;
                loc.Latitude  = 111;
                loc.Longitude = 44;
                loc.Accuracy  = 5;

                Analytics.TrackLocation(loc, cData);
                break;

            case 17:
                Analytics.TrackBeacon("UUID", "1", "2", Analytics.BEACON_PROXIMITY.ProximityImmediate, cData);
                break;

            case 18:
                Analytics.ClearBeacon();
                break;

            case 19:
                Analytics.TrackLifetimeValueIncrease(new Java.Math.BigDecimal("1.11"), null);
                break;

            case 20:
                Analytics.TrackTimedActionStart("timedAction", null);
                break;

            case 21:
                IDictionary <string, Java.Lang.Object> updateCData = new Dictionary <string, Java.Lang.Object> ();
                updateCData.Add("key", "value");
                Analytics.TrackTimedActionUpdate("timedAction", (IDictionary <string, Java.Lang.Object>)updateCData);
                break;

            case 22:
                Analytics.TrackTimedActionEnd("timedAction", new TimedActionBlock());
                break;

            case 23:
                Android.Widget.Toast.MakeText(this, Analytics.TrackingTimedActionExists("timedAction").ToString(), Android.Widget.ToastLength.Short).Show();
                break;

            case 24:
                Android.Widget.Toast.MakeText(this, Analytics.TrackingIdentifier, Android.Widget.ToastLength.Short).Show();
                break;

            case 25:
                Android.Widget.Toast.MakeText(this, Analytics.QueueSize.ToString(), Android.Widget.ToastLength.Short).Show();
                break;

            case 26:
                Analytics.ClearQueue();
                break;

            case 27:
                Analytics.SendQueuedHits();
                break;

            // AAM
            case 28:
                Android.Widget.Toast.MakeText(this, AudienceManager.Dpuuid, Android.Widget.ToastLength.Short).Show();
                Android.Widget.Toast.MakeText(this, AudienceManager.Dpid, Android.Widget.ToastLength.Short).Show();
                break;

            case 29:
                Android.Widget.Toast.MakeText(this, AudienceManager.VisitorProfile != null? AudienceManager.VisitorProfile.ToString():"", Android.Widget.ToastLength.Short).Show();
                break;

            case 30:
                AudienceManager.SetDpidAndDpuuid("testDppid", "testDpuuid");
                break;

            case 31:
                IDictionary <string, Java.Lang.Object> traits = new Dictionary <string, Java.Lang.Object> ();
                traits.Add("trait", "b");

                AudienceManager.SignalWithData(traits, new AudienceManagerCallback());
                break;

            case 32:
                AudienceManager.Reset();
                break;

            //Target
            case 33:
                IDictionary <string, Java.Lang.Object> parameters = new Dictionary <string, Java.Lang.Object> ();
                parameters.Add("key", "value");
                var req = Target.CreateRequest("AndroidTest", "defGal", parameters);
                Target.LoadRequest(req, new TargetCallback());
                break;

            case 34:
                var orderConfirm = Target.CreateOrderConfirmRequest("myOrder", "12345", "29.41", "cool stuff", null);
                Target.LoadRequest(orderConfirm, new TargetCallback());
                break;

            case 35:
                Target.ClearCookies();
                break;

            case 36:
                Android.Widget.Toast.MakeText(this, Target.PcID, Android.Widget.ToastLength.Short).Show();
                break;

            case 37:
                Android.Widget.Toast.MakeText(this, Target.SessionID, Android.Widget.ToastLength.Short).Show();
                break;

            //VisitorID
            case 38:
                Android.Widget.Toast.MakeText(this, Visitor.MarketingCloudId, Android.Widget.ToastLength.Short).Show();
                break;

            case 39:
                IDictionary <string, string> ids = new Dictionary <string, string> ();
                ids.Add("pushID", "value2");
                Visitor.SyncIdentifiers(ids);
                break;

            //Media
            case 40:
                settings            = Media.SettingsWith("name1", 10, "playerName1", "playerID1");
                settings.Milestones = "25,50,75";
                break;

            case 41:
                MediaSettings adSettings = Media.AdSettingsWith("adName1", 2, "playerName1", "name1", "podName1", 4, "CPM1");
                break;

            case 42:
                Media.Open(settings, new MediaCallback());
                break;

            case 43:
                Media.Close("name1");
                break;

            case 44:
                Media.Play("name1", 0);
                break;

            case 45:
                Media.Complete("name1", 3);
                break;

            case 46:
                Media.Stop("name1", 3);
                break;

            case 47:
                Media.Click("adName1", 3);
                break;

            case 48:
                Media.Track("name1", null);
                break;

            case 49:             // "setAdvertisingIdentifier",
                Config.SubmitAdvertisingIdentifierTask(new AdidTaskNotNull());
                break;

            case 50:             // "setPushIdentifier",
                Config.SetPushIdentifier("testPushId");
                break;

            case 51:             // "registerAdobeDataCallback"
                Config.RegisterAdobeDataCallback(new AdobeDataCallback());
                break;

            case 52:             // "trackAdobeDeepLink"
                Config.TrackAdobeDeepLink(Android.Net.Uri.Parse("http://adobe.com?a.deeplink.id=121212"));
                break;

            case 53:             // "acquisitionCampaignStartForApp"
                ThreadPool.QueueUserWorkItem(o => doCampaignStartForApp());
                break;

            case 54:             // "targetLoadRequestWithRequestLocation"
                IDictionary <string, Java.Lang.Object> mboxData2 = new Dictionary <string, Java.Lang.Object>();
                mboxData2.Add("mboxkey", "val");
                IDictionary <string, Java.Lang.Object> orderData2 = new Dictionary <string, Java.Lang.Object>();
                orderData2.Add("orderkey", "val");
                IDictionary <string, Java.Lang.Object> profileData2 = new Dictionary <string, Java.Lang.Object>();
                profileData2.Add("profilekey", "val");
                IDictionary <string, Java.Lang.Object> requestLocationData = new Dictionary <string, Java.Lang.Object>();
                requestLocationData.Add("key", "val");
                Target.LoadRequest("someMbox", "defaultContent", mboxData2, orderData2, profileData2, requestLocationData, this);
                break;

            case 55:             // "targetThirdPartyId"
                Android.Widget.Toast.MakeText(this, Target.ThirdPartyID, Android.Widget.ToastLength.Short).Show();
                break;

            case 56:             // "targetSetThirdPartyId"
                Target.ThirdPartyID = "testThirdPartyId";
                break;

            case 57:             // "targetPcID"
                Toast.MakeText(this, Target.PcID, Android.Widget.ToastLength.Short).Show();
                break;

            case 58:             // "targetSessionID"
                Toast.MakeText(this, Target.SessionID, Android.Widget.ToastLength.Short).Show();
                break;

            case 59:             // "visitorSyncIdentifiers"
                Visitor.SyncIdentifier("idType", "identifier0", VisitorID.VisitorIDAuthenticationState.VisitorIdAuthenticationStateAuthenticated);
                break;

            case 60:             // "visitorSyncIdentifiersAuthState"
                IDictionary <string, string> visitorData = new Dictionary <string, string>();
                visitorData.Add("key", "val");
                Visitor.SyncIdentifiers(visitorData);
                break;

            case 61:             // "visitorSyncIdentifierWithTypeAuthState"
                IDictionary <string, string> visitorData2 = new Dictionary <string, string>();
                visitorData2.Add("key2", "val2");
                Visitor.SyncIdentifiers(visitorData2, VisitorID.VisitorIDAuthenticationState.VisitorIdAuthenticationStateUnknown);
                break;

            case 62:             // "visitorGetIDs"
                if (Visitor.Identifiers != null)
                {
                    Toast.MakeText(this, Visitor.Identifiers.ToString(), ToastLength.Long).Show();
                }
                break;

            case 63:             // "visitorAppendToURL"
                Toast.MakeText(this, Visitor.AppendToURL("http://adobe.com"), ToastLength.Long).Show();
                break;
            }
        }
Esempio n. 15
0
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           IBlogService blogService,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INewsService newsService,
                           INopFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           IShoppingCartService shoppingCartService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager staticCacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           MediaSettings mediaSettings,
                           NewsSettings newsSettings,
                           SitemapSettings sitemapSettings,
                           SitemapXmlSettings sitemapXmlSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     _blogSettings     = blogSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     _forumSettings           = forumSettings;
     _actionContextAccessor   = actionContextAccessor;
     _blogService             = blogService;
     _categoryService         = categoryService;
     _currencyService         = currencyService;
     _customerService         = customerService;
     _forumService            = forumService;
     _genericAttributeService = genericAttributeService;
     _httpContextAccessor     = httpContextAccessor;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _manufacturerService     = manufacturerService;
     _newsService             = newsService;
     _fileProvider            = fileProvider;
     _pageHeadBuilder         = pageHeadBuilder;
     _permissionService       = permissionService;
     _pictureService          = pictureService;
     _productService          = productService;
     _productTagService       = productTagService;
     _shoppingCartService     = shoppingCartService;
     _sitemapGenerator        = sitemapGenerator;
     _staticCacheManager      = staticCacheManager;
     _storeContext            = storeContext;
     _themeContext            = themeContext;
     _themeProvider           = themeProvider;
     _topicService            = topicService;
     _urlHelperFactory        = urlHelperFactory;
     _urlRecordService        = urlRecordService;
     _webHelper                = webHelper;
     _workContext              = workContext;
     _mediaSettings            = mediaSettings;
     _localizationSettings     = localizationSettings;
     _newsSettings             = newsSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }
Esempio n. 16
0
 public static MediaSettings ToEntity(this MediaSettingsModel model, MediaSettings destination)
 {
     return(Mapper.Map(model, destination));
 }
 public DefaultImageProcessor(IImageFactory imageFactory, IEventPublisher eventPublisher, MediaSettings mediaSettings)
 {
     Factory         = imageFactory;
     _eventPublisher = eventPublisher;
     _mediaSettings  = mediaSettings;
 }
        /// <summary>
        /// Creates a customer avatar model.
        /// </summary>
        /// <param name="customer">Customer entity.</param>
        /// <param name="genericAttributeService">Generic attribute service.</param>
        /// <param name="mediaService">Media service.</param>
        /// <param name="customerSettings">Customer settings.</param>
        /// <param name="mediaSettings">Media settings.</param>
        /// <param name="urlHelper">URL helper.</param>
        /// <param name="userName">User name.</param>
        /// <param name="large">Large size.</param>
        /// <returns>Customer avatar model.</returns>
        public static CustomerAvatarModel ToAvatarModel(
            this Customer customer,
            IGenericAttributeService genericAttributeService,
            CustomerSettings customerSettings,
            MediaSettings mediaSettings,
            string userName = null,
            bool large      = false)
        {
            Guard.NotNull(customer, nameof(customer));

            var model = new CustomerAvatarModel
            {
                Id                   = customer.Id,
                Large                = large,
                UserName             = userName,
                AllowViewingProfiles = customerSettings.AllowViewingProfiles,
                AvatarPictureSize    = mediaSettings.AvatarPictureSize
            };

            if (customer.IsGuest())
            {
                model.AvatarLetter = 'G';
                model.AvatarColor  = "light";
            }
            else
            {
                if (customer.FirstName.HasValue())
                {
                    model.AvatarLetter = customer.FirstName.First();
                }
                else if (customer.LastName.HasValue())
                {
                    model.AvatarLetter = customer.LastName.First();
                }
                else if (customer.FullName.HasValue())
                {
                    model.AvatarLetter = customer.FullName.First();
                }
                else if (customer.Username.HasValue())
                {
                    model.AvatarLetter = customer.Username.First();
                }
                else if (userName.HasValue())
                {
                    model.AvatarLetter = userName.First();
                }
                else
                {
                    model.AvatarLetter = '?';
                }

                if (customerSettings.AllowCustomersToUploadAvatars)
                {
                    model.FileId = customer.GetAttribute <int>(SystemCustomerAttributeNames.AvatarPictureId, genericAttributeService);
                }

                if (!model.FileId.HasValue)
                {
                    model.AvatarColor = customer.GetAvatarColor(genericAttributeService);
                }
            }

            return(model);
        }
 public CustomerModelFactory(AddressSettings addressSettings,
                             CaptchaSettings captchaSettings,
                             CatalogSettings catalogSettings,
                             CommonSettings commonSettings,
                             CustomerSettings customerSettings,
                             DateTimeSettings dateTimeSettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             ForumSettings forumSettings,
                             GdprSettings gdprSettings,
                             IAddressModelFactory addressModelFactory,
                             ICountryService countryService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             IDateTimeHelper dateTimeHelper,
                             IDownloadService downloadService,
                             IExternalAuthenticationService externalAuthenticationService,
                             IGdprService gdprService,
                             IGenericAttributeService genericAttributeService,
                             ILocalizationService localizationService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             IReturnRequestService returnRequestService,
                             IStateProvinceService stateProvinceService,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             IUrlRecordService urlRecordService,
                             IWorkContext workContext,
                             MediaSettings mediaSettings,
                             OrderSettings orderSettings,
                             RewardPointsSettings rewardPointsSettings,
                             SecuritySettings securitySettings,
                             TaxSettings taxSettings,
                             VendorSettings vendorSettings)
 {
     this._addressSettings  = addressSettings;
     this._captchaSettings  = captchaSettings;
     this._catalogSettings  = catalogSettings;
     this._commonSettings   = commonSettings;
     this._customerSettings = customerSettings;
     this._dateTimeSettings = dateTimeSettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._forumSettings                 = forumSettings;
     this._gdprSettings                  = gdprSettings;
     this._addressModelFactory           = addressModelFactory;
     this._countryService                = countryService;
     this._customerAttributeParser       = customerAttributeParser;
     this._customerAttributeService      = customerAttributeService;
     this._dateTimeHelper                = dateTimeHelper;
     this._downloadService               = downloadService;
     this._externalAuthenticationService = externalAuthenticationService;
     this._gdprService                   = gdprService;
     this._genericAttributeService       = genericAttributeService;
     this._localizationService           = localizationService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._orderService                  = orderService;
     this._pictureService                = pictureService;
     this._returnRequestService          = returnRequestService;
     this._stateProvinceService          = stateProvinceService;
     this._storeContext                  = storeContext;
     this._storeMappingService           = storeMappingService;
     this._urlRecordService              = urlRecordService;
     this._workContext                   = workContext;
     this._mediaSettings                 = mediaSettings;
     this._orderSettings                 = orderSettings;
     this._rewardPointsSettings          = rewardPointsSettings;
     this._securitySettings              = securitySettings;
     this._taxSettings                   = taxSettings;
     this._vendorSettings                = vendorSettings;
 }
 public CustomerAlbumPictureService(ISettingService settingService, IWebHelper webHelper, ILogger logger, IEventPublisher eventPublisher,
                                    IMobRepository <CustomerAlbum> customerAlbumRepository, IMobRepository <CustomerAlbumPicture> customerAlbumPictureRepository, MediaSettings mediaSettings)
 {
     _customerAlbumRepository        = customerAlbumRepository;
     _customerAlbumPictureRepository = customerAlbumPictureRepository;
     _nopMediaSettings = mediaSettings;
 }
 public mobSocialApiController(IPermissionService permissionService,
                               IWorkContext workContext, AdminAreaSettings adminAreaSettings, ILocalizationService localizationService,
                               IPictureService pictureService, IMobSocialService socialNetworkService, ICustomerService customerService,
                               ICustomerAlbumPictureService customerAlbumPictureService, mobSocialSettings mobSocialSettings, MediaSettings mediaSettings, CustomerSettings customerSettings,
                               ForumSettings forumSettings, RewardPointsSettings rewardPointsSettings, OrderSettings orderSettings,
                               IStoreContext storeContext, IWebHelper webHelper, IUrlRecordService urlRecordService, IRepository <UrlRecord> urlRecordRepository,
                               ICustomerVideoAlbumService customerVideoAlbumService, CustomerProfileViewService customerProfileViewService)
 {
     _permissionService           = permissionService;
     _workContext                 = workContext;
     _adminAreaSettings           = adminAreaSettings;
     _localizationService         = localizationService;
     _pictureService              = pictureService;
     _socialNetworkService        = socialNetworkService;
     _customerService             = customerService;
     _customerAlbumPictureService = customerAlbumPictureService;
     _mobSocialSettings           = mobSocialSettings;
     _mediaSettings               = mediaSettings;
     _customerSettings            = customerSettings;
     _forumSettings               = forumSettings;
     _rewardPointsSettings        = rewardPointsSettings;
     _orderSettings               = orderSettings;
     _storeContext                = storeContext;
     _webHelper                  = webHelper;
     _urlRecordService           = urlRecordService;
     _urlRecordRepository        = urlRecordRepository;
     _customerVideoAlbumService  = customerVideoAlbumService;
     _customerProfileViewService = customerProfileViewService;
 }
Esempio n. 22
0
        public async Task <IActionResult> MaintenanceConvertPicture([FromServices] IPictureService pictureService, [FromServices] MediaSettings mediaSettings)
        {
            var model = new MaintenanceModel();

            model.ConvertedPictureModel.NumberOfConvertItems = 0;
            if (pictureService.StoreInDb)
            {
                var pictures = pictureService.GetPictures();
                foreach (var picture in pictures)
                {
                    if (!picture.MimeType.Contains("webp"))
                    {
                        using var image = SKBitmap.Decode(picture.PictureBinary);
                        SKData d = SKImage.FromBitmap(image).Encode(SKEncodedImageFormat.Webp, mediaSettings.DefaultImageQuality);
                        await pictureService.UpdatePicture(picture.Id, d.ToArray(), "image/webp", picture.SeoFilename, picture.AltAttribute, picture.TitleAttribute, true, false);

                        model.ConvertedPictureModel.NumberOfConvertItems += 1;
                    }
                }
            }
            return(View(model));
        }
 public GetShoppingCartHandler(
     ICacheManager cacheManager,
     IPaymentService paymentService,
     IProductService productService,
     IPictureService pictureService,
     IProductAttributeParser productAttributeParser,
     ILocalizationService localizationService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     IOrderProcessingService orderProcessingService,
     ICurrencyService currencyService,
     IDiscountService discountService,
     IShoppingCartService shoppingCartService,
     ICheckoutAttributeService checkoutAttributeService,
     IPermissionService permissionService,
     ITaxService taxService,
     IPriceFormatter priceFormatter,
     ICheckoutAttributeParser checkoutAttributeParser,
     IDownloadService downloadService,
     ICountryService countryService,
     IShippingService shippingService,
     IProductAttributeFormatter productAttributeFormatter,
     IPriceCalculationService priceCalculationService,
     IDateTimeHelper dateTimeHelper,
     IVendorService vendorService,
     IMediator mediator,
     MediaSettings mediaSettings,
     OrderSettings orderSettings,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     ShippingSettings shippingSettings,
     CommonSettings commonSettings)
 {
     _cacheManager               = cacheManager;
     _paymentService             = paymentService;
     _productService             = productService;
     _pictureService             = pictureService;
     _productAttributeParser     = productAttributeParser;
     _localizationService        = localizationService;
     _checkoutAttributeFormatter = checkoutAttributeFormatter;
     _orderProcessingService     = orderProcessingService;
     _currencyService            = currencyService;
     _discountService            = discountService;
     _shoppingCartService        = shoppingCartService;
     _checkoutAttributeService   = checkoutAttributeService;
     _permissionService          = permissionService;
     _taxService                = taxService;
     _priceFormatter            = priceFormatter;
     _checkoutAttributeParser   = checkoutAttributeParser;
     _downloadService           = downloadService;
     _countryService            = countryService;
     _shippingService           = shippingService;
     _productAttributeFormatter = productAttributeFormatter;
     _priceCalculationService   = priceCalculationService;
     _dateTimeHelper            = dateTimeHelper;
     _vendorService             = vendorService;
     _mediator             = mediator;
     _mediaSettings        = mediaSettings;
     _orderSettings        = orderSettings;
     _shoppingCartSettings = shoppingCartSettings;
     _catalogSettings      = catalogSettings;
     _shippingSettings     = shippingSettings;
     _commonSettings       = commonSettings;
 }
Esempio n. 24
0
        public CatalogModelFactory(BlogSettings blogSettings,
                                   CatalogSettings catalogSettings,
                                   DisplayDefaultMenuItemSettings displayDefaultMenuItemSettings,
                                   ForumSettings forumSettings,
                                   IActionContextAccessor actionContextAccessor,
                                   ICategoryService categoryService,
                                   ICategoryTemplateService categoryTemplateService,
                                   ICurrencyService currencyService,
                                   IEventPublisher eventPublisher,
                                   IHttpContextAccessor httpContextAccessor,
                                   ILocalizationService localizationService,
                                   IManufacturerService manufacturerService,
                                   IManufacturerTemplateService manufacturerTemplateService,
                                   IPictureService pictureService,
                                   IPriceFormatter priceFormatter,
                                   IProductModelFactory productModelFactory,
                                   IProductService productService,
                                   IProductTagService productTagService,
                                   ISearchTermService searchTermService,
                                   ISpecificationAttributeService specificationAttributeService,
                                   IStaticCacheManager cacheManager,
                                   IStoreContext storeContext,
                                   ITopicService topicService,
                                   IUrlHelperFactory urlHelperFactory,
                                   IUrlRecordService urlRecordService,
                                   IVendorService vendorService,
                                   IWebHelper webHelper,
                                   IWorkContext workContext,
                                   MediaSettings mediaSettings,
                                   VendorSettings vendorSettings,
                                   LuceneSettings luceneSettings, ILuceneService luceneService,
                                   ICacheKeyService cacheKeyService, ICustomerService customerService, IStaticCacheManager staticCacheManager)
            : base(blogSettings,
                   catalogSettings,
                   displayDefaultMenuItemSettings,
                   forumSettings,
                   actionContextAccessor,
                   cacheKeyService,
                   categoryService,
                   categoryTemplateService,
                   currencyService,
                   customerService,
                   eventPublisher,
                   httpContextAccessor,
                   localizationService,
                   manufacturerService,
                   manufacturerTemplateService,
                   pictureService,
                   priceFormatter,
                   productModelFactory,
                   productService,
                   productTagService,
                   searchTermService,
                   specificationAttributeService,
                   staticCacheManager,
                   storeContext,
                   topicService,
                   urlHelperFactory,
                   urlRecordService,
                   vendorService,
                   webHelper,
                   workContext,
                   mediaSettings,
                   vendorSettings)
        {
            _blogSettings    = blogSettings;
            _catalogSettings = catalogSettings;
            _displayDefaultMenuItemSettings = displayDefaultMenuItemSettings;
            _forumSettings                 = forumSettings;
            _actionContextAccessor         = actionContextAccessor;
            _categoryService               = categoryService;
            _categoryTemplateService       = categoryTemplateService;
            _currencyService               = currencyService;
            _eventPublisher                = eventPublisher;
            _httpContextAccessor           = httpContextAccessor;
            _localizationService           = localizationService;
            _manufacturerService           = manufacturerService;
            _manufacturerTemplateService   = manufacturerTemplateService;
            _pictureService                = pictureService;
            _priceFormatter                = priceFormatter;
            _productModelFactory           = productModelFactory;
            _productService                = productService;
            _productTagService             = productTagService;
            _searchTermService             = searchTermService;
            _specificationAttributeService = specificationAttributeService;
            _cacheManager     = cacheManager;
            _storeContext     = storeContext;
            _topicService     = topicService;
            _urlHelperFactory = urlHelperFactory;
            _urlRecordService = urlRecordService;
            _vendorService    = vendorService;
            _webHelper        = webHelper;
            _workContext      = workContext;
            _mediaSettings    = mediaSettings;
            _vendorSettings   = vendorSettings;
            _customerService  = customerService;
            _cacheKeyService  = cacheKeyService;

            _luceneSettings = luceneSettings;
            _luceneService  = luceneService;
        }
Esempio n. 25
0
 public ProductController(
     ICommonServices services,
     IManufacturerService manufacturerService,
     IProductService productService,
     IProductAttributeService productAttributeService,
     IProductAttributeParser productAttributeParser,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPictureService pictureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     ICustomerContentService customerContentService,
     ICustomerService customerService,
     IShoppingCartService shoppingCartService,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     IProductTagService productTagService,
     IOrderReportService orderReportService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     MediaSettings mediaSettings,
     SeoSettings seoSettings,
     CatalogSettings catalogSettings,
     ShoppingCartSettings shoppingCartSettings,
     LocalizationSettings localizationSettings,
     CaptchaSettings captchaSettings,
     CatalogHelper helper,
     IDownloadService downloadService,
     ILocalizationService localizationService,
     IBreadcrumb breadcrumb,
     Lazy <PrivacySettings> privacySettings,
     Lazy <TaxSettings> taxSettings)
 {
     _services                       = services;
     _manufacturerService            = manufacturerService;
     _productService                 = productService;
     _productAttributeService        = productAttributeService;
     _productAttributeParser         = productAttributeParser;
     _taxService                     = taxService;
     _currencyService                = currencyService;
     _pictureService                 = pictureService;
     _priceCalculationService        = priceCalculationService;
     _priceFormatter                 = priceFormatter;
     _customerContentService         = customerContentService;
     _customerService                = customerService;
     _shoppingCartService            = shoppingCartService;
     _recentlyViewedProductsService  = recentlyViewedProductsService;
     _productTagService              = productTagService;
     _orderReportService             = orderReportService;
     _backInStockSubscriptionService = backInStockSubscriptionService;
     _aclService                     = aclService;
     _storeMappingService            = storeMappingService;
     _mediaSettings                  = mediaSettings;
     _seoSettings                    = seoSettings;
     _catalogSettings                = catalogSettings;
     _shoppingCartSettings           = shoppingCartSettings;
     _localizationSettings           = localizationSettings;
     _captchaSettings                = captchaSettings;
     _helper              = helper;
     _downloadService     = downloadService;
     _localizationService = localizationService;
     _breadcrumb          = breadcrumb;
     _privacySettings     = privacySettings;
     _taxSettings         = taxSettings;
 }
Esempio n. 26
0
        /// <summary>
        /// Install plugin
        /// </summary>
        public override void Install()
        {
            //locales
            //this.AddOrUpdatePluginLocaleResource("Plugins.ProductCarousel.Cache", "true");
            //It's required to set initializer to null (for SQL Server Compact).
            //otherwise, you'll get something like "The model backing the 'your context name' context has changed since the database was created. Consider using Code First Migrations to update the database"

            //settings
            var mobSocialSettings = new mobSocialSettings()
            {
                Version            = MobSocialConstant.ReleaseVersion,
                ProfilePictureSize = 100,
                WidgetZone         = "after_header_links",
                PeopleSearchAutoCompleteEnabled            = true,
                PeopleSearchAutoCompleteNumberOfResults    = 10,
                EventPageSearchAutoCompleteNumberOfResults = 10,
                PeopleSearchTermMinimumLength         = 3,
                EventPageSearchTermMinimumLength      = 1,
                ShowProfileImagesInSearchAutoComplete = true,
                CustomerAlbumPictureThumbnailWidth    = 290,
                MaximumMainAlbumPictures         = 10,
                MaximumMainAlbumVideos           = 10,
                EventPageAttendanceThumbnailSize = 25,
                UninvitedFriendsNumberOfResults  = 20,
                CustomerProfileUpdateViewCountAfterNumberOfSeconds = 180, // 3 minutes,
                FacebookWebsiteAppId    = "1234567890123456",
                BusinessPageSearchUrl   = "BusinessSearch",
                ArtistPageMainImageSize = 300,
                ArtistPageThumbnailSize = 150,
                // Would you like to replace the api key with your own?
                // Find more info here by contacting us at [email protected]
                EchonestAPIKey = "DQFW7ZCMHBBLMLVFE",
                // Would you like to replace the partner id with your own?
                // Find more info here by contacting us at [email protected]
                SevenDigitalPartnerId            = "9378",
                SongFileMaximumUploadSize        = _config.MaxRequestLength,
                SongFileSampleMaximumUploadSize  = _config.MaxRequestLength,
                PurchasedSongFeePercentage       = 30,
                ShowVideoThumbnailsForBattles    = true,
                DefaultVotingChargeForPaidVoting = 0.99m,
                EnableFacebookInvite             = true,
            };


            var mediaSettings = new MediaSettings()
            {
                AvatarPictureSize = 200
            };



            AddLocaleResourceStrings();



            _settingService.SaveSetting(mediaSettings);
            _settingService.SaveSetting(mobSocialSettings);


            InsertMessageTemplates();

            AddScheduledTasks();



            _context.Install();

            base.Install();
        }
Esempio n. 27
0
 public static MediaSettings ToEntity(this MediaSettingsModel model, MediaSettings destination)
 {
     return(model.MapTo(destination));
 }
Esempio n. 28
0
        public AmazonPictureService(IRepository <Picture> pictureRepository,
                                    ISettingService settingService,
                                    IWebHelper webHelper,
                                    ILogger logger,
                                    IEventPublisher eventPublisher,
                                    MediaSettings mediaSettings,
                                    IHostingEnvironment hostingEnvironment,
                                    GrandConfig config)
            : base(pictureRepository,
                   settingService,
                   webHelper,
                   logger,
                   eventPublisher,
                   mediaSettings,
                   hostingEnvironment)
        {
            this._config = config;

            //Arguments guard
            if (string.IsNullOrEmpty(_config.AmazonAwsAccessKeyId))
            {
                throw new ArgumentNullException("AmazonAwsAccessKeyId");
            }
            if (string.IsNullOrEmpty(_config.AmazonAwsSecretAccessKey))
            {
                throw new ArgumentNullException("AmazonAwsSecretAccessKey");
            }
            if (string.IsNullOrEmpty(_config.AmazonBucketName))
            {
                throw new ArgumentNullException("AmazonBucketName");
            }

            //Region guard
            RegionEndpoint regionEndpoint = RegionEndpoint.GetBySystemName(_config.AmazonRegion);

            if (regionEndpoint.DisplayName == "Unknown")
            {
                throw new NullReferenceException("specified Region is invalid");
            }

            //Client guard
            _s3Client = new AmazonS3Client(_config.AmazonAwsAccessKeyId, _config.AmazonAwsSecretAccessKey, regionEndpoint);
            try
            {
                EnsureValidResponse(_s3Client.ListBucketsAsync().Result, HttpStatusCode.OK);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            //Bucket guard
            _bucketName = _config.AmazonBucketName;
            var bucketExists = _s3Client.DoesS3BucketExistAsync(_bucketName).Result;

            while (bucketExists == false)
            {
                S3Region s3region         = S3Region.FindValue(_config.AmazonRegion);
                var      putBucketRequest = new PutBucketRequest
                {
                    BucketName   = _bucketName,
                    BucketRegion = s3region,
                };

                try
                {
                    EnsureValidResponse(_s3Client.PutBucketAsync(putBucketRequest).Result, HttpStatusCode.OK);
                }
                catch (AmazonS3Exception ex)
                {
                    if (ex.ErrorCode == "BucketAlreadyOwnedByYou")
                    {
                        break;
                    }

                    throw;
                }
                bucketExists = _s3Client.DoesS3BucketExistAsync(_bucketName).Result;
            }
        }
Esempio n. 29
0
 public S3CachingHelper(IAwsS3Helper s3Helper, MediaSettings mediaSettings)
 {
     _s3Helper      = s3Helper;
     _mediaSettings = mediaSettings;
 }
Esempio n. 30
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;
 }
 private static void DefaultSettings(ActivatedContentContext context, MediaSettings settings) {
     settings.Record.RootMediaFolder = "~/Media";
 }
Esempio n. 32
0
        public static CachingInfo GetImageUrlCachingInfo(this MediaSettings mediasettings, string imageUrl, Size targetSize = default(Size))
        {
            var cacheKey = GetCacheKey(RenderUrlPrefix, imageUrl, targetSize);

            return(new CachingInfo(mediasettings.Cache, cacheKey, TimeSpan.FromSeconds(mediasettings.CacheLength), mediasettings.CacheExpiryType));
        }