Exemple #1
0
        public ActionResult DisplayStaticPage(int id)
        {
            var ops = new BlogPostOperations();
            var vm = new HomeIndexViewModel();
               var newStaticPage = ops.GetStaticPageByID(id);

            return View(newStaticPage);
        }
Exemple #2
0
        public ActionResult ListPostsByTag(int id)
        {
            var ops = new BlogPostOperations();
            var vm = new HomeIndexViewModel();
            vm.BlogPosts = ops.GetPostsByTagID(id);
            vm.Categories = ops.GetAllCategories();
            vm.StaticPages = ops.GetAllStaticPages();

            return View("Index", vm);
        }
Exemple #3
0
        public ActionResult Index(int id = 0)
        {
            var ops = new BlogPostOperations();
            var vm = new HomeIndexViewModel();
            //vm.BlogPosts = ops.GetBlogPosts();
            vm.Categories = ops.GetAllCategories();
            vm.StaticPages = ops.GetAllStaticPages();
            // paging
            var posts = ops.GetBlogPosts();
            vm.PostTotal = posts.Count;
            vm.RouteID = id;
            vm.BlogPosts = posts.Skip(id*5).Take(5).ToList();

            return View(vm);
        }
Exemple #4
0
        public ActionResult DisplayPostsWithStatus0()
        {
            var ops = new BlogPostOperations();
            var vm = new HomeIndexViewModel();
            vm.BlogPosts = ops.GetPostsWithStatus0();
            vm.Categories = ops.GetAllCategories();
            vm.StaticPages = ops.GetAllStaticPages();

            return View(vm);
        }
Exemple #5
0
        public ActionResult EditStaticPage()
        {
            //need a list of static pages
            var ops = new BlogPostOperations();
            var vm = new HomeIndexViewModel();
            vm.StaticPages = ops.GetAllStaticPages();

            return View(vm);
        }