private ArrayList getfullAttandanceStudents() { ArrayList students = new ArrayList(); foreach (Student stu in stuList.allStudents()) { if (stu.isFullAttandance && stu.allStuAttandances().Count == course.allSubAttandances().Count) { students.Add(stu); } } return(students); }
public List <StuList> stuListsClassifyByClass() { List <StuList> list = new List <StuList>(); StuList exceptList = new StuList(); exceptList.name = "未知班级"; for (int i = 2; i <= sheet.LastRowNum; i++) { IRow row = sheet.GetRow(i); Student stu = studentFromRow(row); if (stu == null) { continue; } if (stu.major._class.Equals("")) { exceptList.addStudent(stu); continue; } StuList stuList = getStuListFromCurrentList(ref list, stu.major._class); stuList.addStudent(stu); } if (exceptList.allStudents().Count != 0) { list.Add(exceptList); } return(list); }
private void init_rows(Model.Course course, StuList stuList) { foreach (Student stu in stuList.allStudents()) { int newRowIndex = mainGrid.Rows.Add(); DataGridViewRow newRow = mainGrid.Rows[newRowIndex]; init_rows_baseAttributeInit(newRow, stu); init_rows_attandanceInit(newRow, course.allSubAttandances(), stu); init_rows_extrasInit(newRow, course.allExtras(), stu); } }
private void DIY_getMajorInfoOfLastStudent(StuList stuList, out string major, out string grade, out string _class) { try { ArrayList allStudents = stuList.allStudents(); Student lastStudent = (Student)(allStudents[allStudents.Count - 1]); major = lastStudent.major.name; grade = lastStudent.major.grade; _class = lastStudent.major._class; } catch (ArgumentOutOfRangeException e) { Console.WriteLine(e); major = "未命名"; grade = "未命名"; _class = "未命名"; } }
private string DIY_calTheMaxStudentId(StuList stuList) { long newStuId = 0; ArrayList allStudents = stuList.allStudents(); foreach (Student item in allStudents) { long itemId = long.Parse(item.id); if (itemId > newStuId) { newStuId = itemId; } } newStuId++; return("" + newStuId); }