public ActionResult Active(string searchString, int page = 1, int pageSize = 10) { var dao = new DtDao(); var model = dao.ListAllPagingActive(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public JsonResult ChangeStatus(int id) { var result = new DtDao().ChangeStatus(id); return(Json(new { status = result })); }
public ActionResult Create(TbDotthi dt) { var dao = new DtDao(); var id = dao.Insert(dt); if (id > 0) { SetAlert("Thêm đợt thi mới thành công", "success"); return(RedirectToAction("Index", "Dt")); } else { ModelState.AddModelError("", "Thêm mới không thành công"); } return(View("Index")); }
public ActionResult Edit(TbDotthi dt) { if (ModelState.IsValid) { var dao = new DtDao(); var result = dao.Update(dt); if (result) { SetAlert("Sửa đợt thi thành công", "success"); return(RedirectToAction("Index", "Dt")); } else { ModelState.AddModelError("", "Cập nhật không thành công"); } } return(View("Index")); }
public ActionResult Edit(int id) { var dt = new DtDao().GetByID(id); return(View(dt)); }
public void SetViewBagDt(int?selected = null) { var dao = new DtDao(); ViewBag.MaDT = new SelectList(dao.ListAll(), "MaDT", "TenDT", selected); }