Ejemplo n.º 1
0
 public GrindersController(ProductRepository productRepository, ICalculationService calculationService, IPageUrlRetriever pageUrlRetriever)
 {
     this.productRepository  = productRepository;
     this.calculationService = calculationService;
     this.pageUrlRetriever   = pageUrlRetriever;
 }
Ejemplo n.º 2
0
        public SearchResultHomeItemModel(SearchResultItem resultItem, CMS.DocumentEngine.Types.DancingGoatMvc.Home home, IHomeRepository homeRepository, IPageUrlRetriever pageUrlRetriever)
            : base(resultItem, home, pageUrlRetriever)
        {
            var homeSections = homeRepository.GetHomeSections(home.NodeAliasPath);

            Content = string.Join(" ", homeSections.Select(section => HTMLHelper.StripTags(section.HomeSectionText, false)));
        }
Ejemplo n.º 3
0
 public EventCalendarWidgetViewComponent(IPageUrlRetriever pageUrlRetriever)
 {
     this.pageUrlRetriever = pageUrlRetriever;
 }
 public CoffeesController(ICoffeeRepository coffeeRepository, ICalculationService calculationService, IPageUrlRetriever pageUrlRetriever)
 {
     this.coffeeRepository   = coffeeRepository;
     this.calculationService = calculationService;
     this.pageUrlRetriever   = pageUrlRetriever;
 }
Ejemplo n.º 5
0
 public ManufactureListItemViewModel(Manufacturer manufacturer, IPageUrlRetriever pageUrlRetriever)
 {
     Name      = manufacturer.DocumentName;
     ImagePath = new FileUrl(manufacturer.Logo, true).RelativePath;
     Url       = pageUrlRetriever.Retrieve(manufacturer).RelativePath;
 }
Ejemplo n.º 6
0
 public static ArticleWithSideBarViewModel GetViewModel(Article article, ArticleWithSideBarProperties templateProperties, IPageUrlRetriever pageUrlRetriever, IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     return(new ArticleWithSideBarViewModel
     {
         TeaserPath = article.Fields.Teaser == null ? null : attachmentUrlRetriever.Retrieve(article.Fields.Teaser).RelativePath,
         PublicationDate = article.PublicationDate,
         RelatedArticles = article.Fields.RelatedArticles.OfType <Article>().Select(relatedArticle => RelatedArticleViewModel.GetViewModel(relatedArticle, false, pageUrlRetriever, attachmentUrlRetriever)),
         Text = article.Fields.Text,
         Title = article.Fields.Title,
         SidebarLocation = (ArticleSidebarLocationEnum)Enum.Parse(typeof(ArticleSidebarLocationEnum), templateProperties.SidebarLocation, true),
         ArticleWidth = templateProperties.ArticleWidth,
     });
 }
Ejemplo n.º 7
0
 public NavigationViewComponent(NavigationRepository navigationRepository, IPageUrlRetriever pageUrlRetriever)
 {
     this.navigationRepository = navigationRepository;
     this.pageUrlRetriever     = pageUrlRetriever;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Constructor for the ProductListItemViewModel class.
        /// </summary>
        /// <param name="productPage">Product's page.</param>
        /// <param name="priceDetail">Price of the product.</param>
        /// <param name="publicStatusName">Display name of the product's public status.</param>
        public ProductListItemViewModel(SKUTreeNode productPage, ProductCatalogPrices priceDetail, IPageUrlRetriever urlRetriever, string publicStatusName)
        {
            // Sets the page information
            Name       = productPage.DocumentName;
            ProductUrl = urlRetriever.Retrieve(productPage);

            // Sets the SKU information
            ImagePath = string.IsNullOrEmpty(productPage.SKU.SKUImagePath) ?
                        null : new FileUrl(productPage.SKU.SKUImagePath, true)
                        .WithSizeConstraint(SizeConstraint.MaxWidthOrHeight(400))
                        .RelativePath;

            Available        = !productPage.SKU.SKUSellOnlyAvailable || productPage.SKU.SKUAvailableItems > 0;
            PublicStatusName = publicStatusName;

            // Sets the price format information
            PriceModel = new PriceDetailViewModel
            {
                Price                = priceDetail.Price,
                ListPrice            = priceDetail.ListPrice,
                CurrencyFormatString = priceDetail.Currency.CurrencyFormatString
            };
        }
Ejemplo n.º 9
0
        public ProductListItemViewModel(SKUTreeNode productPage, ProductCatalogPrices priceDetail, string publicStatusName, IPageUrlRetriever pageUrlRetriever)
        {
            // Set page information
            Name = productPage.DocumentName;
            Url  = pageUrlRetriever.Retrieve(productPage).RelativePath;

            // Set SKU information
            ImagePath        = string.IsNullOrEmpty(productPage.SKU.SKUImagePath) ? null : new FileUrl(productPage.SKU.SKUImagePath, true).WithSizeConstraint(SizeConstraint.Size(452, 452)).RelativePath;
            Available        = !productPage.SKU.SKUSellOnlyAvailable || productPage.SKU.SKUAvailableItems > 0;
            PublicStatusName = publicStatusName;

            // Set additional info
            PriceDetail      = priceDetail;
            ShortDescription = productPage.DocumentSKUShortDescription;
        }
Ejemplo n.º 10
0
 public BrewersController(IBrewerRepository brewerRepository, ICalculationService calculationService, IPageUrlRetriever pageUrlRetriever)
 {
     this.brewerRepository   = brewerRepository;
     this.calculationService = calculationService;
     this.pageUrlRetriever   = pageUrlRetriever;
 }
Ejemplo n.º 11
0
 public EventRegistrationFormWidgetViewComponent(IPageUrlRetriever pageUrlRetriever)
 {
     this.pageUrlRetriever = pageUrlRetriever;
 }
Ejemplo n.º 12
0
        public SearchResultAboutUsItemModel(SearchResultItem resultItem, AboutUs aboutUs, IAboutUsRepository aboutUsRepository, IPageUrlRetriever pageUrlRetriever)
            : base(resultItem, aboutUs, pageUrlRetriever)
        {
            var sideStories = aboutUsRepository.GetSideStories(aboutUs.NodeAliasPath);

            Content = string.Join(" ", sideStories.Select(story => HTMLHelper.StripTags(story.AboutUsSectionText, false)));
        }
Ejemplo n.º 13
0
 public ArticleWithSidebarPageTemplateService(IPageDataContextRetriever pageDataContextRetriver, IPageUrlRetriever pageUrlRetriever, IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     this.pageDataContextRetriver = pageDataContextRetriver;
     this.pageUrlRetriever        = pageUrlRetriever;
     this.attachmentUrlRetriever  = attachmentUrlRetriever;
 }
 public NavigationController(INavigationRepository navigationRepository, IOutputCacheDependencies outputCacheDependencies, IPageUrlRetriever pageUrlRetriever)
 {
     this.navigationRepository    = navigationRepository;
     this.pageUrlRetriever        = pageUrlRetriever;
     this.outputCacheDependencies = outputCacheDependencies;
 }