//验证用户组织架构 string[] orgIds
protected bool checkeOrg(string[] DepCheckId)
{
//根据用户id获取用户所在部门
H3.Organization.User user = (H3.Organization.User) this.Engine.Organization.GetUnit(userId);//获取用户
if(user != null)
{
//获取部门集合
string[] pIds = user.ParentIds;
if(pIds != null && pIds.Length > 0)
{
//循环用户部门,匹配权限部门
foreach(string pid in pIds)
{
//校验权限部门
if(!string.IsNullOrEmpty(pid))
{
if(((IList) DepCheckId).Contains(pid)) return true;
//循环获取父部门
if(checkeDepart(DepCheckId, pid)) return true;
}
}
}
}
return false;
}