断是否给该用户商品资料维护权限
if checkbox1.Checked then
begin
order:=strtoint(MaxNumber)+1;
str:=inttostr(order);
adocommand1.CommandText:='insert into 权限清单([权限序号],[用户编号],[权限名称]) values('''+str+''','+''''+UserNumber+''','+''''+checkbox1.Caption+''''+')';
adocommand1.Execute;
end;
//检查checkbox2状态,判断是否给该用户供货商资料维护权限
if checkbox2.Checked then
begin
order:=strtoint(MaxNumber)+2;
str:=inttostr(order);
adocommand1.CommandText:='insert into 权限清单([权限序号],[用户编号],[权限名称]) values('''+str+''','+''''+UserNumber+''','+''''+checkbox2.Caption+''''+')';
adocommand1.Execute;
end;
//检查checkbox3状态,判断是否给该用户客户资料维护权限
if checkbox3.Checked then
begin
order:=strtoint(MaxNumber)+3;
str:=inttostr(order);
adocommand1.CommandText:='insert into 权限清单([权限序号],[用户编号],[权限名称]) values('''+str+''','+''''+UserNumber+''','+''''+checkbox3.Caption+''''+')';
adocommand1.Execute;
end;
//检查checkbox4状态,判断是否给该用户进货单访问权限
if checkbox4.Checked then
begin
order:=strtoint(MaxNumber)+4;
str:=inttostr(order);
adocommand1.CommandText:='insert into 权限清单([权限序号],[用户编号],[权限名称]) values('''+str+''','+''''+UserNumber+''','+''''+checkbox4.Caption+''''+')';
adocommand1.Execute;
end;
//检查checkbox5状态,判断是否给该用户销售单访问权限
if checkbox5.Checked then
begin
order:=strtoint(MaxNumber)+5;
str:=inttostr(order);
adocommand1.CommandText:='insert into 权限清单([权限序号],[用户编号],[权限名称]) values('''+str+''','+''''+UserNumber+''','+''''+checkbox5.Caption+''''+')';
adocommand1.Execute;
end;
//检查checkbox6状态,判断是否给该用户库存查询权限
if checkbox6.Checked then
begin
order:=strtoint(MaxNumber)+6;
str:=inttostr(order);
adocommand1.CommandText:='insert into 权限清单([权限序号],[用户编号],[权限名称]) values('''+str+''','+''''+UserNumber+''','+''''+checkbox6.Caption+''''+')';
adocommand1.Execute;
end;
//检查checkbox7状态,判断是否给该权限管理权限
if checkbox7.Checked then
begin
order:=strtoint(MaxNumber)+7;
str:=inttostr(order);
adocommand1.CommandText:='insert into 权限清单([权限序号],[用户编号],[权限名称]) values('''+str+''','+''''+UserNumber+''','+''''+checkbox7.Caption+''''+')';
adocommand1.Execute;
end;
//通知用户修改成功
showmessage('修改成功!');
//----------------------根据用户的权限修改同步更新checkbox中的内容-----------
//--------------------判断更新后用户是否拥有商品清单管理权限--------------
adoquery2.Close;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('select 用户编号 from 权限清单 where (用户编号=(select 用户编号 from 用户清单 where ='''+combobox1.Text+'''))and(权限名称='''+checkbox1.Caption+
上一篇:
FormReport.pas
下一篇:
试题库管理系统毕业论文