public ActionResult Create(Slide slide) { try { if (ModelState.IsValid) { // TODO: Add insert logic here var dao = new SlideDao(); var id = dao.Insert(slide); if (id > 0) { return RedirectToAction("Index"); } else { ModelState.AddModelError("", StaticResources.Resources.InsertCategoryFailed); } } } catch { return View(); } return View(); }
// GET: Admin/Slide public ActionResult Index() { var dao = new SlideDao(); var model = dao.ListAll(); return View(model); }