111,129
社区成员
发帖
与我相关
我的任务
分享
---------------------------
老总
技术副总
C#技术部
JAVA技术部
J2EE技术部
J2ME技术部
行政副总
财务部
行政部
市场副总
市场部
----------------------------
for (int i = 0; i < this.departList.Count; i++)
{
Department p = this.GetParent(this.departList[i]);
while (p != null)
{
this.departList[i].Depth++;
p = this.GetParent(p);
}
}
this.departList.ForEach(delegate(Department t)
{
Department p = this.GetParent(t);
while (p != null)
{
t.Depth++;
p = this.GetParent(p);
}
});
var temp = from dept in departList
where dept.ParentID = node.ID
select dept;
private Department GetParent(Department t)
{
if (t == null)
return null;
return this.departList.Find(s => s.ID == t.ParentID);
this.departList.Find(delete (Department s){
return s.ID == p.ParentID;
});
}
private Department GetParent(Department t)
{
if (t == null)
return null;
return this.departList.Find(s => s.ID == t.ParentID);
}
