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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using Mesnac.Codd.Session ;
using System ;
using System.Collections.Generic ;
using System.Data ;
using System.Linq ;
using System.Text ;
namespace DisassemblyTable
{
public class UserInfo
{
private string _userId ;
private string _userName ;
private string _realName ;
public bool islogin = false ;
private string _roleId ; //未登录时为-1, 预留超级用户为-99
private DateTime _loginTime ;
public const bool MustLogin = false ;
private List < string > _purviewList = null ; //当前用户的权限项列表
private List < string > _allFormPurview = null ; //所有权限项
#region 单例模式
private static UserInfo user = null ;
public static UserInfo Instance
{
get
{
if ( user = = null )
{
user = new UserInfo ( ) ;
}
return user ;
}
}
# endregion
public UserInfo ( )
: this ( "-1" , "--" , "--" , "-1" )
{
}
public UserInfo ( string userId , string userName , string realName , string roleId )
{
this . _userId = userId ;
this . _userName = userName ;
this . _realName = realName ;
this . _roleId = roleId ;
this . _loginTime = DateTime . Now ;
}
public string UserID
{
get
{
return _userId ;
}
set
{
_userId = value ;
}
}
public string UserName
{
get
{
return _userName ;
}
set
{
_userName = value ;
}
}
public string RealName
{
get
{
return _realName ;
}
set
{
_realName = value ;
}
}
public string RoleID
{
get
{
return _roleId ;
}
set
{
_roleId = value ;
if ( _roleId . Equals ( "-99" ) )
{
_userName = "mesnac" ;
_realName = "超级用户" ;
}
}
}
public DateTime LoginTime
{
get
{
return _loginTime ;
}
set
{
_loginTime = DateTime . Now ;
}
}
/// <summary>
/// 获取当前用户的权限项列表
/// </summary>
public List < string > PurviewList
{
get
{
//this.RefreshPurview();
return this . _purviewList ;
}
}
}
}