Ejemplo n.º 1
0
        public ActionResult Create(string body, int postId)
        {
            Comment comment = new Comment();

            comment.Body   = body;
            comment.Post   = PostDAO.FindId(postId);
            comment.User   = Sessao.user;
            comment.Status = 0;
            comment.Date   = DateTime.Now;

            CommentDAO.CreateComment(comment);

            return(RedirectToAction("Detail", "Post", new { id = postId }));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create comment.
 /// </summary>
 /// <param name="comment">Comment object</param>
 /// <returns></returns>
 public bool CreateComment(Comment comment)
 {
     return(comdao.CreateComment(comment));
 }