Exemple #1
0
        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));
        }
 public ViewResult Index()
 {
     return(View(ClassBO.GetAllClasses().ToList()));
 }