Esempio n. 1
0
 /// <summary>
 /// 创建文章的静态html页面
 /// </summary>
 /// <param name="artID">文章ID</param>
 /// <returns></returns>
 public ReturnValue CreateHtml(int artID)
 {
     ArticleManager artMg = new ArticleManager();
     VwArticle art = artMg.Get(artID);
     if (art != null)
     {
         return CreateHtml(art);
     }
     return new ReturnValue(false, "文章为空");
 }
Esempio n. 2
0
        public Html GetOrAdd(int artID)
        {
            Html html = null;
            html = this.Get(artID);
            if (html == null)
            {

                ReturnValue retValue = CreateHtml(artID);
                if (retValue != null && retValue.IsExists)
                {
                    html = this.Get(artID);
                }
            }
            else
            {
                string htmlPath = CodeNote.Common.ConfigWrap.FiePath(STATIC_HTML_DIR) + html.Url;
                if (!System.IO.File.Exists(htmlPath))
                {
                    CreateHtml(artID);
                }
                else
                {
                    ArticleManager artMg = new ArticleManager();
                    VwArticle art = artMg.Get(artID);
                    if (art != null && art.ModDate != html.Upda)
                    {
                        CreateHtml(art);
                    }
                }
            }
            return html;
        }