Exemplo n.º 1
0
        /// <summary>
        /// Gets the latest issue.
        /// </summary>
        /// <returns></returns>
        public static IssueViewModel GetLatestIssue()
        {
            var dynamicManager = DynamicModuleManager.GetManager();

            var latestIssue = dynamicManager.GetDataItems(IssueViewModel.IssueType)
                              .Where(di => di.Status == ContentLifecycleStatus.Live)
                              .Where(di => di.Visible == true)
                              .OrderByDescending(di => di.PublicationDate)
                              .FirstOrDefault();

            return(IssueViewModel.GetIssue(latestIssue));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the issue view model.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        public static IssueViewModel GetIssue(DynamicContent item)
        {
            IssueViewModel issue = new IssueViewModel();

            issue.Title           = item.GetString("Title");
            issue.Id              = item.Id;
            issue.UrlName         = item.ItemDefaultUrl;
            issue.Description     = item.GetString("Description");
            issue.Number          = item.GetString("IssueNumber");
            issue.Cover           = ImagesHelper.GetRelatedImage(item, "IssueCover");
            issue.ProviderName    = item.ProviderName;
            issue.PrintedVersion  = DocumentsHelper.GetRelatedDocument(item, "IssueDocument");
            issue.Articles        = item.GetRelatedItems <NewsItem>("Articles");
            issue.FeaturedArticle = item.GetRelatedItems <NewsItem>("FeaturedArticle");

            return(issue);
        }
        /// <summary>
        /// Gets the issue view model.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        public static IssueViewModel GetIssue(DynamicContent item)
        {
            IssueViewModel issue = new IssueViewModel();

            issue.Title = item.GetString("Title");
            issue.Id = item.Id;
            issue.UrlName = item.ItemDefaultUrl;
            issue.Description = item.GetString("Description");
            issue.Number = item.GetString("IssueNumber");
            issue.Cover = ImagesHelper.GetRelatedImage(item, "IssueCover");
            issue.ProviderName = item.ProviderName;
            issue.PrintedVersion = DocumentsHelper.GetRelatedDocument(item, "IssueDocument");
            issue.Articles = item.GetRelatedItems<NewsItem>("Articles");
            issue.FeaturedArticle = item.GetRelatedItems<NewsItem>("FeaturedArticle");

            return issue;
        }