Пример #1
0
        public ActionResult Insert(Comment newComment)
        {
            var commentService = new CommentService();
            commentService.AddComment(newComment);

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