Пример #1
0
        public ActionResult EditPage(int id)
        {
            var repo = PageRepoFactory.Create();
            var page = repo.GetPage(id);

            return(View(page));
        }
Пример #2
0
        public ActionResult SavedPages()
        {
            var repo = PageRepoFactory.Create();

            var model = repo.GetAllPages();

            return(View(model));
        }
Пример #3
0
        public ActionResult DeletePage(int id)
        {
            var repo = PageRepoFactory.Create();

            repo.RemovePage(id);

            return(RedirectToAction("SavedPages"));
        }
Пример #4
0
        public ActionResult Page(int id)
        {
            Page model = new Page();

            var repo = PageRepoFactory.Create();

            model = repo.GetPage(id);

            return(View(model));
        }
Пример #5
0
        public ActionResult AddPage(Page p)
        {
            var repo = PageRepoFactory.Create();

            if (ModelState.IsValid)
            {
                if (p.IsInNavigation)
                {
                    p.IsFinished = true;
                }
                repo.AddPage(p);
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                return(View(p));
            }
        }