var
i,count:integer;
arr:array[1..10] of integer;
begin
case included of
0:
begin
with form1.ADOQuery1 do
begin
sql.Clear;
sql.Add('select count(*) as count from ConR where included=:included');//ConR是权限配置表,
included是角色代号
parameters.ParamByName('included').Value:=included;//登录时记录的角色代号
open;
count:=fieldbyname('count').AsInteger; sql.Clear;
sql.Add('select distinct RID from ConR where included=:included');//权限ID
parameters.ParamByName('included').Value:=included;
open;
end;
for i:=1 to count do
begin
arr[i]:=strtoint(form1.ADOQuery1.fieldbyname('RID').AsString );//把权限ID存入数组
if 条件 then
begin
//这里应该怎么写?我想通过菜单里各个子菜单的Tag值跟权限ID比较,如果相等就显示该菜单
end;
end;
end;
1:
begin
......
end;
end;
end;
i,count:integer;
arr:array[1..10] of integer;
begin
case included of
0:
begin
with form1.ADOQuery1 do
begin
sql.Clear;
sql.Add('select count(*) as count from ConR where included=:included');//ConR是权限配置表,
included是角色代号
parameters.ParamByName('included').Value:=included;//登录时记录的角色代号
open;
count:=fieldbyname('count').AsInteger; sql.Clear;
sql.Add('select distinct RID from ConR where included=:included');//权限ID
parameters.ParamByName('included').Value:=included;
open;
end;
for i:=1 to count do
begin
arr[i]:=strtoint(form1.ADOQuery1.fieldbyname('RID').AsString );//把权限ID存入数组
if 条件 then
begin
//这里应该怎么写?我想通过菜单里各个子菜单的Tag值跟权限ID比较,如果相等就显示该菜单
end;
end;
end;
1:
begin
......
end;
end;
end;
解决方案 »
- 关于用用VFP调用DELPHI动态连接库的问题
- 提问````DELPHI新手问题!帮帮我```
- 急盼解答(关于时间日期问题)
- 问一下有没有使begin和end配对的IDE工具阿?
- 安装Shell Controls and Automation 的错误!
- DEPHI控制显示器开关!急急急
- 用的DCOM,客戶端可以啓動,但是不能存取,DCOM設定中存取權限和啓動權限都是自定的everyone,請問是爲何??
- 存储过程的参数表达,用Params[I]还是ParamByName(‘fieldname’)?
- 求助 求delhip编写的工业控制程序
- 我这总是一些怪总题?
- 如何用delhpi程序改变win xp桌面墙纸?
- 紧急求助,Incompatible types: 'String' and 'TLabel'
for i := 0 to MainMenu1.Items.Count - 1 do
case MainMenu1.Items[i].Tag of
0 : ;//
1 : ;//
2 : ;//
else
ShowMessage('aaa');
end;
end;这是枚举菜单 tag 的代码
for i := 1 to MainMenu1.Items.Count-1 do
begin
if MainMenu1.Items[j].tag=count then
begin
MainMenu1.Items[j].Enabled := true;
MainMenu1.Items[j].Visible := true;
end
else
begin
MainMenu1.Items[j].Enabled := false;
MainMenu1.Items[j].Visible := false;
end;
end;大概这是样,细节楼主自己修改哦