mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
完成添加
This commit is contained in:
@@ -68,14 +68,22 @@ namespace OpenAuth.App
|
||||
return _repository.Find(u => u.ParentId == orgId);
|
||||
}
|
||||
|
||||
//得到部门的所有子部门
|
||||
/// <summary>
|
||||
/// 得到部门的所有子部门
|
||||
/// <para>如果orgId为0,表示取得所有部门</para>
|
||||
/// </summary>
|
||||
public IEnumerable<Org> LoadAllChildren(int orgId)
|
||||
{
|
||||
var org = _repository.FindSingle(u => u.Id == orgId);
|
||||
if (org == null)
|
||||
throw new Exception("未能找到指定对象信息");
|
||||
string cascadeId = "0.";
|
||||
if (orgId != 0)
|
||||
{
|
||||
var org = _repository.FindSingle(u => u.Id == orgId);
|
||||
if (org == null)
|
||||
throw new Exception("未能找到指定对象信息");
|
||||
cascadeId = org.CascadeId;
|
||||
}
|
||||
|
||||
return _repository.Find(u => u.CascadeId.Contains(org.CascadeId) && u.Id != orgId);
|
||||
return _repository.Find(u => u.CascadeId.Contains(cascadeId) && u.Id != orgId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -109,4 +117,4 @@ namespace OpenAuth.App
|
||||
|
||||
#endregion 私有方法
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user