当前位置: 首页>>代码示例>>C#>>正文


C# Media.PictureModel类代码示例

本文整理汇总了C#中Nop.Web.Models.Media.PictureModel的典型用法代码示例。如果您正苦于以下问题:C# PictureModel类的具体用法?C# PictureModel怎么用?C# PictureModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PictureModel类属于Nop.Web.Models.Media命名空间,在下文中一共展示了PictureModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProductDetailsModel

 public ProductDetailsModel()
 {
     DefaultPictureModel = new PictureModel();
     PictureModels = new List<PictureModel>();
     ProductVariantModels = new List<ProductVariantModel>();
     SpecificationAttributeModels = new List<ProductSpecificationModel>();
 }
开发者ID:emretiryaki,项目名称:paymill-nopcommerce,代码行数:7,代码来源:ProductDetailsModel.cs

示例2: ProductOverviewModel

 public ProductOverviewModel()
 {
     ProductPrice = new ProductPriceModel();
     DefaultPictureModel = new PictureModel();
     SpecificationAttributeModels = new List<ProductSpecificationModel>();
     ReviewOverviewModel = new ProductReviewOverviewModel();
 }
开发者ID:LaOrigin,项目名称:Leorigin,代码行数:7,代码来源:ProductOverviewModel.cs

示例3: ManufacturerModel

 public ManufacturerModel()
 {
     PictureModel = new PictureModel();
     FeaturedProducts = new List<ProductModel>();
     Products = new List<ProductModel>();
     PagingFilteringContext = new CatalogPagingFilteringModel();
 }
开发者ID:pquic,项目名称:qCommerce,代码行数:7,代码来源:ManufacturerModel.cs

示例4: VendorModel

        private ICollection<Branch> _branches; //add by hz

        #endregion Fields

        #region Constructors

        public VendorModel()
        {
            PictureModel = new PictureModel();
            FeaturedProducts = new List<ProductOverviewModel>();
            Products = new List<ProductOverviewModel>();
            PagingFilteringContext = new CatalogPagingFilteringModel();
            Branches = new List<BranchModel>();
        }
开发者ID:priceLiu,项目名称:MulitNop,代码行数:14,代码来源:VendorModel.cs

示例5: ProductModel

 public ProductModel()
 {
     ProductPrice = new ProductPriceModel();
     DefaultPictureModel = new PictureModel();
     PictureModels = new List<PictureModel>();
     ProductVariantModels = new List<ProductVariantModel>();
     SpecificationAttributeModels = new List<ProductSpecificationModel>();
 }
开发者ID:CCSW,项目名称:desnivell,代码行数:8,代码来源:ProductModel.cs

示例6: CategoryModel

 public CategoryModel()
 {
     PictureModel = new PictureModel();
     FeaturedProducts = new List<ProductOverviewModel>();
     Products = new List<ProductOverviewModel>();
     PagingFilteringContext = new CatalogPagingFilteringModel();
     SubCategories = new List<SubCategoryModel>();
     CategoryBreadcrumb = new List<CategoryModel>();
 }
开发者ID:Rustemt,项目名称:Nopcommerce-with-Couchbase,代码行数:9,代码来源:CategoryModel.cs

示例7: ManufacturerModel

 public ManufacturerModel()
 {
     PictureModel = new PictureModel();
     FeaturedProducts = new List<ProductModel>();
     Products = new List<ProductModel>();
     PagingFilteringContext = new CatalogPagingFilteringModel();
     AvailableSortOptions = new List<SelectListItem>();
     AvailableViewModes = new List<SelectListItem>();
     PageSizeOptions = new List<SelectListItem>();
 }
开发者ID:cmcginn,项目名称:StoreFront,代码行数:10,代码来源:ManufacturerModel.cs

示例8: ProductDetailsModel

 public ProductDetailsModel()
 {
     DefaultPictureModel = new PictureModel();
     PictureModels = new List<PictureModel>();
     GiftCard = new GiftCardModel();
     ProductPrice = new ProductPriceModel();
     AddToCart = new AddToCartModel();
     ProductVariantAttributes = new List<ProductVariantAttributeModel>();
     AssociatedProducts = new List<ProductDetailsModel>();
 }
开发者ID:nguyentu1982,项目名称:quancu,代码行数:10,代码来源:ProductDetailsModel.cs

示例9: CategoryModel

 public CategoryModel()
 {
     PictureModel = new PictureModel();
     FeaturedProducts = new List<ProductModel>();
     Products = new List<ProductModel>();
     PagingFilteringContext = new CatalogPagingFilteringModel();
     SubCategories = new List<SubCategoryModel>();
     CategoryBreadcrumb = new List<CategoryModel>();
     AvailableSortOptions = new List<SelectListItem>();
     AvailableViewModes = new List<SelectListItem>();
     PageSizeOptions = new List<SelectListItem>();
 }
开发者ID:cmcginn,项目名称:StoreFront,代码行数:12,代码来源:CategoryModel.cs

示例10: GetProduct

        public ProductDetailsModel GetProduct(string name)
        {
            var product = _productRepository.Table.FirstOrDefault(x => x.Name == name.Trim());

            var model = new ProductDetailsModel();
            if (product != null)
            {
                model.Name = product.Name;
                const bool isAssociatedProduct = false;

                model.DefaultPictureZoomEnabled = false;
                //default picture
                var defaultPictureSize = _mediaSettings.ProductDetailsPictureSize;
                //prepare picture models
                var productPicturesCacheKey = string.Format(ModelCacheEventConsumer.PRODUCT_DETAILS_PICTURES_MODEL_KEY, product.Id, defaultPictureSize, isAssociatedProduct, _workContext.WorkingLanguage.Id, _webHelper.IsCurrentConnectionSecured(), _storeContext.CurrentStore.Id);
                var cachedPictures = _cacheManager.Get(productPicturesCacheKey, () =>
                {
                    var pictures = _pictureService.GetPicturesByProductId(product.Id);

                    var defaultPictureModel = new PictureModel()
                    {
                        ImageUrl = _pictureService.GetPictureUrl(pictures.FirstOrDefault(), defaultPictureSize, !isAssociatedProduct),
                        FullSizeImageUrl = _pictureService.GetPictureUrl(pictures.FirstOrDefault(), 0, !isAssociatedProduct),
                        Title = string.Format(_localizationService.GetResource("Media.Product.ImageLinkTitleFormat.Details"), model.Name),
                        AlternateText = string.Format(_localizationService.GetResource("Media.Product.ImageAlternateTextFormat.Details"), model.Name),
                    };
                    //all pictures
                    var pictureModels = new List<PictureModel>();
                    foreach (var picture in pictures)
                    {
                        pictureModels.Add(new PictureModel()
                        {
                            ImageUrl = _pictureService.GetPictureUrl(picture, 380),
                            FullSizeImageUrl = _pictureService.GetPictureUrl(picture),
                            Title = string.Format(_localizationService.GetResource("Media.Product.ImageLinkTitleFormat.Details"), model.Name),
                            AlternateText = string.Format(_localizationService.GetResource("Media.Product.ImageAlternateTextFormat.Details"), model.Name),
                        });
                    }

                    return new { DefaultPictureModel = defaultPictureModel, PictureModels = pictureModels };
                });
                model.DefaultPictureModel = cachedPictures.DefaultPictureModel;
                model.PictureModels = cachedPictures.PictureModels;
            }
            return model;
        }
开发者ID:kolnago,项目名称:AlterDeco,代码行数:46,代码来源:GalleryService.cs

示例11: ProductDetailsModel

 public ProductDetailsModel()
 {
     DefaultPictureModel = new PictureModel();
     PictureModels = new List<PictureModel>();
     GiftCard = new GiftCardModel();
     ProductPrice = new ProductPriceModel();
     AddToCart = new AddToCartModel();
     ProductAttributes = new List<ProductAttributeModel>();
     AssociatedProducts = new List<ProductDetailsModel>();
     VendorModel = new VendorBriefInfoModel();
     Breadcrumb = new ProductBreadcrumbModel();
     ProductTags = new List<ProductTagModel>();
     ProductSpecifications= new List<ProductSpecificationModel>();
     ProductManufacturers = new List<ManufacturerModel>();
     ProductReviewOverview = new ProductReviewOverviewModel();
     TierPrices = new List<TierPriceModel>();
 }
开发者ID:shmoaslam,项目名称:dezinecorp,代码行数:17,代码来源:ProductDetailsModel.cs

示例12: PrepareProductOverviewModels

        protected IEnumerable<ProductOverviewModel> PrepareProductOverviewModels(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");

            //performance optimization. let's load all variants at one go
            var allVariants = _productService.GetProductVariantsByProductIds(products.Select(x => x.Id).ToArray());

            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();

                    //var productVariants = _productService.GetProductVariantsByProductId(product.Id);
                    //we use already loaded variants
                    var productVariants = allVariants.Where(x => x.ProductId == product.Id).ToList();

                    switch (productVariants.Count)
                    {
                        case 0:
                            {
                                //no variants
                                priceModel.OldPrice = null;
                                priceModel.Price = null;
                            }
                            break;
                        default:
                            {

                                if (_permissionService.Authorize(StandardPermissionProvider.DisplayPrices))
                                {
                                    //calculate for the maximum quantity (in case if we have tier prices)
                                    decimal? minimalPrice = null;
                                    var productVariant = _priceCalculationService.GetProductVariantWithMinimalPrice(productVariants, _workContext.CurrentCustomer, true, int.MaxValue, out minimalPrice);

                                    if (!productVariant.CustomerEntersPrice)
                                    {
                                        if (productVariant.CallForPrice)
                                        {
                                            priceModel.OldPrice = null;
                                            priceModel.Price = _localizationService.GetResource("Products.CallForPrice");
                                        }
                                        else if (minimalPrice.HasValue)
                                        {
                                            //calculate prices
                                            decimal taxRate = decimal.Zero;
                                            decimal oldPriceBase = _taxService.GetProductPrice(productVariant, productVariant.OldPrice, out taxRate);
                                            decimal finalPriceBase = _taxService.GetProductPrice(productVariant, minimalPrice.Value, 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 (productVariant.HasTierPrices)
                                            {
                                                tierPrices.AddRange(productVariant.TierPrices
                                                    .OrderBy(tp => tp.Quantity)
                                                    .ToList()
                                                    .FilterForCustomer(_workContext.CurrentCustomer)
                                                    .RemoveDuplicatedQuantities());
                                            }
                                            bool displayFromMessage =
                                                //When there is just one tier (with  qty 1), there are no actual savings in the list.
                                                (tierPrices.Count > 0 && !(tierPrices.Count == 1 && tierPrices[0].Quantity <= 1)) ||
                                                //we have more than one variant
                                                (productVariants.Count > 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);
                                                }
//.........这里部分代码省略.........
开发者ID:priceLiu,项目名称:MulitNop,代码行数:101,代码来源:VendorController.cs

示例13: VendorAll

        public ActionResult VendorAll()
        {
            var model = new List<VendorModel>();
            var vendors = _vendorService.GetAllVendors();
            foreach (var vendor in vendors)
            {
                var modelMan = vendor.ToModel();

                //prepare picture model
                int pictureSize = _mediaSettings.ManufacturerThumbPictureSize;
                var vendorPictureCacheKey = string.Format(ModelCacheEventConsumer.VENDOR_PICTURE_MODEL_KEY, vendor.Id, pictureSize, true, _workContext.WorkingLanguage.Id, _webHelper.IsCurrentConnectionSecured());
                modelMan.PictureModel = _cacheManager.Get(vendorPictureCacheKey, () =>
                {
                    var pictureModel = new PictureModel()
                    {
                        FullSizeImageUrl = _pictureService.GetPictureUrl(vendor.PictureId),
                        ImageUrl = _pictureService.GetPictureUrl(vendor.PictureId, pictureSize),
                        Title = string.Format(_localizationService.GetResource("Media.Vendor.ImageLinkTitleFormat"), modelMan.Name),
                        AlternateText = string.Format(_localizationService.GetResource("Media.Vendor.ImageAlternateTextFormat"), modelMan.Name)
                    };
                    return pictureModel;
                });
                model.Add(modelMan);
            }

            return View(model);
        }
开发者ID:priceLiu,项目名称:MulitNop,代码行数:27,代码来源:VendorController.cs

示例14: ShoppingCartItemModel

 public ShoppingCartItemModel()
 {
     Picture = new PictureModel();
     AllowedQuantities = new List<SelectListItem>();
     Warnings = new List<string>();
 }
开发者ID:jasonholloway,项目名称:brigita,代码行数:6,代码来源:ShoppingCartModel.cs

示例15: ProductAttributeValueModel

 public ProductAttributeValueModel()
 {
     ImageSquaresPictureModel = new PictureModel();
 }
开发者ID:nvolpe,项目名称:raver,代码行数:4,代码来源:ProductDetailsModel.cs


注:本文中的Nop.Web.Models.Media.PictureModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。