コード例 #1
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());
        }
コード例 #2
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());
        }
コード例 #3
0
        // GET: Admin/DeThi/Edit/5
        public ActionResult Edit(int id)
        {
            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");
            ViewBag.soCauDaCo = _db.CT_DETHI_CAUHOI.Count(x => x.IDDETHI == id);
            var cauhoi = new CT_CauHoi_DeThi();

            ViewBag.dsCauHoi = cauhoi.ToListCauHoiDeThi(id);
            return(View(_db.DETHIs.Find(id)));
        }