Пример #1
0
        public ActionResult Index()
        {
            IEnumerable <CategoryViewModel> categories =
                productsService.GetCategories().Select(a =>
                                                       new CategoryViewModel()
            {
                Title      = a.Title,
                ImageUrl   = TourtechUrlHelper.GetImageUrl(a.ImageRelativeUrl),
                LinkUrl    = TourtechUrlHelper.GetCategoryUrl(a.Name),
                ComingSoon = a.ComingSoon
            }
                                                       )
            ;

            PageModel productsPageContent = pageContentService.ProductsPage;

            ProductsViewModel viewModel =
                new ProductsViewModel()
            {
                Breadcrumb      = BreadcrumbHelper.GetProductsBreadcrumb(Url),
                MainHeading     = productsPageContent.MainHeading,
                Categories      = categories,
                Title           = productsPageContent.MetaData.Title,
                MetaDescription = productsPageContent.MetaData.MetaDescription
            }
            ;

            SetBannerToDefault(viewModel);

            SetLayout(viewModel);

            return(View(viewModel));
        }