Merge branch 'master' of github.com:KJD2025/KJD
This commit is contained in:
commit
d656ef270c
1 file changed
+16
-2
@@ -1205,7 +1205,7 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
bool isCollectAuthorityUser = true;
|
bool isCollectAuthorityUser = true;
|
||||||
Get1688ProductForm.Out1688ProductImport(isCollectAuthorityUser, this.statusBar, this.pbLoading, OutProdSaveDbCallBack);
|
Get1688ProductForm.Out1688ProductImport(isCollectAuthorityUser, this.statusBar, this.pbLoading, OutProdSaveDbCallBack);
|
||||||
}
|
}
|
||||||
private void bt_import_wx_Click(object sender, EventArgs e)
|
private async void bt_import_wx_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||||
openFileDialog.Multiselect = true;
|
openFileDialog.Multiselect = true;
|
||||||
@@ -1214,11 +1214,16 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
// 显示对话框并获取结果
|
// 显示对话框并获取结果
|
||||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
btn_import_wx.Enabled = false;
|
||||||
var filePathLst = openFileDialog.FileNames.ToList();
|
var filePathLst = openFileDialog.FileNames.ToList();
|
||||||
int successNum = 0;
|
int successNum = 0;
|
||||||
int failedNum = 0;
|
int failedNum = 0;
|
||||||
var pddtoWxFactory = new PDDProdFormConverter();
|
var pddtoWxFactory = new PDDProdFormConverter();
|
||||||
|
|
||||||
|
await Task.Run(() =>
|
||||||
|
{
|
||||||
foreach (var filePath in filePathLst)
|
foreach (var filePath in filePathLst)
|
||||||
{
|
{
|
||||||
string sourceContent = "";
|
string sourceContent = "";
|
||||||
@@ -1244,15 +1249,24 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
this.statusBar.lblTaskStatus.Text = "正在导入,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
|
this.statusBar.lblTaskStatus.Text = "正在导入,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
SearchDbProd(1, " 导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum);
|
SearchDbProd(1, " 导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum);
|
||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
|
btn_import_wx.Enabled = true;
|
||||||
pbLoading.Visible = false;
|
pbLoading.Visible = false;
|
||||||
this.statusBar.lblTaskStatus.Text = "导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
|
this.statusBar.lblTaskStatus.Text = "导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
|
||||||
BaseMsgForm.ShowInfo("导入完成!");
|
BaseMsgForm.ShowInfo("导入完成!");
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
btn_import_wx.Enabled = true;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user