コード例 #1
0
        public ActionResult CommentForm(Comment comment)
        {
            if (!ModelState.IsValid)
            {
                return(View(comment));
            }

            bl.AddComment(comment);
            TempData["Message"] = "Hurray! Your comment is added!";

            return(RedirectToAction("Article", "Article", new { articleId = Convert.ToInt32(Session["ArticleId"]) }));
        }
コード例 #2
0
ファイル: PostController.cs プロジェクト: fastndead/Blog
        public void AddComment(int postId, string text)
        {
            var bl = new BusinessLogic();

            bl.AddComment(postId, text, int.Parse(User.Identity.Name));
        }