代码整理,组件窗口移动到项目中,公共库代码新建UserSystem共同静态数据,v1.6.14
This commit is contained in:
@@ -84,6 +84,7 @@ namespace CommonLibrary
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +117,39 @@ namespace CommonLibrary
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个角色的所有的用户名称
|
||||
/// </summary>
|
||||
/// <param name="roleCode"></param>
|
||||
/// <returns></returns>
|
||||
public string[] GetUsernamesByRolename(string roleCode)
|
||||
{
|
||||
string[] result = null;
|
||||
hybirdLock.Enter();
|
||||
|
||||
for (int i = 0; i < m_roles.Count; i++)
|
||||
{
|
||||
if (m_roles[i].RoleCode == roleCode)
|
||||
{
|
||||
if (m_roles[i].Accounts != null)
|
||||
{
|
||||
result = m_roles[i].Accounts.ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new string[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
hybirdLock.Leave();
|
||||
|
||||
if (result == null) result = new string[0]; // 角色不存在的情况
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Members
|
||||
|
||||
Reference in New Issue
Block a user