Example #1
0
        public void Add(CommentDetailDTO entity)
        {
            Comment comment = new Comment();

            comment.Title          = entity.Title;
            comment.CommentContent = entity.CommentContent;
            comment.MemberID       = entity.MemberID;
            comment.AddDate        = entity.AddDate;
            comment.CategoryID     = entity.CategoryID;
            comment.IsApproved     = entity.IsApproved;
            comment.Rating         = entity.Rating;
            comment.Feedback       = entity.Feedback;
            if (entity.MealOptionID != null)
            {
                comment.MealOptionID = (int)entity.MealOptionID;
            }
            commentDAO.Add(comment);
        }
Example #2
0
        public String Comment(int chapterId, String content)
        {
            if (CheckStatusUser())
            {
                return(null);
            }

            content = Server.UrlDecode(content);

            comment comment = new comment();

            comment.ChapterId     = chapterId;
            comment.CommentConten = content;
            comment.UserId        = _user.UserId;


            CommentDAO commentDao = new CommentDAO();

            var cmt = commentDao.Add(comment);

            var json = JsonConvert.SerializeObject(cmt);

            return(json);
        }