|
lContextCurrent := Business.Model.TContextCurrent.Create(Self.Context);//获取登陆人员ID数据
strID := lContextCurrent.Operator.LoginID; //将登陆人员ID赋值给变量
lPersonMembers := TList.Create;
lTemp := TStringList.Create;
try
OrgSys.OrgSystem.GetPersonMembers(strID, lPersonMembers); // 当前人员ID为登陆人员ID
//循环取出
for j := 0 to lPersonMembers.count -1 do
begin
lPersonMember := TOrgUnit(lPersonMembers.Items[j]);
lpos := lPersonMember.Parent.Parent.ID;
lcon := '''*.psm''';
lBizURL := TBizURL.Create;
lBizUrl.URL :='Org:\PERSON';
lOrgExpr := SysUtils.Format('OrgChildren(OrgKey(%s, '''', ''''), OrgCondition(%s, '''', ''''), True, False)', [lpos, lcon]);
OrgSys.OrgSystem.GetBizURLsByOrgExpr(lOrgExpr, lTemp);
for i := 0 to lTemp.Count - 1 do
begin
lBizURL.URL := lTemp.Trim;
ComboBox1.Items.Add(TPerson(OrgSys.OrgSystem.FindUnit(lBizURL)).LoginID + '-' + TPerson(OrgSys.OrgSystem.FindUnit(lBizURL)).DisplayName);
end;
end;
finally
lBizUrl.Free;
lPersonMembers.Free;
end; |
|