Beispiel #1
0
        public ActionResult Index()
        {
            IEnumerable <RetailerViewModel> retailers =
                retailerService.GetRetailers().Select(
                    a => new RetailerViewModel()
            {
                Name                 = a.Name,
                DesktopImageUrl      = TourtechUrlHelper.GetImageUrl(a.DesktopImageRelativeUrl),
                MobileImageUrl       = TourtechUrlHelper.GetImageUrl(a.MobileImageRelativeUrl),
                WebsiteUrl           = a.WebsiteUrl,
                WebsiteUrlForDisplay = a.WebsiteUrlForDisplay,
                BackgroundColourHex  = a.BackgroundColourHex,
                TextColourHex        = a.TextColourHex
            }
                    )
            ;

            PageModel whereToBuyPage = pageContentService.WhereToBuyPage;

            WhereToBuyViewModel viewModel = new WhereToBuyViewModel()
            {
                Breadcrumb      = BreadcrumbHelper.GetWhereToBuyBreadcrumb(Url, whereToBuyPage.MainHeading),
                MainHeading     = whereToBuyPage.MainHeading,
                Retailers       = retailers,
                Title           = whereToBuyPage.MetaData.Title,
                MetaDescription = whereToBuyPage.MetaData.MetaDescription
            };

            SetBannerToDefault(viewModel);

            SetLayout(viewModel);

            return(View(viewModel));
        }
        // GET: Retailer
        public ActionResult Index()

        {
            if (TempData["list"] != null)
            {
                return(View(TempData["list"]));
            }
            //  var service = new RetailerService();
            var model = _retailerService.GetRetailers();

            return(View(model));
        }