SVN-Revision: r630
This commit is contained in:
wyf
2025-05-23 01:58:10 +00:00
parent 22d4f34cbb
commit 21106d7420
+58 -4
View File
@@ -253,9 +253,12 @@ namespace Lskj.PubBomImport
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
Close(); Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
} }
/// <summary> /// <summary>
@@ -779,18 +782,27 @@ namespace Lskj.PubBomImport
//BaseImpl.ExecSqlValue($"update p_bomImportExecTab set afterSql = '{insertbulider.ToString().Replace("'", "''")}' where guid = '{guid}'"); //BaseImpl.ExecSqlValue($"update p_bomImportExecTab set afterSql = '{insertbulider.ToString().Replace("'", "''")}' where guid = '{guid}'");
} }
} }
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
}));
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
}));
BaseImpl.ExecSqlValue($"delete QMS_wenjiangenggaitab where qms_wjgg_billdocument_Id = '{primaryValue}'"); BaseImpl.ExecSqlValue($"delete QMS_wenjiangenggaitab where qms_wjgg_billdocument_Id = '{primaryValue}'");
} }
finally finally
{
this.Invoke(new Action(() =>
{ {
this.Close(); this.Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
}); });
task.Start(); task.Start();
@@ -801,10 +813,13 @@ namespace Lskj.PubBomImport
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.DialogResult = DialogResult.Cancel;
BaseImpl.ExecSqlValue($"delete QMS_wenjiangenggaitab where qms_wjgg_billdocument_Id = '{primaryValue}'"); BaseImpl.ExecSqlValue($"delete QMS_wenjiangenggaitab where qms_wjgg_billdocument_Id = '{primaryValue}'");
Close(); this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel;
this.Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
} }
/// <summary> /// <summary>
@@ -1377,9 +1392,12 @@ namespace Lskj.PubBomImport
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
Close(); Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
} }
/// <summary> /// <summary>
@@ -1478,17 +1496,26 @@ namespace Lskj.PubBomImport
} }
SetProcessBar(100, 100); SetProcessBar(100, 100);
SetProcessLabelAllMsg($"总进度:1/1"); SetProcessLabelAllMsg($"总进度:1/1");
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
}));
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
}));
} }
finally finally
{
this.Invoke(new Action(() =>
{ {
this.Close(); this.Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
}); });
task.Start(); task.Start();
@@ -1496,9 +1523,12 @@ namespace Lskj.PubBomImport
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
Close(); Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
} }
/// <summary> /// <summary>
@@ -1576,17 +1606,26 @@ namespace Lskj.PubBomImport
SetProcessBar(100, finishCount); SetProcessBar(100, finishCount);
SetProcessLabelAllMsg($"总进度:{nowCount + 1}/{sourceTable.Rows.Count + 1}"); SetProcessLabelAllMsg($"总进度:{nowCount + 1}/{sourceTable.Rows.Count + 1}");
} }
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
}));
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
}));
} }
finally finally
{
this.Invoke(new Action(() =>
{ {
this.Close(); this.Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
}); });
task.Start(); task.Start();
@@ -1594,9 +1633,12 @@ namespace Lskj.PubBomImport
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
Close(); Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
} }
/// <summary> /// <summary>
@@ -1673,17 +1715,26 @@ namespace Lskj.PubBomImport
SetProcessBar(100, finishCount); SetProcessBar(100, finishCount);
SetProcessLabelAllMsg($"总进度:{nowCount + 1}/{sourceTable.Rows.Count + 1}"); SetProcessLabelAllMsg($"总进度:{nowCount + 1}/{sourceTable.Rows.Count + 1}");
} }
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
}));
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
}));
} }
finally finally
{
this.Invoke(new Action(() =>
{ {
this.Close(); this.Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
}); });
task.Start(); task.Start();
@@ -1691,9 +1742,12 @@ namespace Lskj.PubBomImport
catch (Exception ex) catch (Exception ex)
{ {
MessageUtil.Show(ex.Message); MessageUtil.Show(ex.Message);
this.Invoke(new Action(() =>
{
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
Close(); Close();
ImportTimer?.Dispose(); ImportTimer?.Dispose();
}));
} }
} }
/// <summary> /// <summary>
@@ -1974,7 +2028,7 @@ namespace Lskj.PubBomImport
speciesno = "010101"; speciesno = "010101";
} }
//上传文件到服务器目录 //上传文件到服务器目录
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&speciesno={8}&folder={3}&totsize={4}&position={5}&filename={6}&method={7}"; postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&speciesno={8}&folder={3}&totsize={4}&position={5}&filename={6}&method={7}&confirm=1";
if (!string.IsNullOrEmpty(idValue)) if (!string.IsNullOrEmpty(idValue))
{ {
string token = ""; string token = "";
@@ -2100,7 +2154,7 @@ namespace Lskj.PubBomImport
code = namematch.Groups[1].Value; code = namematch.Groups[1].Value;
} }
//上传文件到服务器目录 //上传文件到服务器目录
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&speciesno={8}&folder={3}&totsize={4}&position={5}&filename={6}&method={7}"; postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&speciesno={8}&folder={3}&totsize={4}&position={5}&filename={6}&method={7}&confirm=1";
if (!string.IsNullOrEmpty(idValue)) if (!string.IsNullOrEmpty(idValue))
{ {
string token = ""; string token = "";