Example #1
0
        public ExportDataResults ExportQueryOutput(ExportQueryList exportQueryList, ExportFileOptions exportFileOptions)
        {
            ExportDataResults exportResults = new ExportDataResults(exportQueryList.Count);
            ExportDataResult  exportOutcome = null;

            foreach (var e in exportQueryList)
            {
                exportOutcome = new ExportDataResult(e, null);
                try
                {
                    exportOutcome = ExportSingleQueryOutput(e, exportFileOptions);
                }
                catch (Exception ex)
                {
                    exportOutcome.ExportError = ex;
                }
                exportResults.Add(exportOutcome);
            }
            return(exportResults);
        }
Example #2
0
        public ExportDataResult ExportSingleTable(ExportTable export, ExportFileOptions exportFileOptions)
        {
            ExportDataResult exportResult = new ExportDataResult(export, null);

            // Log that validation has passed
            ExportDataTable _ExportDataTable = new ExportDataTable();

            _ExportDataTable.Table = SQLHelper.ExecuteDataTable(this.SQLConnectionString, export.SQLCommandText, out Exception outEx);

            exportResult.ExportError = outEx;
            // throw exception if we got one from SQL layer
            if (outEx == null)
            {
                // create a file and export it
                exportResult.ExportedFiles = CreateFiles(_ExportDataTable, export, exportFileOptions);
            }

            //ExportFileInfoList exportFileInfoList = new ExportFileInfoList(this.StagingUri, totalRows, export, exportFileOptions);
            return(exportResult);
        }