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); } }
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); }
/// <summary> /// 判断用户是否生成过赠赠卡 /// </summary> /// <param name="openid"></param> /// <returns></returns> public async Task <User> GetUser(string openid, string unique) { return(await userRep.GetUser(openid, unique)); }