You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using DevExpress.DataProcessing;
|
|
|
|
|
using Mesnac.Basic;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static bool IsSettingNormalUser
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var settingUser = ConfigurationManager.AppSettings["IsDaPing"];
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(settingUser))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Convert.ToBoolean(settingUser);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|