Esempio n. 1
0
        private List <Article> GetArtciles()
        {
            ShowFields = "ID,Title,Description,Updated,Source";
            SearchResult   result = QueryAdvance();
            List <Article> items  = new List <Article>();

            if (result != null)
            {
                Pager.RecordCount = result.RecordCount;
                foreach (QueryArticle a in result.ArticleList)
                {
                    Article article = new Article();
                    article.ID      = a.ArcicleID;
                    article.Title   = a.ArticleTitle;
                    article.Content = a.ArticleContent;
                    string modelXml = a.ArticleModelXML;
                    if (!string.IsNullOrEmpty(modelXml))
                    {
                        modelXml = We7Helper.RemoveHtml(modelXml);
                    }
                    if (!string.IsNullOrEmpty(modelXml))
                    {
                        modelXml = We7Helper.RemoveGUID(modelXml);
                    }

                    if (string.IsNullOrEmpty(article.Content))
                    {
                        article.Content = modelXml;
                    }
                    else
                    {
                        article.Description = modelXml;
                    }

                    article.ChannelFullUrl  = a.ArticleCategoryUrl;
                    article.FullChannelPath = a.ArticleCategory;
                    article.ContentUrl      = a.ArticleUrl;
                    article.ModelName       = a.ArticleType;
                    article.SiteName        = a.SiteName;
                    article.SiteUrl         = a.SiteUrl;
                    article.Created         = Convert.ToDateTime(a.ArticleCreateTime);
                    article.ContentType     = (int)TypeOfArticle.LinkArticle;

                    items.Add(article);
                }
                if (SummaryMaxLength == 0)
                {
                    SummaryMaxLength = 200;
                }
                items = FormatArticlesData(items);
            }
            return(items);
        }