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); }
public void UpdateImportData(XmlElement data) { TeacherBulkProcess.UpdateImportTeacher(data); }
public void InsertImportData(XmlElement data) { TeacherBulkProcess.InsertImportTeacher(data); }
public XmlElement GetShiftCheckList(params string[] fieldNameList) { return(TeacherBulkProcess.GetShiftCheckList(fieldNameList)); }
public XmlElement GetUniqueFieldData() { return(TeacherBulkProcess.GetUniqueFieldData()); }
public XmlElement GetValidateFieldRule() { return(TeacherBulkProcess.GetFieldValidationRule()); }
public XmlElement GetImportFieldList() { return(TeacherBulkProcess.GetImportFieldList()); }