// GET: Admin/Content public ActionResult Index(int page = 1, int pagesize = 2) { var dao = new ConTentDao(); var model = dao.ListAll(page, pagesize); return(View(model)); }
public ActionResult Create(ConTent content) { if (ModelState.IsValid) { var dao = new ConTentDao(); long id = dao.Insert(content); if (id > 0) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Thêm mới thất bại"); } } SetViewBag(); return(View()); }