public ActionResult Edit(TrinhDo trinhDo) { try { // TODO: Add update logic here if (ModelState.IsValid) { var _trinhDoDao = new TrinhDoDao(); var res = _trinhDoDao.Update(trinhDo); if (res) { return(RedirectToAction("Index", "TrinhDo")); } else { ModelState.AddModelError("", "Cập nhật lỗi"); } } return(View(trinhDo)); } catch { return(RedirectToAction("Index", "TrinhDo")); } }
public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var trinhDoDao = new TrinhDoDao(); var modelTrinhDo = trinhDoDao.ListAllPaging(searchString, page, pageSize); return(View(modelTrinhDo)); }
public ActionResult EditLevel(TrinhDo trinhDo) { var _daoTrinhDo = new TrinhDoDao(); var res = _daoTrinhDo.Update(trinhDo); return(View()); }
public ActionResult Create(TrinhDo trinhDo) { // TODO: Add insert logic here var trinhDoDao = new TrinhDoDao(); int maTrinhDo = trinhDoDao.Insert(trinhDo); if (maTrinhDo > 0) { return(RedirectToAction("Index", "TrinhDo")); } else { ModelState.AddModelError("", "Thêm thất bại"); } return(View(trinhDo)); }
// GET: TrinhDo/Edit/5 public ActionResult Edit(int id) { var trinhDo = new TrinhDoDao().ViewDetails(id); return(View(trinhDo)); }
// GET: TrinhDo/Details/5 public ActionResult Details(int id) { var model = new TrinhDoDao().ViewDetails(id); return(View(model)); }