void _BGWorker_DoWork(object sender, DoWorkEventArgs e) { // 取得一般或輟學 _CurrentStudentList.Clear(); _CurrentPhoneDic.Clear(); foreach (JHStudentRecord studRec in JHStudent.SelectByClassID(PrimaryKey)) { if (studRec.Status == K12.Data.StudentRecord.StudentStatus.一般 || studRec.Status == K12.Data.StudentRecord.StudentStatus.輟學) { _CurrentStudentList.Add(studRec); } } // 按座號排序 _CurrentStudentList.Sort(new Comparison <JHStudentRecord>(ClassStudSeatNoSorter)); // 取得學生電話 foreach (JHPhoneRecord phoneRec in JHPhone.SelectByStudents(_CurrentStudentList)) { _CurrentPhoneDic.Add(phoneRec.RefStudentID, phoneRec); } }