From ae9d9ea35f5a04351b481df5487a0879f50eef0d Mon Sep 17 00:00:00 2001 From: wangsr Date: Fri, 15 Dec 2023 11:18:13 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mesnac.Action.ChemicalWeighing.csproj | 1 + .../Report/LjLogReport.cs | 3 ++ .../Util/UserJudge.cs | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index 80bde48..f3b86ab 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -754,6 +754,7 @@ + diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs index 75ee7c7..da9f1a0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs @@ -5,9 +5,12 @@ using ICSharpCode.Core; using Mesnac.Action.Base; using Mesnac.Action.ChemicalWeighing.InterfaceDocking; using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity; +using Mesnac.Action.ChemicalWeighing.Util; +using Mesnac.Basic; using Mesnac.Controls.ChemicalWeighing; using Mesnac.Controls.Default; using Mesnac.Core.Service; +using Steema.TeeChart.Styles; using System; using System.Collections.Generic; using System.Data; diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs new file mode 100644 index 0000000..d0ffdab --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/UserJudge.cs @@ -0,0 +1,39 @@ +using DevExpress.DataProcessing; +using Mesnac.Basic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Mesnac.Action.ChemicalWeighing.Util +{ + public class UserJudge + { + /// + /// 判断是否为超级用户 + /// + /// true为超级用户,false为普通Run环境用户 + public static bool IsEdit() + { + string userName = UserInfo.Instance.UserName; + if(userName == "mesnac" || string.IsNullOrEmpty(userName)) + { + return true; + } + else + { + return false; + } + } + + /// + /// 判断是否为超级用户 + /// + /// true为普通Run环境用户,false为超级用户 + public static bool IsNormalUser() + { + return !IsEdit(); + } + } +}