SVN-Revision: r469
This commit is contained in:
wyf
2025-04-10 02:56:37 +00:00
parent 62a5bc8f66
commit ed3970aba7
2 changed files with 66 additions and 36 deletions
+55 -23
View File
@@ -186,33 +186,65 @@ namespace Lskj.PubBomImport
}
else if (Model.ShowType.Equals("3"))
{
DataTable sourceTable = StaticControl.RightMenuGridView.GridControl.DataSourceTable();
if (StaticControl.RightMenuGridView.Tag is Dictionary<string, string> filesDic)
BomImpRtnModel bomImpRtnModel = new BomImpRtnModel()
{
FrmProgress frmProgress = new FrmProgress();
frmProgress.frmMain = this;
frmProgress.Model = Model;
frmProgress.ImportTimer.Tick += (ts, te) =>
ShowType = Model.ShowType,
AfterBomFieldName = Model.AfterBomFieldName,
CanSave = true
};
FormDialogModel dialogModel = new FormDialogModel()
{
DialogDllName = "Lskj.PubBomImport.dll",
PubDialogType = DialogType.PubAddRecord,
ReturnTag = bomImpRtnModel
};
this.Tag = dialogModel;
if (StaticControl.RightMenuGridView.Tag is Dictionary<DataRow, string> filesDic)
{
DataTable sourceTable = StaticControl.RightMenuGridView.GridControl.DataSourceTable();
List<DataRow> selectRows = new List<DataRow>();
foreach (DataRow sourceRow in sourceTable.Rows)
{
frmProgress.ImportTimer.Enabled = false;
frmProgress.StartImportInQDFile(sourceTable, filesDic);
};
frmProgress.ImportTimer.Enabled = true;
DialogResult dialogResult = frmProgress.ShowDialog();
BomImpRtnModel bomImpRtnModel = new BomImpRtnModel()
if (sourceRow.RowState == DataRowState.Deleted)
{
continue;
}
string fileName = sourceRow[Model.AfterBomFieldName] + "";
string dirPath = filesDic.ContainsKey(sourceRow) ? filesDic[sourceRow] : "";
FileInfo parentInfo = null;
if (string.IsNullOrEmpty(dirPath))
{
continue;
}
parentInfo = new FileInfo(dirPath);
if (parentInfo != null && (parentInfo.Name.Trim().StartsWith("QD") || parentInfo.Name.Trim().StartsWith("ZZQD")))
{
selectRows.Add(sourceRow);
}
}
if (selectRows.Count > 0)
{
ShowType = Model.ShowType,
AfterBomFieldName = Model.AfterBomFieldName,
CanSave = dialogResult == DialogResult.OK
};
FormDialogModel dialogModel = new FormDialogModel()
FrmProgress frmProgress = new FrmProgress();
frmProgress.frmMain = this;
frmProgress.Model = Model;
frmProgress.ImportTimer.Tick += (ts, te) =>
{
frmProgress.ImportTimer.Enabled = false;
frmProgress.StartImportInQDFile(selectRows, filesDic);
};
frmProgress.ImportTimer.Enabled = true;
DialogResult dialogResult = frmProgress.ShowDialog();
bomImpRtnModel.CanSave = dialogResult == DialogResult.OK;
frmProgress.Dispose();
}
else
{
DialogDllName = "Lskj.PubBomImport.dll",
PubDialogType = DialogType.PubAddRecord,
ReturnTag = bomImpRtnModel
};
this.Tag = dialogModel;
frmProgress.Dispose();
this.Close();
}
}
else
{
this.Close();
}
}
}