Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public JsonResult ChangeStatus(int id)
        {
            var result = new DtDao().ChangeStatus(id);

            return(Json(new
            {
                status = result
            }));
        }
Ejemplo n.º 3
0
        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"));
        }
Ejemplo n.º 4
0
 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"));
 }
Ejemplo n.º 5
0
        public ActionResult Edit(int id)
        {
            var dt = new DtDao().GetByID(id);

            return(View(dt));
        }
Ejemplo n.º 6
0
        public void SetViewBagDt(int?selected = null)
        {
            var dao = new DtDao();

            ViewBag.MaDT = new SelectList(dao.ListAll(), "MaDT", "TenDT", selected);
        }