public ActionResult QuanLyNguoiDungPartial() { if (Session["TaiKhoan"] != null) { TieuChuanDTO tc = new TieuChuanDTO(); var lstKhoa = tc.getAllKhoa().OrderBy(n => n.makhoa); var lstBoMon = tc.getAllBoMon().OrderBy(n => n.mabomon); ViewBag.DMKhoa = lstKhoa.Select(i => new { TenKhoa = i.tenkhoa, MaKhoa = i.makhoa }); ViewBag.DMBoMon = lstBoMon.Select(i => new { TenBM = i.tenbomon, MaBM = i.mabomon }); var model = db1.ht_dm_nsd; return(PartialView("_QuanLyNguoiDungPartial", model.OrderByDescending(n => n.ngaytao).ToList())); } return(RedirectToAction("DangNhap", "TaiKhoan")); }
public ActionResult Index() { if (Session["TaiKhoan"] != null) { TieuChuanDTO tc = new TieuChuanDTO(); var lstKhoa = tc.getAllKhoa().OrderBy(n => n.makhoa); var lstBoMon = tc.getAllBoMon().OrderBy(n => n.mabomon); ViewBag.DMKhoa = lstKhoa.Select(i => new { TenKhoa = i.tenkhoa, MaKhoa = i.makhoa }); ViewBag.DMBoMon = lstBoMon.Select(i => new { TenBM = i.tenbomon, MaBM = i.mabomon }); ViewBag.DMKhoa1 = new SelectList(db1.dm_khoa.ToList().OrderBy(n => n.makhoa), "makhoa", "tenkhoa"); ViewBag.DMBoMon1 = new SelectList(db1.dm_bomon.ToList().OrderBy(n => n.mabomon), "mabomon", "tenbomon"); return(View()); } return(RedirectToAction("DangNhap", "TaiKhoan")); }