add - 添加用户类型判断类

dep
wangsr 12 months ago
parent ec7b179a8a
commit ae9d9ea35f

@ -754,6 +754,7 @@
<Compile Include="Test\TestAction.cs" /> <Compile Include="Test\TestAction.cs" />
<Compile Include="UserManage\UserHelper.cs" /> <Compile Include="UserManage\UserHelper.cs" />
<Compile Include="Util\ControlsImprot.cs" /> <Compile Include="Util\ControlsImprot.cs" />
<Compile Include="Util\UserJudge.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Alarm\PmtAlarm\FrmInsert.resx"> <EmbeddedResource Include="Alarm\PmtAlarm\FrmInsert.resx">

@ -5,9 +5,12 @@ using ICSharpCode.Core;
using Mesnac.Action.Base; using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.InterfaceDocking; using Mesnac.Action.ChemicalWeighing.InterfaceDocking;
using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity; using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity;
using Mesnac.Action.ChemicalWeighing.Util;
using Mesnac.Basic;
using Mesnac.Controls.ChemicalWeighing; using Mesnac.Controls.ChemicalWeighing;
using Mesnac.Controls.Default; using Mesnac.Controls.Default;
using Mesnac.Core.Service; using Mesnac.Core.Service;
using Steema.TeeChart.Styles;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;

@ -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
{
/// <summary>
/// 判断是否为超级用户
/// </summary>
/// <returns>true为超级用户false为普通Run环境用户</returns>
public static bool IsEdit()
{
string userName = UserInfo.Instance.UserName;
if(userName == "mesnac" || string.IsNullOrEmpty(userName))
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 判断是否为超级用户
/// </summary>
/// <returns>true为普通Run环境用户false为超级用户</returns>
public static bool IsNormalUser()
{
return !IsEdit();
}
}
}
Loading…
Cancel
Save