using System; using System.Collections.Generic; namespace Model { [Serializable] public class SysUser : ISessionObject { public int UserID { get; set; } public string Account { get; set; } public string Password { get; set; } public DateTime ExpireTime { get; set; } public DateTime CreateTime { get; set; } public string Remark { get; set; } public string Mobile { get; set; } public int MobileFlag { get; set; } public string Email { get; set; } public int EmailFlag { get; set; } public string WxData { get; set; } public int IsEncryption { get; set; } public int IsVerification { get; set; } public string ClientIp { get; set; } public Dictionary MenuIDList { get; set; } public bool HasRight(string code) { if (this.UserID == 1 && code.StartsWith("104")) return true; if (this.MenuIDList == null) return false; return this.MenuIDList.ContainsKey(code); } public bool ContainsTargetID(string menuID, string targetID) { SysUserMenu sysUserMenu; if (this.MenuIDList == null || !this.MenuIDList.TryGetValue(menuID, out sysUserMenu)) return false; return sysUserMenu.ContainsTargetID(targetID); } public string[] GetSubMenuArray(string menuID) { SysUserMenu sysUserMenu; if (this.MenuIDList == null || !this.MenuIDList.TryGetValue(menuID, out sysUserMenu)) return new string[0]; return sysUserMenu.SubMenuArray; } } }