Beispiel #1
0
        public int CreateComment(TaskCommentModel comment, int userId)
        {
            Task task = entities.Tasks.First(t => t.TaskId == comment.TaskId);

            TaskComment newComment = entities.TaskComments.Create();
            newComment.CreatedUserId = userId;
            newComment.Comment = comment.CommentText;

            task.TaskComments.Add(newComment);
            SaveChanges();

            return newComment.CommentId;
        }
Beispiel #2
0
 public JsonResult CreateComment(TaskCommentModel comment)
 {
     return Json(oper.CreateComment(comment, HttpUserData.Get().Id), JsonRequestBehavior.AllowGet);
 }