Exemplo n.º 1
0
        public ActionResult Insert(Comment newComment)
        {
            var commentService = new CommentService();
            commentService.AddComment(newComment);

            return RedirectToAction("Index");
        }
Exemplo n.º 2
0
        public void EditComment(Comment comment)
        {
            Comment serverComment = codeTalkContext.Comments.FirstOrDefault(t => t.Id == comment.Id);
            serverComment.Body = comment.Body;
            serverComment.DateCreated = comment.DateCreated;
            serverComment.DateModified = DateTime.Now;

            codeTalkContext.SaveChanges();
        }
Exemplo n.º 3
0
 public ActionResult Insert(int id)
 {
     Comment comment = new Comment() { TalkId = id };
     return View(comment);
 }
Exemplo n.º 4
0
 public ActionResult Edit(Comment comment)
 {
     var commentService = new CommentService();
     commentService.EditComment(comment);
     return RedirectToAction("Index");
 }
Exemplo n.º 5
0
 public void DeleteComment(Comment comment)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 public void EditComment(Comment comment)
 {
     commentRepository.EditComment(comment);
 }
Exemplo n.º 7
0
 public void DeleteTalk(Comment comment)
 {
     commentRepository.DeleteComment(comment);
 }
Exemplo n.º 8
0
 public bool AddComment(Comment comment)
 {
     return commentRepository.AddComment(comment);
 }