Exemple #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 : "删除失败");
        }
Exemple #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 : "删除失败");
        }
Exemple #3
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(long Id)
 {
     return(dal.Delete(Id));
 }