Esempio n. 1
0
        public int CheckIfVoted(int comID, int userID)
        {
            int voted;
            CommentDAO dao = new CommentDAO();

            voted = dao.CheckIfVoted(userID, comID);

            return voted;
        }
Esempio n. 2
0
        public void CreateNewComment(string username, string commentContents, int subID, int pcID)
        {
            CommentDAO dao = new CommentDAO();
            UserDAO userDAO = new UserDAO();
            CommentVO comment = new CommentVO();

            if (commentContents == null) {
                throw new Exception("You need to enter a comment");
            }

            comment.UserID = userDAO.GetUser(username).UserID;
            comment.CommentContents = commentContents;
            comment.PostDate = DateTime.Now;
            comment.Rating = 0;
            if (pcID != 0) {
                comment.ParentCommentID = pcID;
            }
            comment.SubmissionID = subID;

            dao.InsertComment(comment);
        }
Esempio n. 3
0
 public void DeleteComment(int cID)
 {
     CommentDAO dao = new CommentDAO();
     dao.DeleteComment(cID);
 }
Esempio n. 4
0
        public void UpdateComment(CommentVO comment)
        {
            CommentDAO dao = new CommentDAO();

            dao.UpdateComment(comment);
        }
Esempio n. 5
0
        public void SubmitVote(int comID, int uID, int vote)
        {
            UserManagementBO userBO = new UserManagementBO();

            CommentDAO dao = new CommentDAO();

            dao.SubmitVote(uID, comID, vote);
            userBO.ChangeRating(uID, vote);
        }
Esempio n. 6
0
        public List<CommentVO> GetListOfSubmissionComments(int subID)
        {
            CommentDAO dao = new CommentDAO();
            List<CommentVO> commentList = dao.GetAllCommentsInASubmission(subID);

            return commentList;
        }
Esempio n. 7
0
        public List<CommentVO> GetListOfCommentsByUserID(int size, int userID)
        {
            CommentDAO dao = new CommentDAO();
            List<CommentVO> commentList = dao.GetAllUsersComments(userID);

            TruncateList(commentList, size);

            return commentList;
        }
Esempio n. 8
0
 public CommentVO GetComment(int cID)
 {
     CommentDAO dao = new CommentDAO();
     return dao.GetComment(cID);
 }