SVN-Revision: r351
This commit is contained in:
wyf
2025-03-19 07:46:24 +00:00
parent 31518c8807
commit f90fe00801
+19 -5
View File
@@ -815,6 +815,17 @@ namespace Lskj.PubSpecialImport
DataTable columnsTable = gcMain.gridControl.DataSourceTable(); DataTable columnsTable = gcMain.gridControl.DataSourceTable();
DataTable table = gridView.GridControl.DataSourceTable(); DataTable table = gridView.GridControl.DataSourceTable();
DataTable sourceDataTable = ExcelToDatatable(fileName, Model.SheetName, FirstRowIndex); DataTable sourceDataTable = ExcelToDatatable(fileName, Model.SheetName, FirstRowIndex);
DataView filterDataView = new DataView(sourceDataTable);
try
{
if (!string.IsNullOrEmpty(Model.ReadTableCond))
{
filterDataView.RowFilter = Model.ReadTableCond;
}
}
catch (Exception)
{
}
List<DataRow> dataRows = columnsTable.Rows.Cast<DataRow>().Where(n => !string.IsNullOrEmpty(n["excelFieldName"] + "") && !string.IsNullOrEmpty(n["clientFieldName"] + "")).ToList(); List<DataRow> dataRows = columnsTable.Rows.Cast<DataRow>().Where(n => !string.IsNullOrEmpty(n["excelFieldName"] + "") && !string.IsNullOrEmpty(n["clientFieldName"] + "")).ToList();
int index = gridView is BandedGridView ? FirstRowIndex + 1 : FirstRowIndex; int index = gridView is BandedGridView ? FirstRowIndex + 1 : FirstRowIndex;
isBillImport = index == FirstRowIndex ? true : isBillImport; isBillImport = index == FirstRowIndex ? true : isBillImport;
@@ -909,7 +920,7 @@ namespace Lskj.PubSpecialImport
ToAssignment = true; ToAssignment = true;
CurrentRow = i; CurrentRow = i;
DataRow rowSource = sourceDataTable.Rows[i - startRow]; DataRow rowSource = sourceDataTable.Rows[i - startRow];
if (!ValidateCond(condTxtEdit.Text, rowSource)) if (!filterDataView.Cast<DataRowView>().Any(rowView => rowView.Row == rowSource) || !ValidateCond(condTxtEdit.Text, rowSource))
{ {
continue; continue;
} }
@@ -980,11 +991,9 @@ namespace Lskj.PubSpecialImport
GridColumnModel model = col.Tag as GridColumnModel; GridColumnModel model = col.Tag as GridColumnModel;
if (cell != null) if (cell != null)
{ {
if (cell.CellType == CellType.Blank) try
{ {
continue; if (cell.CellType == CellType.Blank)
}
if (cell.CellType == CellType.Formula)
{ {
continue; continue;
} }
@@ -1154,6 +1163,11 @@ namespace Lskj.PubSpecialImport
} }
} }
} }
catch (Exception)
{
throw;
}
}
} }
if (!string.IsNullOrEmpty(specialFieldName) && dataRow.Table.Columns.Contains(specialFieldName)) if (!string.IsNullOrEmpty(specialFieldName) && dataRow.Table.Columns.Contains(specialFieldName))
{ {