Exemplo n.º 1
0
        // GET: Admin/MonThi/Edit/5
        public ActionResult Edit(int id)
        {
            var dao = new CapThiDao();

            ViewBag.CapThiID = new SelectList(dao.toList(), "IDCAPTHI", "TENCAPTHI");
            return(View(db.MONTHIs.Find(id)));
        }
Exemplo n.º 2
0
        // GET: Admin/MonThi/Create
        public ActionResult Create()
        {
            var dao = new CapThiDao();

            ViewBag.CapThiID = new SelectList(dao.toList(), "IDCAPTHI", "TENCAPTHI");
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            var dethilist = new DeThiDao().ListDeThiMoi();

            ViewBag.dethilist = dethilist;
            var dao = new ShowGiaoDienChinhDao();

            ViewBag.MenuChinh = dao.ListCapThi();
            ViewBag.MenuCon   = dao.ListMonThi();
            var thongbao = new ThongBaoDao();

            ViewBag.ListThongBao = thongbao.toList();
            var socau = new SoCauDao();

            ViewBag.socau = socau.toList();
            var thoigian = new ThoiGianDao();

            ViewBag.thoigian = thoigian.toList();
            var chuyennganh = new ChuyenNganhDao();

            ViewBag.chuyennganh = chuyennganh.toList();
            var dethi = new DeThiDao();

            ViewBag.dethi = dethi.toList();
            var dao0 = new MucDoDao();

            ViewBag.MucDoID = new SelectList(dao0.toList(), "IDMUCDO", "TENMUCDO");
            var dao1 = new MonThiDao();

            ViewBag.MonThiID = new SelectList(dao1.toList(), "IDMON", "TENMON");
            var dao2 = new ThoiGianDao();

            ViewBag.ThoiGianID = new SelectList(dao2.toList(), "IDTHOIGIAN", "THOIGIAN1");
            var dao3 = new SoCauDao();

            ViewBag.SoCauID = new SelectList(dao3.toList(), "IDSOCAU", "SOCAU1");
            var dao4 = new CapThiDao();

            ViewBag.CapThiID = new SelectList(dao4.toList(), "IDCAPTHI", "TENCAPTHI");

            var tintuc = new TinTucDao();

            ViewBag.tintuc    = tintuc.listtintucsapxep();
            ViewBag.tintuctop = tintuc.tintuctop1();

            return(View());
        }
Exemplo n.º 4
0
        // GET: TaiLieuHocTap
        public ActionResult Index()
        {
            var dethilist = new DeThiDao().ListDeThiMoi();

            ViewBag.dethilist = dethilist;
            var monthi = new MonThiDao().toList();

            ViewBag.monthi = monthi;
            var capthi = new CapThiDao().toList();

            ViewBag.capthi = capthi;
            var chuyennganh = new ChuyenNganhDao();

            ViewBag.chuyennganh = chuyennganh.toList();
            var ct_chuyennganh = new CT_ChuyenNganh_MonDao();

            ViewBag.CT_chuyennganh = ct_chuyennganh.ToList();
            return(View(db.TAILIEUx.ToList()));
        }
Exemplo n.º 5
0
        // GET: Admin/DeThi/Create
        public ActionResult Create()
        {
            var dao = new MucDoDao();

            ViewBag.MucDoID = new SelectList(dao.toList(), "IDMUCDO", "TENMUCDO");
            var dao1 = new MonThiDao();

            ViewBag.MonThiID = new SelectList(dao1.toList(), "IDMON", "TENMON");
            var dao2 = new ThoiGianDao();

            ViewBag.ThoiGianID = new SelectList(dao2.toList(), "IDTHOIGIAN", "THOIGIAN1");
            var dao3 = new SoCauDao();

            ViewBag.SoCauID = new SelectList(dao3.toList(), "IDSOCAU", "SOCAU1");
            var dao4 = new CapThiDao();

            ViewBag.CapThiID = new SelectList(dao4.toList(), "IDCAPTHI", "TENCAPTHI");

            return(View());
        }
Exemplo n.º 6
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         var ketqua = new CapThiDao().XoaCapThi(id);
         if (ketqua == 1)
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("", "Tồn tại môn thi, đề thi, chuyên ngành thuộc cấp thi này.");
             return(RedirectToAction("Edit", new { id = id }));
         }
     }
     catch
     {
         return(View("Error_404"));
     }
     return(RedirectToAction("Index"));
 }
Exemplo n.º 7
0
 public ActionResult Edit(CAPTHI model, FormCollection collection)
 {
     //try
     //{
     if (ModelState.IsValid)
     {
         var ketqua = new CapThiDao().SuaCapThi(model);
         if (ketqua == 1)
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("", "Tên cấp thi đã tồn tại");
             return(RedirectToAction("Edit", new { id = model.IDCAPTHI }));
         }
     }
     //}
     //catch
     //{
     //    return View("Error_404");
     //}
     return(View("Index"));
 }
Exemplo n.º 8
0
        public ActionResult Create(CAPTHI model, FormCollection collection)
        {
            var ketqua = new CapThiDao().ThemCapThi(model);

            // TODO: Add insert logic here
            if (ModelState.IsValid)
            {
                if (ketqua == 1)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Tên cấp thi đã tồn tại");
                    return(View("Create"));
                }
            }
            else
            {
                ModelState.AddModelError("", "Điền đầy đủ thông tin");
                return(View("Create"));
            }
            return(View("Index"));
        }
Exemplo n.º 9
0
        // GET: Admin/CapThi/Delete/5
        public ActionResult Delete(int id)
        {
            var model = new CapThiDao().CapThiSingle(id);

            return(View(model));
        }
Exemplo n.º 10
0
        // GET: Admin/CapThi
        public ActionResult Index()
        {
            var model = new CapThiDao().toList();

            return(View(model));
        }