public ActionResult Edit(int id) { var result = new SlidesDao().GetById(id); SetViewBag(); return(View(result)); }
public ActionResult Create(SLIDE model) { try { if (ModelState.IsValid) { var dao = new SlidesDao(); int id = dao.Insert(model); if (id > 0) { SetAlert("Thêm thành công", "success"); return(RedirectToAction("Index", "Slide")); } else { ModelState.AddModelError("", "Thêm thất bại"); } } SetViewBag(model.ID); return(View(model)); } catch { return(View()); } }
public JsonResult ChangeStatus(int id) { var result = new SlidesDao().ChangeStatus(id); return(Json(new { status = result })); }
public ActionResult Edit(SLIDE model) { try { if (ModelState.IsValid) { var result = new SlidesDao().Update(model); if (result) { SetAlert("Cập nhật thành công", "success"); return(RedirectToAction("Index", "Slide")); } else { ModelState.AddModelError("", "Cập nhật thất bại"); } } SetViewBag(model.ID); return(View(model)); } catch { return(View()); } }
public ActionResult Index() { var model = new SlidesDao().GetAll(); return(View(model)); }
public ActionResult BotSlides() { var model = new SlidesDao().ListByGroupId(2); return(PartialView(model)); }