/// <summary> /// 取得有BBS的班级 /// </summary> /// <returns></returns> public ClassViewData GetClassListWithinBBS() { var tempClass = from c in CQGJ.Classes join b in CQGJ.BBS on c.ClassID equals b.Classes.ClassID orderby c.ClassName select c; // 初始化 ClassViewData ClassVD = new ClassViewData(); ClassVD.ClassList = new List<ClassInfo>(); foreach (var Class in tempClass) { ClassInfo tempClassInfo = new ClassInfo(); tempClassInfo.Class = Class; ClassVD.ClassList.Add(tempClassInfo); } return ClassVD; }
/// <summary> /// 取得班级列表 /// </summary> /// <returns></returns> public ClassViewData GetClassList() { var temp = from c in CQGJ.Classes select c; // 初始化 ClassViewData ClassVD = new ClassViewData(); ClassVD.ClassList = new List<ClassInfo>(); foreach (var Class in temp) { ClassInfo tempClassInfo = new ClassInfo(); tempClassInfo.Class = Class; ClassVD.ClassList.Add(tempClassInfo); } return ClassVD; }