예제 #1
0
        public ActionResult GetBlogPost(int id)
        {
            //TODO: check id is valid
            BlogPost        existingPost  = _blogServices.GetBlogPost(id);
            List <Category> allCategories = _blogServices.GetAllCategories();

            var model = WebServices.ConvertBlogPostToVeiwModel(existingPost, allCategories);

            return(View(model));
        }
예제 #2
0
        public AllBlogPostsVM GetAllBlogPostsVM()
        {
            AllBlogPostsVM allBlogPosts = new AllBlogPostsVM();

            allBlogPosts.AllBlogPosts  = _blogServices.GetAllBlogPosts();
            allBlogPosts.AllCategories = _blogServices.GetAllCategories();
            allBlogPosts.AllTags       = _blogServices.GetAllTags();

            return(allBlogPosts);
        }
예제 #3
0
        public PartialViewResult FillWidgetWithData()
        {
            AllBlogPostsVM result = new AllBlogPostsVM();

            result.AllBlogPosts  = _blogServices.GetAllBlogPosts();
            result.AllCategories = _blogServices.GetAllCategories();
            result.AllTags       = _blogServices.GetAllTags();

            return(PartialView("~/Views/Shared/_BlogWidgetPartial.cshtml", result));
        }
예제 #4
0
        public ActionResult AdminPanel()
        {
            AdminPanelVM model = new AdminPanelVM();

            model.Users       = _blogServices.GetAllUsers();
            model.Categories  = _blogServices.GetAllCategories();
            model.StaticPages = _staticPageServices.GetAllStaticPages();
            model.BlogPosts   = _blogServices.GetAllBlogPosts();

            return(View(model));
        }