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