本文整理汇总了C#中Article.AddRead方法的典型用法代码示例。如果您正苦于以下问题:C# Article.AddRead方法的具体用法?C# Article.AddRead怎么用?C# Article.AddRead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Article
的用法示例。
在下文中一共展示了Article.AddRead方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Request["a"] != null)
{
Article article = new Article(Request["a"]);
if (article.Exists)
{
this.article = article;
this.OtherArticle = generateOtherArticle();
this.CommentAmount = Int32.Parse(SqlHelper.GetDataSet("SELECT COUNT([ID]) AS [amount] FROM [comment] WHERE [AUID] = '" + article.AUID + "' AND [status] = 1").Tables[0].Rows[0]["amount"].ToString());
this.Comments = generateComment();
if (CommentAmount == 0)
{
MoreComment = "<div class=\"no-comment\">当前没有评论</div>";
}
else if (HasCommentAmount < CommentAmount)
{
MoreComment = "<div class=\"more-comment\" onclick=\"loadMoreComments()\"><i class=\"fa fa-repeat\"></i>加载更多评论</div>";
}
else
{
MoreComment = "";
}
if (Context.Session["UUID"] != null)
{
WriteComment = "<div class=\"button\" id=\"submit\" onclick=\"submitComment()\">提交</div>";
}
else
{
WriteComment = "<div class=\"button\" onclick=\"toggleLoginPanel()\">请先登录</div>";
}
article.AddRead();
}
else
{
Context.Response.Redirect("article.aspx");
}
}
else
{
Context.Response.Redirect("article.aspx");
}
}