Пример #1
0
        public ActionResult CreateComment(CreateCommentVM create)
        {
            if (!this.ModelState.IsValid)
            {
                return(View(create));
            }

            CommentRepo commentRepo = new CommentRepo();
            Comment     newComment  = new Comment();

            newComment.commentTittle    = create.Tittle;
            newComment.commentContent   = create.Content;
            newComment.Date             = DateTime.Now;
            newComment.commentCreatorId = AuthenticationManager.LoggedUser.Id;
            newComment.taskId           = create.TaskId;

            commentRepo.Create(newComment);

            return(RedirectToAction("Details", "TaskManagement", new { id = create.TaskId }));
        }