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

            return RedirectToAction("Index");
        }
Esempio 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();
        }
Esempio n. 3
0
 public ActionResult Insert(int id)
 {
     Comment comment = new Comment() { TalkId = id };
     return View(comment);
 }
Esempio n. 4
0
 public ActionResult Edit(Comment comment)
 {
     var commentService = new CommentService();
     commentService.EditComment(comment);
     return RedirectToAction("Index");
 }
Esempio n. 5
0
 public void DeleteComment(Comment comment)
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 public void EditComment(Comment comment)
 {
     commentRepository.EditComment(comment);
 }
Esempio n. 7
0
 public void DeleteTalk(Comment comment)
 {
     commentRepository.DeleteComment(comment);
 }
Esempio n. 8
0
 public bool AddComment(Comment comment)
 {
     return commentRepository.AddComment(comment);
 }