private void txtGRDoc_TextChanged(object sender, EventArgs e) { if (Errors == null) { Errors = new SmartSchool.Common.EnhancedErrorProvider(); } Errors.Clear(); }
// datagridView 因為需求改變,所以在顯示設成隱藏,但實作上還是保留。 private void BatchStudGraduateDocNo_Load(object sender, EventArgs e) { // 加入年級, 先濾一般生 tmpStudRecs = new Dictionary <string, List <JHSchool.Data.JHStudentRecord> >(); List <JHSchool.Data.JHStudentRecord> AllStudRecList = JHSchool.Data.JHStudent.SelectAll(); foreach (JHSchool.Data.JHStudentRecord studRec in AllStudRecList) { if (studRec.Class != null) { if (studRec.Class.GradeYear.HasValue && studRec.Status == K12.Data.StudentRecord.StudentStatus.一般) { string grYear = studRec.Class.GradeYear.Value + ""; if (tmpStudRecs.ContainsKey(grYear)) { tmpStudRecs[grYear].Add(studRec); } else { List <JHSchool.Data.JHStudentRecord> studRecList = new List <JHSchool.Data.JHStudentRecord>(); studRecList.Add(studRec); tmpStudRecs.Add(grYear, studRecList); } } } } List <string> tmpGrYear = new List <string>(); foreach (KeyValuePair <string, List <JHSchool.Data.JHStudentRecord> > Grade in tmpStudRecs) { tmpGrYear.Add(Grade.Key); } tmpGrYear.Sort(); cboGradeYear.Items.AddRange(tmpGrYear.ToArray()); lblHasGraduateCount.Text = ""; lblTotalCount.Text = ""; GraduateStudRecs = new List <StudDiplomaInfoJuniorDiplomaNumber>(); NGraduateStudRecs = new List <StudDiplomaInfoJuniorDiplomaNumber>(); // 加入標頭 dgGraduateDocNoData.Columns.Add("StudentID", "StudentID"); dgGraduateDocNoData.Columns.Add("ClassName", "班級"); dgGraduateDocNoData.Columns.Add("SeatNo", "座號"); dgGraduateDocNoData.Columns.Add("StudentNum", "學號"); dgGraduateDocNoData.Columns.Add("Name", "姓名"); dgGraduateDocNoData.Columns.Add("Status", "離校類別"); dgGraduateDocNoData.Columns.Add("GRDocNo", "畢業證書字號"); dgGraduateDocNoData.Columns.Add("Sort1", "Sort1"); cboSortBySnum.Checked = true; if (Errors == null) { Errors = new SmartSchool.Common.EnhancedErrorProvider(); } studRecSDIs = new List <StudDiplomaInfoJuniorDiplomaNumber>(); }