Browse Source

去除SN空格。

JeffWang 2 years ago
parent
commit
425f59108f

+ 2 - 0
FactoryTool_CShare/Business/GMethod.cs

@@ -503,6 +503,8 @@ namespace MOKA_Factory_Tools
                     Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "Kayla");
                 }
                 string savefile = string.Format("{0}Kayla\\{1}.csv", AppDomain.CurrentDomain.BaseDirectory, sn);
+                Log.WriteInfoLog(string.Format("Kayla: sn={0}, savefile={1}", sn, savefile));
+
                 using (System.IO.StreamWriter file = new System.IO.StreamWriter(savefile, false))
                 {
                     foreach (KeyValuePair<string, string> kvp in dic)

+ 6 - 1
FactoryTool_CShare/Views/OperationPanel.cs

@@ -769,6 +769,11 @@ namespace MOKA_Factory_Tools
                 SNKeyDownEven(this.Handle);
                 SetInitialStatus();
                 SN = SNText.Text;
+                Log.WriteInfoLog(string.Format("Input SN={0}", SN));
+                #region 去除SN空格;
+                SN = SN.Trim();
+                Log.WriteInfoLog(string.Format("After Trim SN={0}", SN));
+                #endregion
                 SNText.Enabled = false;
                 if (FunctionSettingNow.BarcodeLimit)
                 {
@@ -866,7 +871,7 @@ namespace MOKA_Factory_Tools
                 if (preloadNow)
                 {
                     bool copydone = false;
-                    string keyjson = SQLiteHelper.Getkeys(localDBNow, SNText.Text.Trim(), out copydone);
+                    string keyjson = SQLiteHelper.Getkeys(localDBNow, SN, out copydone);
                     if (FunctionSettingNow.NoDoublewrite && copydone)
                     {
                         MessageBox.Show(LResource.FindcopiedSN + SN);