Exemplo n.º 1
0
        private void ProcessDailyLifeRecommend()
        {
            _builder.MoveToMergeField("綜合評語");
            _cell = _builder.CurrentParagraph.ParentNode as Cell;

            TextScoreItemRow itemRow = new TextScoreItemRow("");

            foreach (AutoSummaryRecord asRecord in _list)
            {
                if (asRecord.MoralScore == null)
                {
                    continue;
                }
                JHMoralScoreRecord record   = asRecord.MoralScore;
                SemesterData       semester = new SemesterData("" + record.SchoolYear, "" + record.Semester);

                XmlElement textscore = record.TextScore;
                if (textscore != null)
                {
                    XmlElement item = (XmlElement)textscore.SelectSingleNode("DailyLifeRecommend");
                    if (item != null)
                    {
                        itemRow.Add(semester, item.GetAttribute("Description"));
                    }
                }
            }

            WriteTextScoreItemRow(_cell, itemRow);
        }
Exemplo n.º 2
0
        private void WriteTextScoreItemRow(Cell cell, TextScoreItemRow itemRow)
        {
            //Write(cell, itemRow.Name);
            Row row   = cell.ParentRow;
            int shift = row.IndexOf(cell);

            foreach (SemesterData sems in itemRow.Items.Keys)
            {
                string text  = itemRow.Items[sems];
                int    index = -1;
                if (_map.SemesterMapping.ContainsKey(sems))
                {
                    index = _map.SemesterMapping[sems];
                }

                if (index < 0)
                {
                    continue;
                }

                index = index + shift;
                Write(row.Cells[index], text);
            }
        }