Ejemplo n.º 1
0
        public ActionResult DeclineComment(string commentId, string location)
        {
            var thisComm             = databaseEntities.Comments.Find(Int32.Parse(commentId));
            CommentViewModel comment = new CommentViewModel(thisComm, true, location);

            comment.declineCommentFrom(thisComm);
            databaseEntities.SaveChanges();
            switch (comment.location)
            {
            case "Profile":
                return(RedirectToAction("ShowMyProfile", "Profile"));

            case "Newsfeed":
                return(RedirectToAction("Index", "NewsFeed"));

            case "Groups":
                return(RedirectToAction("Show", "Groups"));

            default:
                return(Index());
            }
        }