Exemplo n.º 1
0
        public IntelliFlowItemOutput Execute(ExportDataToFileIntelliFlowAction action)
        {
            var paramArray = action.Input.Parameters.ToArray();
            var fileType   = (FileType)paramArray[0].GetValue(action.Input.Data);
            var exporter   = DataTableFileFactory.CreateExporter(fileType);

            action.Output.Data = exporter.Export((DataTable)action.Input.Data);
            return(_ExecuteChildren(action));
        }
Exemplo n.º 2
0
        public IntelliFlowItemOutput Execute(ImportDataFromFileIntelliFlowAction action)
        {
            var paramArray = action.Input.Parameters.ToArray();
            var fileType   = (FileType)paramArray[0].GetValue(action.Input.Data);
            var filePath   = (string)paramArray[1].GetValue(action.Input.Data);
            var stream     = new FileStream(filePath, FileMode.Open, FileAccess.Read);
            var importer   = DataTableFileFactory.CreateImporter(fileType);

            action.Output.Data = importer.Import((DataTable)action.Input.Data, stream);
            return(_ExecuteChildren(action));
        }