예제 #1
0
        public bool DeleteComment(string text, ObjectId postId)
        {
            Comment comment = new Comment();

            comment.Text         = text;
            comment.CommentOwner = userRepository.GetUser(userServices.NicknameRead()).Id;
            comment.Time         = DateTime.Now;
            try
            {
                repository.DeleteComment(comment, postId);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
예제 #2
0
        public bool CheckPassword(string nickname, string password)
        {
            User user = new User();

            user = repository.GetUser(nickname);
            if (user != null)
            {
                if (user.Password == GetHashStringSHA256(password))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            return(false);
        }
예제 #3
0
 /// <summary>
 /// 判断用户是否生成过赠赠卡
 /// </summary>
 /// <param name="openid"></param>
 /// <returns></returns>
 public async Task <User> GetUser(string openid, string unique)
 {
     return(await userRep.GetUser(openid, unique));
 }