// // GET: /RollCall/Create public ActionResult Create() { //Mac dinh, majorID la 1 int MajorID = 1; //Them 1 cai ID cua instructor ViewBag.InstructorID = SlFactory.MakeSelectList <Instructor>("InstructorID", "FullName"); ViewBag.MajorID = SlFactory.MakeSelectList <Major>("MajorID", "FullName", MajorID); ViewBag.ClassID = new SelectList(ClaBO.GetClassByMajor(MajorID), "ClassID", "ClassName"); //Mac dinh, lay semester moi nhat List <Semester> semester = SeBO.GetList().Where(s => s.EndDate > DateTime.Now).ToList(); ViewBag.SemesterID = semester; ViewBag.SubjectID = new SelectList(SubBO.GetSubjectByMajor(MajorID), "SubjectID", "FullName"); return(View()); }