起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 156|回复: 5

【搞定】如何获得岗位下的所有运行功能**

[复制链接]
发表于 2007-11-23 11:36:08 | 显示全部楼层 |阅读模式
已经得到登录人的岗位,现在要获得该岗位下的所有运行功能,

有没有一个函数像GetPersonAllFuncs(personid, list)
得到岗位的所有运行功能保存到list中

因为在这个函数中GetOrgUnitsFuncs(lOrgURLs, list, True)我不知道如何知道该人员的lOrgURLs
回复

使用道具 举报

发表于 2007-11-23 11:59:16 | 显示全部楼层
楼主,不懂您已经得到岗位,却得不到orgurl?那您得到的岗位是什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-11-23 14:45:31 | 显示全部楼层
谢谢,已解决这个问题,下边是整个代码
procedure TCT_PDGZT.InitUserPower;
var
  lBizURL: TBizURL;
  lOrgURL: Org.TOrgURL;
  lOrgURLs: Org.TOrgURLs;

  list: TOrgFuncItems;
  OrgUnit:TOrgUnit;
  I: integer;
  temp:boolean;
  personid:string;
  ChooseDeptID:string ;
  lContextCurrent: Business.Model.TContextCurrent;
begin
  try
  lContextCurrent := Business.Model.TContextCurrent.Create(Self.Context);
  personid:= lContextCurrent.Operator.ID;
  OrgUnit:= lContextCurrent.OperatorPosition.PositionMember;

  lBizURL := TBizURL.Create;
  lBizURL.URL := OrgUnit.BizURL.URL ;
  lOrgURL := Org.TOrgURL.Create(lBizURL);
  lOrgURLs := Org.TOrgURLs.Create;
  lOrgURLs.Add(lOrgURL);

  list := TOrgFuncItems.Create;
    if OrgSys.OrgSystem.GetOrgUnitsFuncs(lOrgURLs, list, True)  then
      for I := 0 to list.Count - 1 do
      begin
        if list.Items[I].FuncURL.id= 'GN_PDSBDA' then //配电设备
        begin
        UserPower.SB:=true;
        end;
        if list.Items[I].FuncURL.id= 'GN_PDSBZTPJ' then//配电设备评价
        begin
        UserPower.PJ:=true;
        end;
        if list.Items[I].FuncURL.id= 'GN_PDDYZGZPTX' then  //配电一种工作票 申请
        begin
        UserPower.YZGZP:=true;
        end;
        if list.Items[I].FuncURL.id= 'GN_SQPDDEZGZP' then  //配电二种工作票 申请
        begin
        UserPower.RZGZP:=true;
        end;
        if list.Items[I].FuncURL.id= 'GN_PDSQRTXBDTDSQD' then//配电停电票申请
        begin
        UserPower.TDSQP:=true;
        end;
        if list.Items[I].FuncURL.id= 'GN_PDSBQXDJ' then  //配电缺陷
        begin
        UserPower.SBQX:=true;
        end;
      end;
  finally
  lContextCurrent.Free;
    list.Free;
  end;
end;
回复 支持 反对

使用道具 举报

发表于 2007-11-23 14:57:34 | 显示全部楼层
似乎
OrgSys.OrgSystem.GetAllFunc(lContextCurrent.OperatorPosition.PositionMember, TOrgFuncKind.ofkRun, list)
就可以得到所有功能了吧
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-11-23 15:35:30 | 显示全部楼层
我再试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-11-23 16:30:49 | 显示全部楼层
采用如下方法解决掉
procedure TCT_PDGZT.InitUserPower;
var
  //list: TOrgFuncItems;
  list: TOrgFuncAllocItems;
  OrgUnit:TOrgUnit;
  I: integer;
  lContextCurrent: Business.Model.TContextCurrent;
begin
  try
  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
        if  TOrgFuncAllocItem(list.Items[I]).FuncURL= 'Biz:\SCMISYWKJ\GN_PDSBDA.Func' then //配电设备
        begin
        UserPower.SB:=true;
        end;
        if TOrgFuncAllocItem(list.Items[I]).FuncURL= 'Biz:\SCMISYWKJ\GN_BDSBZTPJ.Func' then//配电设备评价
        begin
        UserPower.PJ:=true;
        end;
        if TOrgFuncAllocItem(list.Items[I]).FuncURL= 'GN_PDDYZGZPTX' then  //配电一种工作票 申请
        begin
        UserPower.YZGZP:=true;
        end;
        if TOrgFuncAllocItem(list.Items[I]).FuncURL= 'GN_SQPDDEZGZP' then  //配电二种工作票 申请
        begin
        UserPower.RZGZP:=true;
        end;
        if TOrgFuncAllocItem(list.Items[I]).FuncURL= 'GN_PDSQRTXBDTDSQD' then//配电停电票申请
        begin
        UserPower.TDSQP:=true;
        end;
        if TOrgFuncAllocItem(list.Items[I]).FuncURL= 'Biz:\SCMISYWKJ\GN_PDSBQXDJ.Func' then  //配电缺陷
        begin
        UserPower.SBQX:=true;
        end;
      end;
      end;
  finally
   lContextCurrent.Free;
    list.Free;
  end;
end;
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-1 01:10 , Processed in 0.042073 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表