示例#1
0
        /// <summary>
        /// 删除评论
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public string DeleteComment(string id, string userid)
        {
            var _commentDal = new CommentDal();
            var model       = _commentDal.GetFirst(x => x.UID == id && x.UserID == userid);

            if (model == null)
            {
                return("评论不存在");
            }
            return(_commentDal.Delete(model) > 0 ? SUCCESS : "删除失败");
        }
示例#2
0
        /// <summary>
        /// 删除评论
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public string DeleteComment(int id, int userid)
        {
            if (id <= 0 || userid <= 0)
            {
                return("参数错误");
            }
            var _commentDal = new CommentDal();
            var model       = _commentDal.GetFirst(x => x.CommentID == id && x.UserID == userid);

            if (model == null)
            {
                return("评论不存在");
            }
            return(_commentDal.Delete(model) > 0 ? SUCCESS : "删除失败");
        }
示例#3
0
        public CommentModel GetCommentByID(string id)
        {
            var _commentDal = new CommentDal();

            return(_commentDal.GetFirst(x => x.UID == id));
        }