Ejemplo n.º 1
0
        public ActionResult ReplyComment(int id)
        {
            if (LoggedUserName == null)
            {
                return(View("NotLoggedIn"));
            }

            ViewBag.Comment = Dao.GetComment((uint)id);

            if (Request.HttpMethod == "GET")
            {
                return(View());
            }

            var comment = new ReplyComment()
            {
                Parent       = (uint)id,
                AuthorName   = LoggedUserName,
                Content      = Request.Params["content"],
                CreatedOn    = DateTime.Now,
                SubforumName = ViewBag.Comment.SubforumName,
                ThemeTitle   = ViewBag.Comment.ThemeTitle
            };

            if (Dao.AddComment(comment))
            {
                ViewBag.Title = "Replying Successful";
            }
            else
            {
                ViewBag.Title = "Replying Failed";
            }

            return(View("ReplyResult"));
        }
Ejemplo n.º 2
0
        public void AddComment(Comment comment)
        {
            var c = Dao.AddComment(comment);

            if (c == null)
            {
                return;
            }
            var b = GetCommentBookmark(c);

            SendCommentUpdates(c, b);
            SubscribeOnBookmarkComments(b, true);
        }