文章点击数加1

    Dqt.Reporter.BLL.article ArticleBLL = new Dqt.Reporter.BLL.article();
    protected int ArticleId = 0;
    protected Dqt.Reporter.Model.article ArticleModel = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        //参数不能为空 不能攻击
        if (string.IsNullOrEmpty(Request.QueryString["ArticleId"]) && Dqt.Reporter.Common.MFunction.IsSaveStr(Request.QueryString["ArticleId"]))
            return;
        if (int.TryParse(Request.QueryString["ArticleId"], out ArticleId))
        {
            ArticleModel = ArticleBLL.GetModel(ArticleId);
            if (ArticleModel == null)
                Response.Redirect("/");
            if (ArticleModel.IsPublic == 0 && Uid != ArticleModel.ArticlUser)
                Response.Redirect("/");
            //防止为空
            if (Request.UrlReferrer != null)
                AddClickNum();//文章点击数加1
            GetReview();
            if (ArticleModel.SchoolId != 0)
            {
                schoolname = SchoolInstance.Instance.GetModelById(ArticleModel.SchoolId).Sname;
            }
        }
        else
        {
            Response.Redirect("/");
        }
    }


//文章点击数加1
    private void AddClickNum()
    {
        ArticleModel.ArticlDianJiShu =++ArticleModel.ArticlDianJiShu;
        ArticleBLL.Update(ArticleModel);
    }


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值