Exemplo n.º 1
0
        public ActionResult UnfeatureComment(FeatureCommentViewModel post)
        {
            if (this.User == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.Forbidden));
            }
            if (post.Article == null || post.Comment == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var article = ArticleModel.GetArticleById((int)post.Article);

            if (article == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
            if (!this.User.IsAdmin && this.User.Identity.Name != article.Author.Slug)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.Forbidden));
            }
            if (!StoredProcs.Articles_UnfeatureComment(article.Id, post.Comment).Execute().Value)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            return(RedirectToRoute("ArticleCommentsAdmin", new { id = article.Id }));
        }
Exemplo n.º 2
0
        public static void UnfeatureComment(int articleId, int discourseTopicId)
        {
            Logger.Information("Unfeaturing comment for article (ID={0}) and discourse topic (ID={1}).", articleId, discourseTopicId);

            StoredProcs
            .Articles_UnfeatureComment(articleId, discourseTopicId)
            .Execute();
        }
Exemplo n.º 3
0
 public static void UnfeatureComment(int articleId, int discourseTopicId)
 {
     StoredProcs
     .Articles_UnfeatureComment(articleId, discourseTopicId)
     .Execute();
 }