Sic.Framework-Nanjing-Baishi/MECF.Framework.Common/MECF/Framework/Common/Account/Extends/UserContext.cs

48 lines
962 B
C#
Raw Normal View History

2023-04-13 11:51:03 +08:00
using System;
using MECF.Framework.Common.CommonData;
namespace MECF.Framework.Common.Account.Extends
{
[Serializable]
public class UserContext : NotifiableItem
{
private string _loginName;
2023-08-29 11:16:43 +08:00
2023-04-13 11:51:03 +08:00
public string LoginName
{
2023-08-29 11:16:43 +08:00
get => _loginName;
2023-04-13 11:51:03 +08:00
set
{
_loginName = value;
2023-08-29 11:16:43 +08:00
InvokePropertyChanged();
2023-04-13 11:51:03 +08:00
}
}
2023-08-29 11:16:43 +08:00
2023-04-13 11:51:03 +08:00
public Role Role { get; set; }
public DateTime LoginTime { get; set; }
public DateTime LastAccessTime { get; set; }
public int Token { get; set; }
2023-08-29 11:16:43 +08:00
public string SessionId { get; set; }
2023-04-13 11:51:03 +08:00
public string Language { get; private set; }
public bool IsLogin { get; set; }
public void Clear()
{
LoginName = string.Empty;
Role = null;
LoginTime = DateTime.MinValue;
LastAccessTime = DateTime.MinValue;
Token = 0;
SessionId = string.Empty;
Language = string.Empty;
IsLogin = false;
}
}
2023-04-13 11:51:03 +08:00
}