📄 oiidentity.cs
字号:
using System;
namespace OI
{
/// <summary>
/// OIIdentity 的摘要说明。
/// </summary>
public class OIIdentity:System.Security.Principal.IIdentity
{
string cName;
string cUserName;
string cUnitID;
public OIIdentity(string userid)
{
this.initData(userid);
}
#region IIdentity 成员
private void initData(string userid)
{
OI.DatabaseOper.DatabaseConnect dc=new OI.DatabaseOper.DatabaseConnect();
userid=OI.Modules.String.GenSafeChars(userid);
System.Data.DataSet oDataSet=dc.getBinding("select UserID,UserName,UnitID from Accounts_Users where userid='"+userid+"'","tt");
if(oDataSet.Tables[0].Rows.Count>0)
{
this.cName=oDataSet.Tables[0].Rows[0][0].ToString();
this.cUserName=oDataSet.Tables[0].Rows[0][1].ToString();
this.cUnitID=oDataSet.Tables[0].Rows[0][2].ToString();
}
}
public bool IsAuthenticated
{
get
{
// TODO: 添加 OIIdentity.IsAuthenticated getter 实现
return true;
}
}
public string Name
{
get
{
return this.cName;
}
set
{
this.cName=value;
}
}
public string UserName
{
get
{
return this.cUserName;
}
set
{
this.cUserName=value;
}
}
public string UnitID
{
get
{
return this.cUnitID;
}
set
{
this.cUnitID=value;
}
}
public string AuthenticationType
{
get
{
// TODO: 添加 OIIdentity.AuthenticationType getter 实现
return "OI Authentication";
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -