position:=DBM.adoquery1.FieldByName('职位').AsString;
edit2.Text:=position;
这两句没问题 发上来是说明它是干嘛的下面哪有问题
mainf.MainMenu1.Items[0].Enabled:=false;
mainf.MainMenu1.Items[1].Enabled:=false;
mainf.MainMenu1.Items[2].Enabled:=false;
这三行过后 MAINF窗体的菜单失效 下面是恢复其中的可用项 可是恢复不了 该怎么写?(我没用特别建表去设置权限的 只是简单判定) if position=''+酒店管理+'' then
mainf.MainMenu1.Items[0].Enabled:=true;
if position=''+前台接待+'' then
mainf.MainMenu1.Items[1].Enabled:=true;
if position=''+客房管理+'' then
mainf.MainMenu1.Items[2].Enabled:=true;
edit2.Text:=position;
这两句没问题 发上来是说明它是干嘛的下面哪有问题
mainf.MainMenu1.Items[0].Enabled:=false;
mainf.MainMenu1.Items[1].Enabled:=false;
mainf.MainMenu1.Items[2].Enabled:=false;
这三行过后 MAINF窗体的菜单失效 下面是恢复其中的可用项 可是恢复不了 该怎么写?(我没用特别建表去设置权限的 只是简单判定) if position=''+酒店管理+'' then
mainf.MainMenu1.Items[0].Enabled:=true;
if position=''+前台接待+'' then
mainf.MainMenu1.Items[1].Enabled:=true;
if position=''+客房管理+'' then
mainf.MainMenu1.Items[2].Enabled:=true;
mainf.MainMenu1.Items[0].Enabled:=true;
if position='+前台接待+' then
mainf.MainMenu1.Items[1].Enabled:=true;
if position='+客房管理+' then
mainf.MainMenu1.Items[2].Enabled:=true;如果edit2.text显示的是 '+酒店管理+' if position='''+酒店管理+''' then
mainf.MainMenu1.Items[0].Enabled:=true;
if position='''+前台接待+''' then
mainf.MainMenu1.Items[1].Enabled:=true;
if position='''+客房管理+''' then
mainf.MainMenu1.Items[2].Enabled:=true;
if position='酒店管理' then
mainf.MainMenu1.Items[0].Enabled:=true;
if position='前台接待' then
mainf.MainMenu1.Items[1].Enabled:=true;
if position='客房管理' then
mainf.MainMenu1.Items[2].Enabled:=true;试试
同意这个,应该是这样的!可以自己看看接出来的值是什么样的
加个button,点击事件,showmessage(position)显示的是什么,再加
if position = '酒店管理' then showmessage('相同') else 不同我怀疑你是position变化了
if pos('酒店管理',position)>0 then
mainf.MainMenu1.Items[0].Enabled:=true;
showmessage(position)
看看position 是什麽內容
edit2.Text:=position;
mainf.MainMenu1.Items[0].Enabled:=true;
if trim(position)='前台接待' then
mainf.MainMenu1.Items[1].Enabled:=true;
if trim(position)='客房管理' then
mainf.MainMenu1.Items[2].Enabled:=true;