Esempio n. 1
0
        public ActionResult DeleteStaticPage(int staticPageId)
        {
            var staticPageMgr = StaticPageManagerFactory.Create();
            var page          = staticPageMgr.GetPageById(staticPageId);

            var response = staticPageMgr.DeleteStaticPage(page.Page.StaticPageId);

            return(RedirectToAction("StaticPages"));
        }
Esempio n. 2
0
        public ActionResult EditStaticPage(int staticPageId)
        {
            var model         = new EditStaticPageViewModel();
            var staticPageMgr = StaticPageManagerFactory.Create();

            var page = staticPageMgr.GetPageById(staticPageId);

            model.Page = page.Page;

            return(View(model));
        }
Esempio n. 3
0
        public ActionResult StaticPages()
        {
            var model         = new StaticPagesViewModel();
            var staticPageMgr = StaticPageManagerFactory.Create();

            var response = staticPageMgr.GetStaticPages();

            model.StaticPages = response.Pages;

            return(View(model));
        }
Esempio n. 4
0
        public ActionResult EditStaticPage(EditStaticPageViewModel model)
        {
            if (ModelState.IsValid)
            {
                var staticPageMgr = StaticPageManagerFactory.Create();
                var response      = staticPageMgr.UpdateStaticPage(model.Page);

                if (response.Success)
                {
                    return(RedirectToAction("StaticPages"));
                }
            }

            return(View(model));
        }