public ExportTable Export()
        {
            // 取得匯出規則描述
            XmlElement        descElement      = TeacherBulkProcess.GetExportDescription();
            IFieldFormater    fieldFormater    = new BaseFieldFormater();
            IResponseFormater responseFormater = new ResponseFormater();

            FieldCollection       fieldCollection = fieldFormater.Format(descElement);
            ExportFieldCollection exportFields    = responseFormater.Format(descElement);

            fieldCollection = FieldUtil.Match(fieldCollection, _selectFields);
            exportFields    = FieldUtil.Match(exportFields, _selectFields);

            IRequestGenerator reqGenerator = new ExportStudentRequestGenerator();

            reqGenerator.SetSelectedFields(_selectFields);

            ICondition condition = new BaseCondition("ID", "-1");

            reqGenerator.AddCondition(condition);
            foreach (string id in _conditions)
            {
                ICondition condition2 = new BaseCondition("ID", id);
                reqGenerator.AddCondition(condition2);
            }

            DSRequest  request  = reqGenerator.Generate();
            DSResponse response = TeacherBulkProcess.GetExportList(request);

            ExportTable table = new ExportTable();

            foreach (ExportField field in exportFields)
            {
                table.AddColumn(field);
            }

            foreach (XmlElement record in response.GetContent().GetElements("Teacher"))
            {
                ExportRow row = table.AddRow();
                foreach (ExportField column in table.Columns)
                {
                    int        columnIndex = column.ColumnIndex;
                    ExportCell cell        = row.Cells[columnIndex];
                    XmlNode    cellNode    = record.SelectSingleNode(column.XPath);
                    if (cellNode != null)
                    {
                        cell.Value = cellNode.InnerText;
                    }
                }
            }
            return(table);
        }
示例#2
0
 public void UpdateImportData(XmlElement data)
 {
     TeacherBulkProcess.UpdateImportTeacher(data);
 }
示例#3
0
 public void InsertImportData(XmlElement data)
 {
     TeacherBulkProcess.InsertImportTeacher(data);
 }
示例#4
0
 public XmlElement GetShiftCheckList(params string[] fieldNameList)
 {
     return(TeacherBulkProcess.GetShiftCheckList(fieldNameList));
 }
示例#5
0
 public XmlElement GetUniqueFieldData()
 {
     return(TeacherBulkProcess.GetUniqueFieldData());
 }
示例#6
0
 public XmlElement GetValidateFieldRule()
 {
     return(TeacherBulkProcess.GetFieldValidationRule());
 }
示例#7
0
 public XmlElement GetImportFieldList()
 {
     return(TeacherBulkProcess.GetImportFieldList());
 }