Ejemplo n.º 1
0
        // GET: Admin/StaticPageAdmin
        public ActionResult Index(string search, int page = 1, int pageSize = 4)
        {
            var stpAll = new StaticPageDAO();
            var model  = stpAll.ListAllPage(search, page, pageSize);

            ViewBag.Search = search;

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(StaticPage stp)
        {
            if (ModelState.IsValid)
            {
                var dao = new StaticPageDAO();

                var result = dao.Update(stp);
                if (result)
                {
                    return(RedirectToAction("Index", "StaticPageAdmin"));
                }
                else
                {
                    ModelState.AddModelError("", "Cập nhật thất bại");
                }
            }
            return(View("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult Create(StaticPage stp)
        {
            if (ModelState.IsValid)
            {
                var dao = new StaticPageDAO();

                long id = dao.Insert(stp);
                if (id > 0)
                {
                    return(RedirectToAction("Index", "StaticPageAdmin"));
                }
                else
                {
                    ModelState.AddModelError("", "Thêm mới thất bại");
                }
            }
            return(View());
        }
Ejemplo n.º 4
0
        // GET: Admin/StaticPage/Edit/5
        public ActionResult Edit(int id)
        {
            var stp = new StaticPageDAO().ViewDetail(id);

            return(View(stp));
        }