示例#1
0
        public PartialViewResult AddComment(FormCollection form)
        {
            int            msgId   = Convert.ToInt32(form["MessageId"]);
            string         comment = form["NewComment"];
            CommentsModels cm      = new CommentsModels();

            cm.MessageId    = msgId;
            cm.Comment      = comment;
            cm.CommentorsId = PostHelper.GetUserId(HttpContext.User.Identity.Name);
            cm.CreateComment();

            List <CommentsModels> comments = PostsModels.GetPostByMessageId(msgId).Comments;

            return(PartialView("Comments", comments));
        }
示例#2
0
        public PartialViewResult AddComment(FormCollection form)
        {
            int msgId = Convert.ToInt32(form["MessageId"]);
            string comment = form["NewComment"];
            CommentsModels cm = new CommentsModels();
            cm.MessageId = msgId;
            cm.Comment = comment;
            cm.CommentorsId = PostHelper.GetUserId(HttpContext.User.Identity.Name);
            cm.CreateComment();

            List<CommentsModels> comments = PostsModels.GetPostByMessageId(msgId).Comments;
            return PartialView("Comments", comments);
        }