📄 housefrm.pas
字号:
ainput34.checked:=input34.AsBoolean;
ainput35.checked:=input35.AsBoolean;
ainput36.checked:=input36.AsBoolean;
ainput37.checked:=input37.AsBoolean;
ainput38.checked:=input38.AsBoolean;
ainput41.checked:=input41.AsBoolean;
end;
button1.Enabled:=false;
button2.enabled:=true;
ainput9.SetFocus;
end;
procedure Thouseform.Button2Click(Sender: TObject);
begin
if datamodule2.inputtable.FindKey([aindex]) then
with datamodule2 do
if acombobox.text='非详细数据' then
begin
inputtable.edit;
input5.asstring:=ainput5.Text;
input6.asstring:=ainput6.Text;
input7.asstring:=ainput7.Text;
input8.asstring:=ainput8.Text;
input9.asstring:=ainput9.Text;
input10.asstring:=ainput10.Text;
input11.asstring:=ainput11.Text;
input12.asstring:=ainput12.Text;
input13.asstring:=ainput13.Text;
input19.asstring:=ainput19.Text;
input20.asstring:=ainput20.Text;
input21.asstring:=ainput21.Text;
input22.asstring:=ainput22.Text;
input23.AsString:=ainput20.text+ainput21.text+ainput22.Text;
input24.asstring:=ainput24.Text;
input25.asstring:=ainput25.Text;
input39.asstring:=ainput39.Text;
input40.asstring:=datetostr(ainput40.date);
input43.asstring:=ainput43.Text;
input44.asstring:=ainput44.Text;
input45.asstring:='0';
input26.value:=ainput26.Checked;
input27.value:=ainput27.Checked;
input29.value:=ainput29.Checked;
input28.value:=ainput28.Checked;
input30.value:=ainput30.Checked;
input31.value:=ainput31.Checked;
input33.value:=ainput33.Checked;
input32.value:=ainput32.Checked;
input34.value:=ainput34.Checked;
input35.value:=ainput35.Checked;
input36.value:=ainput36.Checked;
input37.value:=ainput37.Checked;
input38.value:=ainput38.Checked;
input41.value:=ainput41.Checked;
inputtable.Post;
end
else
begin
inputtable.edit;;
input2.asstring:=ainput2.Text;
input3.asstring:=ainput3.Text;
input4.asstring:=ainput4.Text;
input5.asstring:=ainput5.Text;
input6.asstring:=ainput6.Text;
input7.asstring:=ainput7.Text;
input8.asstring:=ainput8.Text;
input9.asstring:=ainput9.Text;
input10.asstring:=ainput10.Text;
input11.asstring:=ainput11.Text;
input12.asstring:=ainput12.Text;
input13.asstring:=ainput13.Text;
input14.asstring:=ainput14.Text;
input15.asstring:=ainput15.Text;
input16.asstring:=ainput16.Text;
input17.asstring:=ainput17.Text;
input18.asstring:=ainput18.Text;
input19.asstring:=ainput19.Text;
input20.asstring:=ainput20.Text;
input21.asstring:=ainput21.Text;
input22.asstring:=ainput22.Text;
input23.AsString:=ainput20.text+ainput21.text+ainput22.Text;
input24.asstring:=ainput24.Text;
input25.asstring:=ainput25.Text;
input39.asstring:=ainput39.Text;
input40.asstring:=datetostr(ainput40.date);
input43.asstring:=ainput43.Text;
input44.asstring:=ainput44.Text;
if acombobox.text='详细数据' then input45.asstring:='1'
else if acombobox.text='共享数据' then input45.asstring:='2';
input26.value:=ainput26.Checked;
input27.value:=ainput27.Checked;
input29.value:=ainput29.Checked;
input28.value:=ainput28.Checked;
input30.value:=ainput30.Checked;
input31.value:=ainput31.Checked;
input33.value:=ainput33.Checked;
input32.value:=ainput32.Checked;
input34.value:=ainput34.Checked;
input35.value:=ainput35.Checked;
input36.value:=ainput36.Checked;
input37.value:=ainput37.Checked;
input38.value:=ainput38.Checked;
input41.value:=ainput41.Checked;
inputtable.Post;
end;
ainput2.text:='';
ainput3.text:='';
ainput4.text:='';
ainput5.text:='';
ainput6.text:='';
ainput7.text:='';
ainput8.text:='';
ainput9.text:='买卖';
ainput10.text:='居住用房';
ainput11.text:='新房';
ainput12.text:='商品房';
ainput13.text:='';
ainput14.text:='';
ainput15.text:='';
ainput16.text:='';
ainput17.text:='';
ainput18.text:='';
ainput19.text:='';
ainput20.text:='';
ainput21.text:='';
ainput22.text:='';
ainput24.text:='';
ainput25.text:='';
ainput39.text:='';
ainput43.text:='中套';
ainput44.text:='';
ainput19.text:='南';
ainput9.SetFocus;
button1.enabled:=true;
button2.enabled:=false;
end;
procedure Thouseform.inputpanelClick(Sender: TObject);
begin
ainput9.setfocus;
end;
procedure Thouseform.Button5Click(Sender: TObject);
var
aoutform:toutform;
begin
aoutform:=toutform.Create(application);
aoutform.ShowModal;
end;
procedure Thouseform.ainput5KeyPress(Sender: TObject; var Key: Char);
var
p:integer;
begin
if key in ['0'..'9','.'] then
begin
if key='.' then
begin
p:=pos('.',ainput5.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.ainput6KeyPress(Sender: TObject; var Key: Char);
var
p:integer;
begin
if key in ['0'..'9','.'] then
begin
if key='.' then
begin
p:=pos('.',ainput6.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.ainput24KeyPress(Sender: TObject; var Key: Char);
var
p:integer;
begin
if key in ['0'..'9','.'] then
begin
if key='.' then
begin
p:=pos('.',ainput24.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.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
begin
Perform(WM_NEXTDLGCTL,0,0);
key:=#0;
end;
end;
procedure Thouseform.Edit1KeyPress(Sender: TObject; var Key: Char);
var
s:string;
begin
s:=edit1.text;
if key=#13 then with datamodule2 do
begin
if not inputtable.FindKey([s]) then showmessage('此条记录未找到!');
end;
end;
procedure Thouseform.ComboBox9Change(Sender: TObject);
begin
case combobox9.ItemIndex of
0:buyindex:=0;
1:buyindex:=1;
2:buyindex:=2;
3:buyindex:=3;
4:buyindex:=4;
5:buyindex:=5;
6:buyindex:=6;
end;
if buyindex>3 then
begin
date8.visible:=true;
date8.SetFocus;
end else
begin
date8.visible:=false;
edit8.setfocus;
end;
end;
procedure Thouseform.Button7Click(Sender: TObject);
var
s:string;
s1:string;
begin
with datamodule2 do
begin
case buyindex of
0:showmessage('选选择查询条件!');
1:begin
s:=edit8.text;
if s='' then showmessage('请输入条件内容!') else
begin
s:='select * from bargain where 成交编号='+s;
bargainquery.SQL.Clear;
bargainquery.sql.add(s);
bargainquery.open ;
dbgrid3.datasource:=bargain2source;
end;
end;
2:begin
if edit8.text='' then showmessage('请输入条件内容!')
else begin
s:='select * from bargain where 中介编号=:s1';
bargainquery.SQL.Clear;
bargainquery.sql.add(s);
bargainquery.ParamByName('s1').asstring:=edit8.text;
bargainquery.open ;
dbgrid3.datasource:=bargain2source;
end;
end ;
3:begin
if edit8.text='' then showmessage('请输入条件内容!')
else begin
s:='select * from bargain where 买方姓名=:s1';
bargainquery.sql.clear;
bargainquery.sql.Add(s);
bargainquery.parambyname('s1').asstring:=edit8.text;
bargainquery.open;
dbgrid3.datasource:=bargain2source;
end;
end;
4:begin
s:='select * from bargain where 成交日期>:s1 order by 成交日期,成交编号';
bargainquery.sql.clear;
bargainquery.sql.add(s);
bargainquery.parambyname('s1').asstring:=datetostr(date8.date);
bargainquery.open;
dbgrid3.datasource:=bargain2source;
end;
5:begin
s:='select * from bargain where 成交日期=:s1 order by 成交日期,成交编号' ;
bargainquery.sql.clear;
bargainquery.sql.add(s);
bargainquery.parambyname('s1').asstring:=datetostr(date8.date);
bargainquery.open;
dbgrid3.datasource:=bargain2source;
end;
6:begin
s:='select * from bargain where 成交日期<:s1 order by 成交日期,成交编号;';
bargainquery.sql.clear;
bargainquery.sql.add(s);
bargainquery.ParamByName('s1').asstring:=datetostr(date8.date);
bargainquery.open;
dbgrid3.datasource:=bargain2source;
end;
end;
end ;
end;
procedure Thouseform.Button8Click(Sender: TObject);
begin
dbgrid3.datasource:=datamodule2.bargainsource;
end;
procedure Thouseform.date8KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
button7.Click();
end;
procedure Thouseform.ComboBox10Change(Sender: TObject);
begin
case combobox10.ItemIndex of
0:printindex:=0;
1:printindex:=1;
2:printindex:=2;
3:printindex:=3;
4:printindex:=4;
end;
if printindex>1 then
begin
date9.visible:=true;
date9.SetFocus;
end else
begin
date9.visible:=false;
edit9.setfocus;
end;
end;
procedure Thouseform.selectprintdata;
var
s,s1:string;
begin
with datamodule2 do
begin
case printindex of
0:begin
printquery.DisableControls;
s:='select * from house';
printquery.close ;
printquery.sql.clear;
printquery.sql.Add(s);
printquery.open;
printquery.EnableControls;
end;
1:begin
printquery.DisableControls;
s:='select * from house where 中介编号=:s1';
printquery.close ;
printquery.sql.clear;
printquery.sql.Add(s);
printquery.ParamByName('s1').asstring:=edit9.text;
printquery.open;
printquery.EnableControls;
end;
2:begin
printquery.DisableControls;
s:='select * from house where 登记日期>:s1';
printquery.close ;
printquery.sql.clear;
printquery.sql.Add(s);
printquery.ParamByName('s1').asstring:=datetostr(date9.date);
printquery.open;
printquery.EnableControls;
end;
3:begin
printquery.DisableControls;
s:='select * from house where 登记日期=:s1';
printquery.close ;
printquery.sql.clear;
printquery.sql.Add(s);
printquery.ParamByName('s1').asstring:=datetostr(date9.date);
printquery.open;
printquery.EnableControls;
end;
4:begin
printquery.DisableControls;
s:='select * from house where 登记日期<:s1';
printquery.close ;
printquery.sql.clear;
printquery.sql.Add(s);
printquery.ParamByName('s1').asstring:=datetostr(date9.date);
printquery.open;
printquery.EnableControls;
end;
end;
end;
end;
procedure Thouseform.SpeedButton5Click(Sender: TObject);
var
printform:tprinthouse1form;
begin
selectprintdata;
printform:=tprinthouse1form.Create(application);
printform.QuickRep1.Preview;
end;
procedure Thouseform.SpeedButton6Click(Sender: TObject);
var
printform:tprinthouse1form;
begin
selectprintdata;
printform:=tprinthouse1form.Create(application);
printform.QuickRep1.Print;
end;
procedure Thouseform.ComboBox12Change(Sender: TObject);
begin
case combobox12.ItemIndex of
0:printindex2:=0;
1:printindex2:=1;
2:printindex2:=2;
3:printindex2:=3;
4:printindex2:=4;
end;
if printindex2>1 then
begin
date12.visible:=true;
date12.SetFocus;
end else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -