1选品数据库及库存上传相关功能 2修复部分商品详情信息特殊符号导致无法上传问题

This commit is contained in:
wule committed 2025-07-24 15:40:39 +08:00
1 parent adf75f9fc1
commit 281cf2e338
38 files changed
+1496 -440

No files matched your search

+39 -9
View File
@@ -104,26 +104,56 @@ namespace Update
Thread.Sleep(10);
}
string error = "";
// 替换旧文件
foreach (string filePath in Directory.GetFiles(upTempPath))
{
string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
File.Copy(upTempPath + "\\" + fileName, mainPath + "\\" + fileName, true);
Thread.Sleep(10);
if (!string.IsNullOrEmpty(error))
break;
try
{
string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
File.Copy(upTempPath + "\\" + fileName, mainPath + "\\" + fileName, true);
Thread.Sleep(10);
}
catch (Exception ex)
{
error = "发生错误:\r\n" + ex.Message + "\r\n请关闭升级窗口重试!";
Invoke(new Action(() =>
{
lblMessage.Text = error;
}));
}
}
foreach (string dirPath in Directory.GetDirectories(upTempPath))
{
string fileName = dirPath.Substring(dirPath.LastIndexOf("\\") + 1);
CopyDirectory(upTempPath + "\\" + fileName, mainPath + "\\" + fileName);
Thread.Sleep(10);
if (!string.IsNullOrEmpty(error))
break;
try
{
string fileName = dirPath.Substring(dirPath.LastIndexOf("\\") + 1);
CopyDirectory(upTempPath + "\\" + fileName, mainPath + "\\" + fileName);
Thread.Sleep(10);
}
catch (Exception ex)
{
error = "发生错误:\r\n" + ex.Message + "\r\n请关闭升级窗口重试!";
Invoke(new Action(() =>
{
lblMessage.Text = error;
}));
}
}
Thread.Sleep(50);
Invoke(new Action(() =>
{
progressBar1.Value = 100;
lblMessage.Text = "升级完成,点击确定重启程序";
btnOk.Enabled = true;
if (string.IsNullOrEmpty(error))
{
progressBar1.Value = 100;
lblMessage.Text = "升级完成,点击确定重启程序";
btnOk.Enabled = true;
}
}));
}
else
+20 -12
View File
@@ -43,22 +43,25 @@ namespace Update
//
// lblMessage
//
this.lblMessage.Location = new System.Drawing.Point(14, 8);
this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblMessage.Location = new System.Drawing.Point(14, 33);
this.lblMessage.Name = "lblMessage";
this.lblMessage.Size = new System.Drawing.Size(224, 69);
this.lblMessage.Size = new System.Drawing.Size(327, 98);
this.lblMessage.TabIndex = 0;
this.lblMessage.Text = "发现新版本,即将为您升级!";
this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// btnOk
//
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnOk.BackColor = System.Drawing.Color.Blue;
this.btnOk.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnOk.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOk.Font = new System.Drawing.Font("微软雅黑", 11F);
this.btnOk.ForeColor = System.Drawing.Color.White;
this.btnOk.Location = new System.Drawing.Point(129, 127);
this.btnOk.Location = new System.Drawing.Point(232, 177);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(109, 30);
this.btnOk.TabIndex = 9;
@@ -74,7 +77,7 @@ namespace Update
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 11F);
this.btnCancel.ForeColor = System.Drawing.Color.Blue;
this.btnCancel.Location = new System.Drawing.Point(14, 127);
this.btnCancel.Location = new System.Drawing.Point(14, 177);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(109, 30);
this.btnCancel.TabIndex = 10;
@@ -89,9 +92,9 @@ namespace Update
this.panel1.BackColor = System.Drawing.Color.Blue;
this.panel1.Controls.Add(this.btnClose);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Location = new System.Drawing.Point(2, 2);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(256, 24);
this.panel1.Size = new System.Drawing.Size(355, 24);
this.panel1.TabIndex = 11;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
@@ -99,12 +102,13 @@ namespace Update
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClose.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClose.Font = new System.Drawing.Font("微软雅黑", 11F);
this.btnClose.ForeColor = System.Drawing.Color.White;
this.btnClose.Location = new System.Drawing.Point(238, -5);
this.btnClose.Location = new System.Drawing.Point(339, -5);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(17, 28);
this.btnClose.TabIndex = 11;
@@ -120,16 +124,19 @@ namespace Update
this.panel2.Controls.Add(this.lblMessage);
this.panel2.Controls.Add(this.btnOk);
this.panel2.Controls.Add(this.btnCancel);
this.panel2.Location = new System.Drawing.Point(2, 24);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(2, 2);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(252, 170);
this.panel2.Size = new System.Drawing.Size(355, 221);
this.panel2.TabIndex = 12;
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(14, 85);
this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBar1.Location = new System.Drawing.Point(14, 139);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(224, 23);
this.progressBar1.Size = new System.Drawing.Size(327, 23);
this.progressBar1.TabIndex = 11;
this.progressBar1.Visible = false;
//
@@ -137,13 +144,14 @@ namespace Update
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
this.ClientSize = new System.Drawing.Size(256, 196);
this.ClientSize = new System.Drawing.Size(359, 225);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.Font = new System.Drawing.Font("微软雅黑", 10F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Padding = new System.Windows.Forms.Padding(2);
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MessageForm";
this.Paint += new System.Windows.Forms.PaintEventHandler(this.MessageForm_Paint);