Ejemplo n.º 1
0
        public ActionResult Review(int id)
        {
            BlogManager manager  = BlogManagerFactory.Create();
            BlogPost    toReview = manager.GetBlog(id);

            foreach (var tag in toReview.SearchTags)
            {
                if (toReview.TagInputs == null)
                {
                    toReview.TagInputs = tag.SearchTagBody;
                }
                else
                {
                    toReview.TagInputs = (toReview.TagInputs + "," + tag.SearchTagBody);
                }
            }

            UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext()));
            var users = userMgr.Users;

            var blogVM = new BlogVM();

            blogVM.SetBlog(toReview);
            blogVM.SetBlogWriters(users);

            return(View(blogVM));
        }
Ejemplo n.º 2
0
        public ActionResult EditABlog(int id)
        {
            BlogManager manager    = BlogManagerFactory.Create();
            var         blogToEdit = manager.GetBlog(id);

            UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext()));
            var users = userMgr.Users;

            foreach (var tag in blogToEdit.SearchTags)
            {
                if (blogToEdit.TagInputs == null)
                {
                    blogToEdit.TagInputs = tag.SearchTagBody;
                }
                else
                {
                    blogToEdit.TagInputs = (blogToEdit.TagInputs + "," + tag.SearchTagBody);
                }
            }

            var blogVM = new BlogVM();

            blogVM.SetBlog(blogToEdit);
            blogVM.SetBlogWriters(users);

            return(View(blogVM));
        }
Ejemplo n.º 3
0
        public ActionResult ViewSingleAll(int id)
        {
            BlogManager manager = BlogManagerFactory.Create();
            var         blog    = manager.GetBlog(id);

            UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext()));
            var users = userMgr.Users;

            var blogVM = new BlogVM();

            blogVM.SetBlog(blog);
            blogVM.SetBlogWriters(users);

            return(View(blogVM));
        }