From 725b5aceedee7f15f1490b6be255bb5d8ef73b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Sun, 31 Dec 2023 13:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E9=83=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Util/UserJudge.cs | 18 ++++++++++++++++++ Main/MCRun/App.config | 3 +++ Main/Mensac.Gui.Run.Global/AppConfigHandler.cs | 3 +++ 3 files changed, 24 insertions(+) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs index d0ffdab..ffe8efe 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs @@ -2,6 +2,7 @@ using Mesnac.Basic; using System; using System.Collections.Generic; +using System.Configuration; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -35,5 +36,22 @@ namespace Mesnac.Action.ChemicalWeighing.Util { return !IsEdit(); } + + + public static bool IsSettingNormalUser + { + get + { + var settingUser= ConfigurationManager.AppSettings["IsNormalUser"]; + + if(string.IsNullOrEmpty(settingUser) ) + { + return false; + } + + return Convert.ToBoolean(settingUser); + + } + } } } diff --git a/Main/MCRun/App.config b/Main/MCRun/App.config index b7f1fc2..0f0dafe 100644 --- a/Main/MCRun/App.config +++ b/Main/MCRun/App.config @@ -4,6 +4,9 @@
+ + + diff --git a/Main/Mensac.Gui.Run.Global/AppConfigHandler.cs b/Main/Mensac.Gui.Run.Global/AppConfigHandler.cs index 276ab55..a4c24ec 100644 --- a/Main/Mensac.Gui.Run.Global/AppConfigHandler.cs +++ b/Main/Mensac.Gui.Run.Global/AppConfigHandler.cs @@ -24,6 +24,8 @@ namespace Mesnac.Gui.Run.Global private static AppConfigHandler instance = null; + public string IsNormalUser { get; set; } + private string _mesnacPlugInPath = String.Empty; //自定义插件目录 private string _mcProjectPath = String.Empty; //组态工程目录 private string _sysConfigPath = String.Empty; //系统工程配置目录 @@ -37,6 +39,7 @@ namespace Mesnac.Gui.Run.Global private AppConfigHandler() { + this.IsNormalUser = ConfigurationManager.AppSettings["IsNormalUser"]; this._mesnacPlugInPath = ConfigurationManager.AppSettings["MesnacPlugInPath"]; this._mcProjectPath = ConfigurationManager.AppSettings["MCProjectPath"]; this._sysConfigPath = ConfigurationManager.AppSettings["SysConfigPath"];