From 32e94daf3ff4a5a8872830fd103de4ce1eb0c4d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Thu, 11 Jan 2024 11:06:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControlAction.cs | 10 +++----- .../Util/UserJudge.cs | 25 ++++++++++--------- Main/MCRun/App.config | 2 +- Main/MCRun/Program.cs | 12 ++++----- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index c6e99de..7c60f54 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -286,16 +286,13 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl try { - - if (UserJudge.IsNormalUser()) + if (UserJudge.IsSettingNormalUser) { ReportReadDb.ReadReport(); ReportReadDb.ReadFeededDry(); } - - } catch (Exception) { @@ -320,11 +317,12 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl } + var reachSingle = RgvPlcUtil.GetRGVAllError(); var mixSingle = Db3000Helper.ReadDb(); - - if (UserJudge.IsNormalUser()) + if (UserJudge.IsSettingNormalUser) { + RGVRecord(reachSingle, mixSingle); } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs index ffe8efe..2689cb0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs @@ -28,29 +28,30 @@ namespace Mesnac.Action.ChemicalWeighing.Util } } - /// - /// 判断是否为超级用户 - /// - /// true为普通Run环境用户,false为超级用户 - public static bool IsNormalUser() - { - return !IsEdit(); - } + public static bool IsSettingNormalUser { get { - var settingUser= ConfigurationManager.AppSettings["IsNormalUser"]; + try + { + var settingUser = ConfigurationManager.AppSettings["IsDaPing"]; + + if (string.IsNullOrEmpty(settingUser)) + { + return false; + } - if(string.IsNullOrEmpty(settingUser) ) + return Convert.ToBoolean(settingUser); + } + catch (Exception) { + return false; } - return Convert.ToBoolean(settingUser); - } } } diff --git a/Main/MCRun/App.config b/Main/MCRun/App.config index 0f0dafe..445edf0 100644 --- a/Main/MCRun/App.config +++ b/Main/MCRun/App.config @@ -5,7 +5,7 @@ - + diff --git a/Main/MCRun/Program.cs b/Main/MCRun/Program.cs index a923766..1e4ad01 100644 --- a/Main/MCRun/Program.cs +++ b/Main/MCRun/Program.cs @@ -25,12 +25,12 @@ namespace MCRun - if (Mesnac.Basic.ProcessHelper.HaveRunningInstance()) - { - Mesnac.Basic.MessageBoxTimeOut.Show("The application is running, Please be patient...", "Caption", 2000); - Application.Exit(); - return; - } + //if (Mesnac.Basic.ProcessHelper.HaveRunningInstance()) + //{ + // Mesnac.Basic.MessageBoxTimeOut.Show("The application is running, Please be patient...", "Caption", 2000); + // Application.Exit(); + // return; + //} Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //初始化服务管理器