Exemplo n.º 1
0
        public ActionResult ApprovePost(string id)
        {
            PostsManager manager  = new PostsManager();
            var          response = manager.GetById(int.Parse(id));
            var          post     = response.Posts.First();

            post.IsApproved = true;
            manager.Edit(post);
            return(RedirectToAction("Panel", "Admin"));
        }
Exemplo n.º 2
0
        public ActionResult UpdatePost(string id, string title, string body)
        {
            PostsManager manager      = new PostsManager();
            var          response     = manager.GetById(int.Parse(id));
            var          postToUpdate = response.Posts.First();

            postToUpdate.PostTitle = title;
            postToUpdate.PostBody  = body;
            manager.Edit(postToUpdate);
            return(RedirectToAction("Index", "Home"));
        }