public void Add(JHSemesterScoreRecord record) { foreach (K12.Data.DomainScore domain in record.Domains.Values) { //if (!_config.ContainsKey(domain.Domain)) continue; if (!_domains.ContainsKey(domain.Domain)) { _domains.Add(domain.Domain, new DomainRow(domain.Domain)); } DomainRow row = _domains[domain.Domain]; row.Add(new SemesterData("" + record.SchoolYear, "" + record.Semester), domain); } foreach (K12.Data.SubjectScore subject in record.Subjects.Values) { //if (!_config.ContainsKey(subject.Domain)) continue; //if (_type == "Domain") //{ // if (!_config[subject.Domain].Contains(subject.Subject)) continue; //} if (!_domains.ContainsKey(subject.Domain)) { _domains.Add(subject.Domain, new DomainRow(subject.Domain)); } DomainRow row = _domains[subject.Domain]; row.Add(new SemesterData("" + record.SchoolYear, "" + record.Semester), subject); } }
private void WriteDomain(Cell cell, DomainRow domain) { Row row = cell.ParentRow; int shift = row.IndexOf(cell) + 1; int fields = 3; foreach (SemesterData sems in domain.Scores.Keys) { ScoreData data = domain.Scores[sems]; int index = -1; if (_map.SemesterMapping.ContainsKey(sems)) { index = _map.SemesterMapping[sems]; } if (index < 0) { continue; } index = index * fields + shift; WordHelper.Write(row.Cells[index], GetPeriodCredit(data.GetPeriodCredit()), _builder); WordHelper.Write(row.Cells[index + 1], data.Score, _builder); WordHelper.Write(row.Cells[index + 2], GetDegree(data.Score), _builder); } }