procedure TCT_PDGZT.InitUserPower;
var
//list: TOrgFuncItems;
list: TOrgFuncAllocItems;
OrgUnit:TOrgUnit;
I: integer;
lContextCurrent: Business.Model.TContextCurrent;
strOrgFunc:string;
begin
try
UserPower:=TUserPower.Create;
lContextCurrent := Business.Model.TContextCurrent.Create(Self.Context);
list := TOrgFuncAllocItems.Create;
OrgSys.OrgSystem.GetAllFunc(lContextCurrent.OperatorPosition.PersonMember, TOrgFuncKind.ofkRun, list);
if (list.Count>0) then
begin
for I := 0 to list.Count - 1 do
begin
strOrgFunc:=SysUtils.UpperCase(TOrgFuncAllocItem(list.Items[I]).FuncURL.Trim);
if strOrgFunc= SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSBDA.FUNC') then //配电设备
begin
UserPower.SB:=true;
end;
if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSBZTPJ.FUNC') then//配电设备评价
begin
UserPower.PJ:=true;
end;
if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDDYZGZPTX.FUNC') then //配电一种工作票 申请
begin
UserPower.YZGZP:=true;
end;
if strOrgFunc= SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_SQPDDEZGZP.FUNC') then //配电二种工作票 申请
begin
UserPower.RZGZP:=true;
end;
if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSQRTXBDTDSQD.FUNC') then//配电停电票申请
begin
UserPower.TDSQP:=true;
end;
if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSBQXDJ.FUNC') then //配电缺陷
begin
UserPower.SBQX:=true;
end;
end;
end;
finally
lContextCurrent.Free;
list.Free;
end;
end;