public ActionResult ChangeClass(int id, int?classid) { Student student = StuBO.GetStudentByID(id); if (classid != null) { int clsid = classid.GetValueOrDefault(); var type = ClassBO.GetClassByID(clsid).MajorID; List <Class> cls = ClassBO.GetAllClasses().Where(a => a.MajorID == type && a.Students.Count() < 30 && a.ClassID != clsid).ToList(); ViewBag.ClassID = cls; int tmp = classid.Value; ViewBag.Class = ClassBO.GetClassByID(tmp).ClassName; } else { ViewBag.ClassID = ClassBO.GetAllClasses(); } return(View(student)); }
// // GET: /Class/Details/5 public ViewResult Details(int id) { Class cls = ClassBO.GetClassByID(id); return(View(cls)); }