private void History_worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error == null && e.Result != null) { wizardPage2.NextButtonEnabled = DevComponents.DotNetBar.eWizardButtonState.True; wizardPage2.BackButtonEnabled = DevComponents.DotNetBar.eWizardButtonState.True; if (e.Result is bool) { lnErrorViewHistory.Visible = true; if (_type.Equals("Student")) { labelX4.Text = "學期歷程有誤"; _viewer.ShowDialog(); } else if (_type.Equals("EduAdmin")) { labelX5.Visible = true; } } else { wizard1.SelectedPage = wizardPage3; } } else { } }
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { LogWriter.Log(e.Exception, "Thread Exception"); var errorViewer = new ErrorViewer(e.Exception); errorViewer.ShowDialog(); Environment.Exit(1); }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { var ex = (Exception)e.ExceptionObject; LogWriter.Log(ex, "Unhandled Exception"); var errorViewer = new ErrorViewer(ex); errorViewer.ShowDialog(); Environment.Exit(2); }
private void HistoryWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { //progressBar.Value = 100; if (e.Error != null) { SmartSchool.ErrorReporting.ReportingService.ReportException(e.Error); MsgBox.Show("檢查學期歷程時發生錯誤。" + e.Error.Message); return; } if (_errorList.Count > 0) { btnExit.Enabled = true; ErrorViewer viewer = new ErrorViewer(); viewer.SetHeader("學生"); foreach (StudentRecord student in _errorList) { viewer.SetMessage(student, new List <string>(new string[] { "學期歷程不完整" })); } viewer.ShowDialog(); return; } else { // 加入這段主要在處理當學期還沒有產生學期歷程,資料可以判斷 UIConfig._StudentSHistoryRecDict.Clear(); Dictionary <string, int> studGradeYearDict = new Dictionary <string, int>(); // 取得學生ID List <string> studIDs = (from data in _students select data.ID).Distinct().ToList(); foreach (JHStudentRecord stud in JHStudent.SelectByIDs(studIDs)) { if (stud.Class != null) { if (stud.Class.GradeYear.HasValue) { if (!studGradeYearDict.ContainsKey(stud.ID)) { studGradeYearDict.Add(stud.ID, stud.Class.GradeYear.Value); } } } } bool checkInsShi = false; // 取得學生學期歷程,並加入學生學習歷程Cache foreach (JHSemesterHistoryRecord rec in JHSemesterHistory.SelectByStudentIDs(studIDs)) { checkInsShi = true; K12.Data.SemesterHistoryItem shi = new K12.Data.SemesterHistoryItem(); shi.SchoolYear = UIConfig._UserSetSHSchoolYear; shi.Semester = UIConfig._UserSetSHSemester; if (studGradeYearDict.ContainsKey(rec.RefStudentID)) { shi.GradeYear = studGradeYearDict[rec.RefStudentID]; } foreach (K12.Data.SemesterHistoryItem shiItem in rec.SemesterHistoryItems) { if (shiItem.SchoolYear == shi.SchoolYear && shiItem.Semester == shi.Semester) { checkInsShi = false; } } if (checkInsShi) { rec.SemesterHistoryItems.Add(shi); } if (!UIConfig._StudentSHistoryRecDict.ContainsKey(rec.RefStudentID)) { UIConfig._StudentSHistoryRecDict.Add(rec.RefStudentID, rec); } } //lblProgress.Text = "畢業資格審查中…"; FISCA.LogAgent.ApplicationLog.Log("成績系統.報表", "列印畢業預警報表", "產生畢業預警報表"); _inspectWorker.RunWorkerAsync(_students, new object[] { _passList, _result }); } }