public override bool Fill()
        {
            SubProgress progress = new SubProgress(MainProgress, WeightTable.GetJobWeight("GetSemsSubject"));

            try
            {
                Utility.StartTime("GetSemsSubject");
                progress.ReportMessage("取得學期科目成績資料…");

                List <List <string> > packages = Utility.SplitGetPackage(Students, PackageSize);

                int offset = 1;
                foreach (List <string> eachPackage in packages)
                {
                    if (MainProgress.Cancellation)
                    {
                        return(false);                           //這個部份要看的必須是 MainProgress。
                    }
                    DSXmlHelper response = QueryScore.GetSemesterSubjectScoreBySemester(false, Parameters.SchoolYear, Parameters.Semester, eachPackage.ToArray());

                    foreach (XmlElement eachStudent in response.GetElements("SemesterSubjectScore"))
                    {
                        DSXmlHelper hlpScore  = new DSXmlHelper(eachStudent);
                        string      studentId = hlpScore.GetText("RefStudentId");
                        string      scoreId   = hlpScore.GetText("@ID");

                        if (Students.ContainsKey(studentId))
                        {
                            RankStudent student = Students[studentId];
                            student.SemsSubjects.ScoreRecordIdentity = scoreId;

                            string scoresPath = "ScoreInfo/SemesterSubjectScoreInfo/Subject";
                            foreach (XmlElement eachScore in eachStudent.SelectNodes(scoresPath))
                            {
                                SemsSubjectScore objScore = new SemsSubjectScore(eachScore);
                                if (!student.SemsSubjects.AddSubject(objScore))
                                {
                                    LogDuplicateSubject(progress, student, objScore);
                                }
                            }
                        }
                    }

                    progress.ReportProgress((int)(((float)offset / packages.Count) * 100));
                    offset++;
                }

                progress.ReportProgress(100);
                Utility.EndTime("GetSemsSubject");
                return(true);
            }
            catch (Exception ex)
            {
                progress.ReportException(ex);
                return(false);
            }
        }
            public void CreateRatingItem(SemsSubjectScore eachScore, ResultPlace eachPlace)
            {
                if (_has_data == false)
                {
                    _data.CreateStartElement("Rating");
                    _data.CreateAttribute("範圍人數", eachPlace.RatingBase.ToString());
                }

                _has_data = true;

                _data.CreateStartElement("Item");
                _data.CreateAttribute("科目", eachScore.SubjectName);
                _data.CreateAttribute("科目級別", eachScore.Level);
                _data.CreateAttribute("成績", eachScore.Score.ToString());
                _data.CreateAttribute("排名", eachPlace.Place.ToString());
                _data.CreateAttribute("成績人數", eachPlace.ActualBase.ToString());
                _data.CreateEndElement();
            }
        private static void LogDuplicateSubject(IProgressUI progressUI, RankStudent student, SemsSubjectScore objScore)
        {
            string msg = "學生「{0}(編號:{1})」的科目成績「{2}」重覆 (學期)。";

            //progressUI.LogMessage(string.Format(msg, student.Name, student.Identity, objScore.ScoreName));
        }