SVN-Revision: r403
This commit is contained in:
wyf
2025-03-26 11:34:40 +00:00
parent a14d20e387
commit 93e9320282
+23 -23
View File
@@ -67,29 +67,6 @@ namespace Lskj.PubBomImport
FrmBillInfo frmBillInfo = new FrmBillInfo(); FrmBillInfo frmBillInfo = new FrmBillInfo();
DataTable parentTable = ExcelToDatatable(parentInfo.FullName, Model, "", 5); DataTable parentTable = ExcelToDatatable(parentInfo.FullName, Model, "", 5);
parentTable = parentTable.Rows.Cast<DataRow>().Where(n => int.TryParse(n["序号"] + "", out _) && !string.IsNullOrEmpty(n["图号"] + "")).ToList().CopyToDataTable(); parentTable = parentTable.Rows.Cast<DataRow>().Where(n => int.TryParse(n["序号"] + "", out _) && !string.IsNullOrEmpty(n["图号"] + "")).ToList().CopyToDataTable();
DataTable childTable = new DataTable();
foreach (GridColumn gridColumn in frmBillInfo.GcMainView.Columns)
{
if (!childTable.Columns.Contains(gridColumn.FieldName))
{
childTable.Columns.Add(gridColumn.FieldName, gridColumn.ColumnType);
}
}
foreach (DataRow parentRow in parentTable.Rows)
{
string code = parentRow["图号"] + "";
FileInfo childInfo = fileInfos.Where(n => n.Name.StartsWith(code)).FirstOrDefault();
if (childInfo != null && (childInfo.Name.StartsWith("QD") || childInfo.Name.StartsWith("ZZQD")))
{
DataRow childRow = childTable.NewRow();
childRow["ProductId"] = parentRow["图号"] + "";
childRow["appellation"] = parentRow["名称"] + "";
childRow["bak"] = parentRow["备注"] + "";
childRow["tamount"] = parentRow["套数"] + "";
childRow["amount"] = parentRow["套数"] + "";
childTable.Rows.Add(childRow);
}
}
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
foreach (DataRow dataRow in parentTable.Rows) foreach (DataRow dataRow in parentTable.Rows)
{ {
@@ -112,6 +89,29 @@ namespace Lskj.PubBomImport
{ {
SetProcessBar(0, 0); SetProcessBar(0, 0);
SetProcessMsg($"正在导入:{Path.GetFileName(parentInfo.FullName)}"); SetProcessMsg($"正在导入:{Path.GetFileName(parentInfo.FullName)}");
DataTable childTable = new DataTable();
foreach (GridColumn gridColumn in frmBillInfo.GcMainView.Columns)
{
if (!childTable.Columns.Contains(gridColumn.FieldName))
{
childTable.Columns.Add(gridColumn.FieldName, gridColumn.ColumnType);
}
}
foreach (DataRow parentRow in parentTable.Rows)
{
string code = parentRow["图号"] + "";
FileInfo childInfo = fileInfos.Where(n => n.Name.StartsWith(code)).FirstOrDefault();
if (childInfo != null && (childInfo.Name.StartsWith("QD") || childInfo.Name.StartsWith("ZZQD")))
{
DataRow childRow = childTable.NewRow();
childRow["ProductId"] = parentRow["图号"] + "";
childRow["appellation"] = parentRow["名称"] + "";
childRow["bak"] = parentRow["备注"] + "";
childRow["tamount"] = parentRow["套数"] + "";
childRow["amount"] = parentRow["套数"] + "";
childTable.Rows.Add(childRow);
}
}
SetProcessBar(20, 0); SetProcessBar(20, 0);
frmBillInfo.GcMainView.GridControl.DataSource = childTable; frmBillInfo.GcMainView.GridControl.DataSource = childTable;
SetProcessBar(40, 0); SetProcessBar(40, 0);