📄 housefrm.~pas
字号:
ELSE if acombobox.text='非详细数据' then
begin
ainput2.enabled:=false;
ainput3.enabled:=false;
ainput4.enabled:=false;
ainput14.enabled:=false;
ainput15.enabled:=false;
ainput16.enabled:=false;
ainput17.enabled:=false;
ainput18.enabled:=false;
ainput3.color:=clmenu;
ainput4.color:=clmenu;
ainput14.color:=clmenu;
ainput15.color:=clmenu;
ainput16.color:=clmenu;
ainput17.color:=clmenu;
ainput18.color:=clmenu;
ainput2.color:=clmenu;
end else if acombobox.text='共享数据' then
begin
ainput2.enabled:=true;
ainput3.enabled:=true;
ainput4.enabled:=true;
ainput14.enabled:=true;
ainput15.enabled:=true;
ainput16.enabled:=true;
ainput17.enabled:=true;
ainput18.enabled:=true;
ainput3.color:=clwindow;
ainput4.color:=clwindow;
ainput14.color:=clwindow;
ainput15.color:=clwindow;
ainput16.color:=clwindow;
ainput17.color:=clwindow;
ainput18.color:=clwindow;
ainput2.color:=clwindow;
end ;
end;
procedure Thouseform.ainput25KeyPress(Sender: TObject; var Key: Char);
var
p:integer;
begin
if key in ['0'..'9','.'] then
begin
if key='.' then
begin
p:=pos('.',ainput25.Text);
if p>0 then key:=#0;
end ; end
else if (key>#31) then key:=#0;
if Key=#13 then
begin
Perform(WM_NEXTDLGCTL,0,0);
key:=#0;
end;
end;
procedure Thouseform.SpeedButton1Click(Sender: TObject);
var
value1,value2:integer;
s,s1,s2,s3,s4,s5:string;
begin
s:='select * from house where 交易类型=:y and 数据性质<>:z';
s1:='';
s2:='';
s3:='';
s4:='';
s5:='';
if combobox1.text<>'房屋用途' then
begin
s:=s+ ' and 房屋用途=:a';
s1:=combobox1.text;
s5:='a';
end;
if (combobox3.text<>'层次') then begin
s:=s+' and 层次=:b';
s2:=combobox3.text;
s5:='a';
end;
if (combobox5.text<>'房型') then
begin
s:=s+' and 房型室=:c1 and 房型厅=:c2';
s3:=combobox5.text;
value1:=strtoint(copy(s3,0,1));
value2:=strtoint(copy(s3,4,1));
s5:='a';
end;
if (combobox7.text<>'房屋类型') then
begin
s:=s+' and 房屋类型=:d';
s4:=combobox7.text;
s5:='a';
end ;
with datamodule2.housequery1 do
begin
close;
sql.Clear;
sql.Add(s);
ParamByName('y').asstring:='买卖';
ParamByName('z').asstring:='2';
if s1<>'' then ParamByName('a').asstring:=s1;
if s2<>'' then ParamByName('b').asstring:=s2;
if s3<>'' then
begin
ParamByName('c1').asinteger:=value1;
ParamByName('c2').asinteger:=value2;
end;
if s4<>'' then ParamByName('d').asstring:=s4;
open;
number:=1;
if recordcount>0 then
numberlabel.caption:='第'+inttostr(number)+'条记录,共'+inttostr(recordcount)+'条记录'
else numberlabel.caption:='未找到符合当前条件的记录,请换个条件试试!'
end;
end;
procedure Thouseform.SpeedButton2Click(Sender: TObject);
var
value1,value2:integer;
s,s1,s2,s3,s4,s5:string;
begin
s:='select * from house where 交易类型=:y and 数据性质<>:z';
s1:='';
s2:='';
s3:='';
s4:='';
s5:='';
if combobox1.text<>'房屋用途' then
begin
s:=s+ ' and 房屋用途=:a';
s1:=combobox1.text;
s5:='a';
end;
if (combobox3.text<>'层次') then begin
s:=s+' and 层次=:b';
s2:=combobox3.text;
s5:='a';
end;
if (combobox5.text<>'房型') then
begin
s:=s+' and 房型室=:c1 and 房型厅=:c2';
s3:=combobox5.text;
value1:=strtoint(copy(s3,0,1));
value2:=strtoint(copy(s3,4,1));
s5:='a';
end;
if (combobox7.text<>'房屋类型') then
begin
s:=s+' and 房屋类型=:d';
s4:=combobox7.text;
s5:='a';
end ;
with datamodule2.housequery1 do
begin
close;
sql.Clear;
sql.Add(s);
ParamByName('y').asstring:='租赁';
ParamByName('z').asstring:='2';
if s1<>'' then ParamByName('a').asstring:=s1;
if s2<>'' then ParamByName('b').asstring:=s2;
if s3<>'' then
begin
ParamByName('c1').asinteger:=value1;
ParamByName('c2').asinteger:=value2;
end;
if s4<>'' then ParamByName('d').asstring:=s4;
open;
number:=1;
if recordcount>0 then
numberlabel.caption:='第'+inttostr(number)+'条记录,共'+inttostr(recordcount)+'条记录'
else numberlabel.caption:='未找到符合当前条件的记录,请换个条件试试!'
end;
end;
procedure Thouseform.binput45Change(Sender: TObject);
begin
if binput45.text='0' then
binput45.text:='非详细数据'
else if binput45.text='1' then
binput45.text:='详细数据'
else if binput45.text='2' then
binput45.text:='共享数据';
end;
procedure Thouseform.SpeedButton3Click(Sender: TObject);
var
value1,value2:integer;
s,s1,s2,s3,s4,s5:string;
begin
s:='select * from house where 交易类型=:y and 数据性质=:z';
s1:='';
s2:='';
s3:='';
s4:='';
s5:='';
if combobox1.text<>'房屋用途' then
begin
s:=s+ ' and 房屋用途=:a';
s1:=combobox1.text;
s5:='a';
end;
if (combobox3.text<>'层次') then begin
s:=s+' and 层次=:b';
s2:=combobox3.text;
s5:='a';
end;
if (combobox5.text<>'房型') then
begin
s:=s+' and 房型室=:c1 and 房型厅=:c2';
s3:=combobox5.text;
value1:=strtoint(copy(s3,0,1));
value2:=strtoint(copy(s3,4,1));
s5:='a';
end;
if (combobox7.text<>'房屋类型') then
begin
s:=s+' and 房屋类型=:d';
s4:=combobox7.text;
s5:='a';
end ;
with datamodule2.housequery1 do
begin
close;
sql.Clear;
sql.Add(s);
ParamByName('y').asstring:='买卖';
ParamByName('z').asstring:='2';
if s1<>'' then ParamByName('a').asstring:=s1;
if s2<>'' then ParamByName('b').asstring:=s2;
if s3<>'' then
begin
ParamByName('c1').asinteger:=value1;
ParamByName('c2').asinteger:=value2;
end;
if s4<>'' then ParamByName('d').asstring:=s4;
open;
number:=1;
if recordcount>0 then
numberlabel.caption:='第'+inttostr(number)+'条记录,共'+inttostr(recordcount)+'条记录'
else numberlabel.caption:='未找到符合当前条件的记录,请换个条件试试!';
end;
end;
procedure Thouseform.SpeedButton4Click(Sender: TObject);
var
value1,value2:integer;
s,s1,s2,s3,s4,s5:string;
begin
s:='select * from house where 交易类型=:y and 数据性质=:z';
s1:='';
s2:='';
s3:='';
s4:='';
s5:='';
if combobox1.text<>'房屋用途' then
begin
s:=s+ ' and 房屋用途=:a';
s1:=combobox1.text;
s5:='a';
end;
if (combobox3.text<>'层次') then begin
s:=s+' and 层次=:b';
s2:=combobox3.text;
s5:='a';
end;
if (combobox5.text<>'房型') then
begin
s:=s+' and 房型室=:c1 and 房型厅=:c2';
s3:=combobox5.text;
value1:=strtoint(copy(s3,0,1));
value2:=strtoint(copy(s3,4,1));
s5:='a';
end;
if (combobox7.text<>'房屋类型') then
begin
s:=s+' and 房屋类型=:d';
s4:=combobox7.text;
s5:='a';
end ;
with datamodule2.housequery1 do
begin
close;
sql.Clear;
sql.Add(s);
ParamByName('y').asstring:='租赁';
ParamByName('z').asstring:='2';
if s1<>'' then ParamByName('a').asstring:=s1;
if s2<>'' then ParamByName('b').asstring:=s2;
if s3<>'' then
begin
ParamByName('c1').asinteger:=value1;
ParamByName('c2').asinteger:=value2;
end;
if s4<>'' then ParamByName('d').asstring:=s4;
open;
number:=1;
if recordcount>0 then
numberlabel.caption:='第'+inttostr(number)+'条记录,共'+inttostr(recordcount)+'条记录'
else numberlabel.caption:='未找到符合当前条件的记录,请换个条件试试!';
end;
end;
procedure Thouseform.ainput9KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
begin
Perform(WM_NEXTDLGCTL,0,0);
key:=#0;
end;
end;
procedure Thouseform.DBGrid1DblClick(Sender: TObject);
var
s:string;
begin
with datamodule2 do
begin
aindex:=input1.Value;
s:=input45.AsString;
if s='0' then acombobox.text:='非详细数据'
else if s='1' then acombobox.text:='详细数据'
else if s='2' then acombobox.text:='共享数据';
if acombobox.text='详细数据' then
begin
ainput2.enabled:=true;
ainput3.enabled:=true;
ainput4.enabled:=true;
ainput14.enabled:=true;
ainput15.enabled:=true;
ainput16.enabled:=true;
ainput17.enabled:=true;
ainput18.enabled:=true;
ainput3.color:=clwindow;
ainput4.color:=clwindow;
ainput14.color:=clwindow;
ainput15.color:=clwindow;
ainput16.color:=clwindow;
ainput17.color:=clwindow;
ainput18.color:=clwindow;
ainput2.color:=clwindow;
end
ELSE if acombobox.text='非详细数据' then
begin
ainput2.enabled:=false;
ainput3.enabled:=false;
ainput4.enabled:=false;
ainput14.enabled:=false;
ainput15.enabled:=false;
ainput16.enabled:=false;
ainput17.enabled:=false;
ainput18.enabled:=false;
ainput3.color:=clmenu;
ainput4.color:=clmenu;
ainput14.color:=clmenu;
ainput15.color:=clmenu;
ainput16.color:=clmenu;
ainput17.color:=clmenu;
ainput18.color:=clmenu;
ainput2.color:=clmenu;
end else if acombobox.text='共享数据' then
begin
ainput2.enabled:=true;
ainput3.enabled:=true;
ainput4.enabled:=true;
ainput14.enabled:=true;
ainput15.enabled:=true;
ainput16.enabled:=true;
ainput17.enabled:=true;
ainput18.enabled:=true;
ainput3.color:=clwindow;
ainput4.color:=clwindow;
ainput14.color:=clwindow;
ainput15.color:=clwindow;
ainput16.color:=clwindow;
ainput17.color:=clwindow;
ainput18.color:=clwindow;
ainput2.color:=clwindow;
end ;
ainput2.text:=input2.AsString;
ainput3.text:=input3.AsString;
ainput4.text:=input4.AsString;
ainput5.text:=input5.AsString;
ainput6.text:=input6.AsString;
ainput7.text:=input7.AsString;
ainput8.text:=input8.AsString;
ainput9.text:=input9.AsString;
ainput10.text:=input10.AsString;
ainput11.text:=input11.AsString;
ainput12.text:=input12.AsString;
ainput13.text:=input13.AsString;
ainput14.text:=input14.AsString;
ainput15.text:=input15.AsString;
ainput16.text:=input16.AsString;
ainput17.text:=input17.AsString;
ainput18.text:=input18.AsString;
ainput19.text:=input19.AsString;
ainput20.text:=input20.AsString;
ainput21.text:=input21.AsString;
ainput22.text:=input22.AsString;
ainput24.text:=input24.AsString;
ainput25.text:=input25.AsString;
ainput39.text:=input39.AsString;
ainput43.text:=input43.AsString;
ainput44.text:=input44.AsString;
ainput40.date:=input40.value;
ainput26.checked:=input26.AsBoolean;
ainput27.checked:=input27.AsBoolean;
ainput28.checked:=input28.AsBoolean;
ainput29.checked:=input29.AsBoolean;
ainput30.checked:=input30.AsBoolean;
ainput31.checked:=input31.AsBoolean;
ainput32.checked:=input32.AsBoolean;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -