コード例 #1
0
ファイル: BaseMasterPage.cs プロジェクト: Hcq/Rain
 protected string get_article_content(string call_index)
 {
     if (string.IsNullOrEmpty(call_index))
     {
         return(string.Empty);
     }
     Rain.BLL.article article = new Rain.BLL.article();
     if (article.Exists(call_index))
     {
         return(article.GetModel(call_index).content);
     }
     return(string.Empty);
 }
コード例 #2
0
ファイル: article_show.cs プロジェクト: Hcq/Rain
 protected override void ShowPage()
 {
     this.id   = DTRequest.GetQueryInt("id");
     this.page = DTRequest.GetQueryString("page");
     Rain.BLL.article article = new Rain.BLL.article();
     if (this.id > 0)
     {
         if (!article.Exists(this.id))
         {
             HttpContext.Current.Response.Redirect(this.linkurl("error", (object)("?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除!"))));
             return;
         }
         this.model = article.GetModel(this.id);
     }
     else
     {
         if (string.IsNullOrEmpty(this.page))
         {
             return;
         }
         if (!article.Exists(this.page))
         {
             HttpContext.Current.Response.Redirect(this.linkurl("error", (object)("?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除!"))));
             return;
         }
         this.model = article.GetModel(this.page);
     }
     if (this.model.link_url != null)
     {
         this.model.link_url = this.model.link_url.Trim();
     }
     if (string.IsNullOrEmpty(this.model.link_url))
     {
         return;
     }
     HttpContext.Current.Response.Redirect(this.model.link_url);
 }
コード例 #3
0
ファイル: BaseMasterPage.cs プロジェクト: Hcq/Rain
 protected string get_article_field(string call_index, string field_name)
 {
     if (string.IsNullOrEmpty(call_index))
     {
         return(string.Empty);
     }
     Rain.BLL.article article = new Rain.BLL.article();
     if (!article.Exists(call_index))
     {
         return(string.Empty);
     }
     Rain.Model.article model = article.GetModel(call_index);
     if (model != null && model.fields.ContainsKey(field_name))
     {
         return(model.fields[field_name]);
     }
     return(string.Empty);
 }