Beispiel #1
0
        // GET: Admin/Page
        public ActionResult ListPage()
        {
            PageModel _pageModel = new PageModel();
            _pageModel.PageList = _pageService.GetAll().ToList();

            return View(_pageModel);
        }
Beispiel #2
0
        public ActionResult Add()
        {
            PageModel _pageModel = new PageModel
            {
                PageList = _pageService.GetUpPages().ToList()
            };

            return View(_pageModel);
        }
Beispiel #3
0
        public ActionResult PageEdit(PageModel model)
        {
            int id = int.Parse(Request.Form["hfId"]);
            Page page = _pageService.Find(id);

            page.Active = model.Active;
            page.Content = model.Content;
            page.Order = model.Order;
            page.Title = model.Title;
            page.UpPageId = model.UpPageId;

            _pageService.Update(page);
            _uow.SaveChanges();

            return RedirectToAction("ListPage");
        }
Beispiel #4
0
        public ActionResult PageAdd(PageModel model)
        {
            Page page = new Page
            {
                Active = model.Active,
                Content = model.Content,
                Order = model.Order,
                Title = model.Title,
                UpPageId = model.UpPageId
            };

            _pageService.Insert(page);
            _uow.SaveChanges();

            return RedirectToAction("ListPage");
        }
Beispiel #5
0
        public ActionResult Edit(int id)
        {
            Page page = _pageService.Find(id);

            PageModel _pageModel = new PageModel
            {
                Id = page.Id,
                Active = page.Active,
                Content = page.Content,
                Order = page.Order,
                Title = page.Title,
                UpPageId = page.UpPageId,
                PageList = _pageService.GetUpPages().ToList()
            };

            return View(_pageModel);
        }