public int CheckIfVoted(int comID, int userID) { int voted; CommentDAO dao = new CommentDAO(); voted = dao.CheckIfVoted(userID, comID); return voted; }
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); }
public void DeleteComment(int cID) { CommentDAO dao = new CommentDAO(); dao.DeleteComment(cID); }
public void UpdateComment(CommentVO comment) { CommentDAO dao = new CommentDAO(); dao.UpdateComment(comment); }
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); }
public List<CommentVO> GetListOfSubmissionComments(int subID) { CommentDAO dao = new CommentDAO(); List<CommentVO> commentList = dao.GetAllCommentsInASubmission(subID); return commentList; }
public List<CommentVO> GetListOfCommentsByUserID(int size, int userID) { CommentDAO dao = new CommentDAO(); List<CommentVO> commentList = dao.GetAllUsersComments(userID); TruncateList(commentList, size); return commentList; }
public CommentVO GetComment(int cID) { CommentDAO dao = new CommentDAO(); return dao.GetComment(cID); }