Exemplo n.º 1
0
        //comments
        public bool AddComment(string text, ObjectId postId)
        {
            Comment comment = new Comment();

            comment.Text          = text;
            comment.CommentatorId = userRepository.GetUser(userServices.NickNameRead()).Id;
            try
            {
                repository.AddComment(comment, postId);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 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);
        }