Пример #1
0
        public ActionResult Verify()
        {
            if (String.IsNullOrEmpty(Request["id"]))
            {
                return(Json(new { code = -1, message = "缺少id参数" }, JsonRequestBehavior.AllowGet));
            }
            string articleID = Request["articleID"];

            if (string.IsNullOrEmpty(articleID))
            {
                return(Json(new { code = -2, message = "缺少articleID参数!" }, JsonRequestBehavior.AllowGet));
            }
            string articleUserID = Utility.ArticleBll.GetarticleUserID(articleID);

            if (isOwner(articleUserID) == false)
            {
                return(Json(new { code = -3, message = "没有登录或无权限操作!" }, JsonRequestBehavior.AllowGet));
            }

            string commentID = Request["id"];

            Blogs.Entity.blog_tb_comment model = Utility.CommentBll.GetEntity(commentID);
            model.commentState = Convert.ToInt32(Request["state"]);
            Utility.CommentBll.Update(model);

            return(Json(new { code = 1, message = "操作成功!" }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public override int Insert(Blogs.Entity.blog_tb_comment entity)
        {
            IocFactory <IDALArticle> .Instance.UpdateComment(entity.articleID + "", 1);

            return(base.Insert(entity));
        }