Пример #1
0
        public ActionResult Index()
        {
            this.FillSeoInformation(UrlBuilder.PRINTS);
            ViewBag.Scripts = new List <string>()
            {
                "prints_solids.js"
            };

            var model = new SwatchListModel();

            model = SwatchManager.Prints(this.CurrentBrand);
            return(View(PathFromView("Prints"), model));
        }
Пример #2
0
        public static SwatchListModel Solids(string brand)
        {
            var result = new SwatchListModel();

            if (!string.IsNullOrEmpty(brand))
            {
                using (var client = new LandauPortalWebAPI())
                {
                    var solids = client.Swatches.GetAllSolidByBrand(brand);
                    result.NewList = solids.Results.Select(x =>
                                                           new SwatchItemModel()
                    {
                        Brand        = x.Brand,
                        ColorCode    = x.ColorCode,
                        ColorName    = x.ColorName,
                        ImageURI     = x.PrintImageUri,
                        IsNew        = x.IsNew == null ? false : (bool)x.IsNew,
                        IsPopular    = x.IsPopular == null ? false : (bool)x.IsPopular,
                        PrimaryHex   = x.PrimaryHex,
                        SecondaryHex = x.SecondaryHex
                    }).Where(p => p.IsNew).ToList();

                    result.PopularList = solids.Results.Select(x =>
                                                               new SwatchItemModel()
                    {
                        Brand        = x.Brand,
                        ColorCode    = x.ColorCode,
                        ColorName    = x.ColorName,
                        ImageURI     = x.PrintImageUri,
                        IsNew        = x.IsNew == null ? false : (bool)x.IsNew,
                        IsPopular    = x.IsPopular == null ? false : (bool)x.IsPopular,
                        PrimaryHex   = x.PrimaryHex,
                        SecondaryHex = x.SecondaryHex
                    }).Where(p => p.IsPopular).ToList();
                }
            }
            return(result);
        }