zoukankan      html  css  js  c++  java
  • 获得用户部门权限

     

    var LoginUserDepts : WideString;
    
      procedure SetDBComboBoxDeptItems;
      var DeptList :TStringlist;
          i :Integer;
      begin
    
        DeptList:=TStringlist.Create;
        try
          DeptList.CommaText:=ListUserDepts(aLoginUser.Userid);
          for i:=0 to  DeptList.Count-1 do begin
            LoginUserDepts:=LoginUserDepts+','+DeptList.Names[i];
          end;
            LoginUserDepts:=Copy(LoginUserDepts,2,Length(LoginUserDepts)-1)
        finally
          DeptList.Free;
        end;
      end;
    ==使用=============================================
          if pos('2,',LoginUserDepts)>0 then  begin    //2 表示财务部
            if pos('27',LoginUserDepts)>0 then
               SQL.Add('and ((i.SrcbsBillDeptid in ('+LoginUserDepts+')) or (i.srcactid in (3,38,43,125) and i.corpid=162))')
           else SQL.Add('and i.SrcbsBillDeptid in ('+LoginUserDepts+')');
          end;
  • 相关阅读:
    Co.
    编程
    编程
    编程
    数据同步
    Co.
    Co.
    Co.
    Co.
    sss
  • 原文地址:https://www.cnblogs.com/CNQCJ/p/1433004.html
Copyright © 2011-2022 走看看