當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。