Browse Source

不使用账号判断是否使用MES,而是使用原本的配置项来启动。

JeffWang 3 years ago
parent
commit
34bb2fc1f1
1 changed files with 4 additions and 1 deletions
  1. 4 1
      FactoryTool_CShare/Views/Login.cs

+ 4 - 1
FactoryTool_CShare/Views/Login.cs

@@ -28,6 +28,8 @@ namespace MOKA_Factory_Tools
             factorynum = ""
         };
 
+        public bool ExportSNACASID { get; set; } = false;
+
         string ErrorDBPath = AppDomain.CurrentDomain.BaseDirectory + "\\Error.db";
         SQLiteConnection ErrorDB = null;
         public login()
@@ -173,7 +175,7 @@ namespace MOKA_Factory_Tools
             }
 
             #region 三华MES登录数据
-            if ( string.Equals(AccountText.Text,"sanhua", StringComparison.OrdinalIgnoreCase) )
+            if (ExportSNACASID)
             {
                 SanhuaMES sanhuaMES = new SanhuaMES();
                 if ( sanhuaMES.ShowDialog() != DialogResult.OK )
@@ -256,6 +258,7 @@ namespace MOKA_Factory_Tools
                 {
                     JObject jObject = (JObject)JToken.ReadFrom(reader);
                     reader.Close();
+                    ExportSNACASID = jObject["ExportSNACASID"] == null ? false : jObject["ExportSNACASID"].Value<bool>();
                     AccountText.Text = jObject["FactoryName"] == null ? (!CommonMethod.AddJsonConfig("FactoryName", null) ? "" : "") : jObject["FactoryName"].Value<string>();
                     loginOutput1.factoryname = jObject["FactoryName"] == null ? "" : jObject["FactoryName"].Value<string>();
                     loginOutput1.factorynum=jObject["FactoryNum"] == null ? "" : jObject["FactoryNum"].Value<string>();