t1Click(Sender: TObject);
var floorcount,roomcount :integer;
f,r :integer;
begin
///在个Edit都不能为空
if Edit_floorNum.Text='' then
begin
showmessage('楼房号不能为空!');
Edit_floorNum.SetFocus;
end
else
if Edit_floorcount.Text='' then
begin
showmessage('楼层数不能为空!');
Edit_floorcount.SetFocus;
end
else
if Edit_roomcount.Text='' then
begin
showmessage('每层房间数不能为空!');
Edit_roomcount.SetFocus;
end
else
begin
floorcount:=strtoint(Form_floorconfig1.Edit_floorcount.Text);
roomcount:=strtoint(Form_floorconfig1.Edit_roomcount.Text);
for f:=1 to floorcount do
with Form_floorconfig1.Query1 do
begin
for r:=1 to roomcount do
begin
Close;
SQL.Clear;
SQL.Add('insert into room(Num_room) values(:x1)');
if r<10 then
parambyname('x1').asstring:=Edit_floorNum.Text+inttostr(f)+'0'+inttostr(r)
else
parambyname('x1').asstring:=Edit_floorNum.Text+inttostr(f)+inttostr(r);
ExecSQL;
end;
end;
end;
end;
procedure TForm_floorconfig1.Edit_floorcountKeyPress(Sender: TObject;
var Key: Char);
begin
if not (key in ['0'..'9',#13,#8]) then
key:=#0;
end;
procedure TForm_main.N1Click(Sender: TObject); //主窗体的壁纸设置
begin
if Ope