Example #1
0
 public ActionResult EditComment(CreateCommentViewDto comment, int postId)
 {
     if (!ModelState.IsValid)
     {
         return(View(comment));
     }
     _commentService.EditComment(comment);
     return(RedirectToAction(HomeActions.Info, new { id = postId }));
 }
Example #2
0
 public ActionResult Info(CreateCommentViewDto createComment, int postId)
 {
     if (!ModelState.IsValid)
     {
         return(RedirectToAction(HomeActions.Info, new { id = postId }));
     }
     _commentService.AddCreatedComment(createComment, postId);
     return(RedirectToAction(HomeActions.Info, new { id = postId }));
 }
Example #3
0
        public void AddCreatedComment(CreateCommentViewDto comment, int ideaId)
        {
            comment.CreateOn  = DateTime.Now;
            comment.AuthorId  = _identityFacade.GetUserId();
            comment.IdeaId    = ideaId;
            comment.IsBlocked = false;
            var dbPost = Mapper.Map <Comment>(comment);

            _commentRepo.Add(dbPost);
        }
Example #4
0
        public void EditComment(CreateCommentViewDto post)
        {
            var dbPost = Mapper.Map <Comment>(post);

            _commentRepo.Update(dbPost);
        }