📄 pas_houserent.~pas
字号:
if(rb_fd.Checked) then
begin
try
with dm.Query_houserent do
begin
close;
sql.clear;
sql.Text:='select ho_contractno 合同编号,ho_no 房子编号,ho_landlord 房东编号,ho_deputy 代理人编号,ho_starttime 开始时间,ho_leavetime 结束时间,ho_rent 租金,ho_rentunit 租金单位,ho_remarks 备注 from house_histry where ho_contractno like ''%'+
edit_contractno.Text+'%'' and ho_client is null';
open;
if dm.query_houserent.RecordCount=0 then
begin
showmessage('没有这个合同');
exit;
end;
edit_contractNo.Text:=fields.Fields[0].AsString;
cb_ho.Text:=fields.Fields[1].AsString;
cb_no.Text:=fields.Fields[2].AsString;
cb_dl.Text:=fields.Fields[3].AsString;
dtp_start.DateTime:=fields.Fields[4].AsDateTime;
dtp_end.DateTime:=fields.Fields[5].AsDateTime;
edit_rentfee.text:=fields.Fields[6].AsString;
cb_unit.Text:=fields.Fields[7].AsString;
edit_remarks.text:=fields.Fields[8].AsString;
end;
except
showmessage('查询失败');
end;
exit;
end;
end;
procedure TForm_constract.SpeedButton4Click(Sender: TObject);
begin
try
with dm.Query_houserent do
begin
close;
sql.clear;
sql.Text:='select ho_contractno 合同编号,ho_no 房子编号,isNULL(ho_landlord,ho_client) 房东或者客户编号,ho_deputy 代理人编号,ho_starttime 开始时间,'+
'ho_leavetime 结束时间,ho_rent 租金,'+
'ho_rentunit 租金单位,ho_remarks 备注 ,ho_validorno 有无效 from house_histry where ho_no like ''%'+
trim(cb_ho.Text)+'%'' order by ho_autono';
open;
if dm.query_houserent.RecordCount=0 then
begin
showmessage('没有这个合同');
exit;
end;
edit_contractNo.Text:=fields.Fields[0].AsString;
cb_ho.Text:=fields.Fields[1].AsString;
cb_no.Text:=fields.Fields[2].AsString;
cb_dl.Text:=fields.Fields[3].AsString;
dtp_start.DateTime:=fields.Fields[4].AsDateTime;
dtp_end.DateTime:=fields.Fields[5].AsDateTime;
edit_rentfee.text:=fields.Fields[6].AsString;
cb_unit.Text:=fields.Fields[7].AsString;
edit_remarks.text:=fields.Fields[8].AsString;
end;
except
showmessage('查询失败');
end;
end;
procedure TForm_constract.SpeedButton6Click(Sender: TObject);
begin
if(rb_kh.Checked) then
begin
try
with dm.Query_houserent do
begin
close;
sql.clear;
sql.Text:='select ho_contractno 合同编号,ho_no 房子编号,ho_client 客户编号,'+
'ho_deputy 代理人编号,ho_starttime 开始时间,ho_leavetime 结束时间,ho_rent 租金,'+
' ho_rentunit 租金单位,ho_remarks 备注,ho_validorno 有无效 from house_histry where ho_depart like ''%'+
cb_depart.Text+'%'' and ho_landlord is null and ho_validorno=1 order by ho_autono';
open;
if dm.query_houserent.RecordCount=0 then
begin
showmessage('没有这个合同');
exit;
end;
edit_contractNo.Text:=fields.Fields[0].AsString;
cb_ho.Text:=fields.Fields[1].AsString;
cb_no.Text:=fields.Fields[2].AsString;
cb_dl.Text:=fields.Fields[3].AsString;
dtp_start.DateTime:=fields.Fields[4].AsDateTime;
dtp_end.DateTime:=fields.Fields[5].AsDateTime;
edit_rentfee.text:=fields.Fields[6].AsString;
cb_unit.Text:=fields.Fields[7].AsString;
edit_remarks.text:=fields.Fields[8].AsString;
l_num.Caption:=inttostr(dm.query_houserent.RecordCount);
end;
except
showmessage('查询失败');
end;
end;
if(rb_fd.Checked) then
begin
try
with dm.Query_houserent do
begin
close;
sql.clear;
sql.Text:='select ho_contractno 合同编号,ho_no 房子编号,ho_landlord 房东编号,'+
'ho_deputy 代理人编号,ho_starttime 开始时间,ho_leavetime 结束时间,ho_rent 租金,'+
' ho_rentunit 租金单位,ho_remarks 备注,ho_validorno 有无效 from house_histry where ho_depart like ''%'+
cb_depart.Text+'%'' and ho_client is null and ho_validorno=1 order by ho_autono';
open;
if dm.query_houserent.RecordCount=0 then
begin
showmessage('没有这个合同');
exit;
end;
edit_contractNo.Text:=fields.Fields[0].AsString;
cb_ho.Text:=fields.Fields[1].AsString;
cb_no.Text:=fields.Fields[2].AsString;
cb_dl.Text:=fields.Fields[3].AsString;
dtp_start.DateTime:=fields.Fields[4].AsDateTime;
dtp_end.DateTime:=fields.Fields[5].AsDateTime;
edit_rentfee.text:=fields.Fields[6].AsString;
cb_unit.Text:=fields.Fields[7].AsString;
edit_remarks.text:=fields.Fields[8].AsString;
l_num.Caption:=inttostr(dm.query_houserent.RecordCount);
end;
except
showmessage('查询失败');
end;
end;
end;
procedure TForm_constract.sb_fksjClick(Sender: TObject);
var
s:string;
begin
if edit_contractNo.Text='' then
begin
showmessage('合同号不能为空');
exit;
end;
with pas_dm.DM.AQ1 do
begin
close;
sql.Clear;
s:='select hi_cno 合同编号,hi_times 付款次数,hi_fktime 付款时间,hi_fkorno 付款没有,hi_days 提前天数 from hint where hi_cno='''+trim(edit_contractNO.text)+'''';
sql.Add(s);
open;
if dm.AQ1.RecordCount = 0 then
begin
showmessage('这个合同的付款时间未设置');
exit;
end;
end;
end;
procedure TForm_constract.Edit_timesKeyPress(Sender: TObject; var Key: Char);
var
s:string;
begin
if key<>#13 then exit;
if edit_contractNo.Text='' then
begin
showmessage('合同号不能为空');
exit;
end;
try
strtoint(Edit_times.text);
except
end;
if IDOK=messagebox(handle,pchar('确定'+edit_contractNo.Text+'合同是要付款 '+Edit_times.Text+' 次吗???'),'警告', MB_OKCANCEL) then
begin
if edit_contractNo.Text='' then
begin
showmessage('合同号不能为空');
exit;
end;
with pas_dm.DM.AQ1 do
begin
close;
sql.Clear;
s:='select ho_contractno 合同编号 from house_histry where ho_contractno='''+trim(edit_contractNo.text)+'''';
sql.Add(s);
open;
if dm.AQ1.RecordCount = 0 then
begin
showmessage('没有合同号');
exit;
end;
if application.FindComponent('Form_inputtime')=nil then
begin
application.CreateForm(TForm_inputtime,Form_inputtime);
end;
try
Form_inputtime.ShowModal;
except
showmessage('窗口显示错误');
Form_inputtime.Free;
Form_inputtime:=nil;
end;
end;
end;
end;
procedure TForm_constract.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_F1 then
begin
speedbutton4.Click;
Key := 0;
exit;
end;
if Key = VK_F2 then
begin
speedbutton5.Click;
Key := 0;
exit;
end;
if Key = VK_F3 then
begin
speedbutton6.Click;
Key := 0;
exit;
end;
if Key = VK_F4 then
begin
add.Click;
Key := 0;
exit;
end;
end;
procedure TForm_constract.SpeedButton5Click(Sender: TObject);
begin
try
with dm.Query_houserent do
begin
close;
sql.clear;
sql.Text:='select ho_contractno 合同编号,ho_no 房子编号,isNULL(ho_landlord,ho_client) 房东或者客户编号,ho_deputy 代理人编号,ho_starttime 开始时间,ho_leavetime 结束时间,ho_rent 租金,ho_rentunit 租金单位,ho_remarks 备注,ho_validorno 有无效'+
' from house_histry where ho_landlord like ''%'+
cb_no.Text+'%'' or ho_client like ''%'+cb_no.Text+'%'' order by ho_autono';
open;
if dm.query_houserent.RecordCount=0 then
begin
showmessage('客户、房东没有合同');
exit;
end;
edit_contractNo.Text:=fields.Fields[0].AsString;
cb_ho.Text:=fields.Fields[1].AsString;
cb_no.Text:=fields.Fields[2].AsString;
cb_dl.Text:=fields.Fields[3].AsString;
dtp_start.DateTime:=fields.Fields[4].AsDateTime;
dtp_end.DateTime:=fields.Fields[5].AsDateTime;
edit_rentfee.text:=fields.Fields[6].AsString;
cb_unit.Text:=fields.Fields[7].AsString;
edit_remarks.text:=fields.Fields[8].AsString;
end;
except
showmessage('查询失败');
end;
end;
procedure TForm_constract.sp_noTClick(Sender: TObject);
begin
if(rb_kh.Checked) then
begin
try
with dm.Query_houserent do
begin
close;
sql.clear;
sql.Text:='select ho_contractno 合同编号,ho_no 房子编号,ho_client 客户编号,ho_deputy 代理人编号,ho_starttime 合同开始时间,ho_leavetime 合同结束时间,ho_rent 合同租金,'+
' ho_rentunit 租金单位,ho_remarks 备注 from house_histry where ho_contractno not in (select hi_cno from hint) and ho_landlord is null order by ho_autono';
open;
if dm.query_houserent.RecordCount=0 then
begin
showmessage('没有这个合同');
exit;
end;
edit_contractNo.Text:=fields.Fields[0].AsString;
cb_ho.Text:=fields.Fields[1].AsString;
cb_no.Text:=fields.Fields[2].AsString;
cb_dl.Text:=fields.Fields[3].AsString;
dtp_start.DateTime:=fields.Fields[4].AsDateTime;
dtp_end.DateTime:=fields.Fields[5].AsDateTime;
edit_rentfee.text:=fields.Fields[6].AsString;
cb_unit.Text:=fields.Fields[7].AsString;
edit_remarks.text:=fields.Fields[8].AsString;
end;
except
showmessage('查询失败');
end;
exit;
end;
if(rb_fd.Checked) then
begin
try
with dm.Query_houserent do
begin
close;
sql.clear;
sql.Text:='select ho_contractno 合同编号,ho_no 房子编号,ho_landlord 房东编号,ho_deputy 代理人编号,ho_starttime 开始时间,ho_leavetime 结束时间,ho_rent 租金,ho_rentunit 租金单位,ho_remarks 备注 '+
' from house_histry where ho_contractno not in (select hi_cno from hint)and ho_client is null';
open;
if dm.query_houserent.RecordCount=0 then
begin
showmessage('没有这个合同');
exit;
end;
edit_contractNo.Text:=fields.Fields[0].AsString;
cb_ho.Text:=fields.Fields[1].AsString;
cb_no.Text:=fields.Fields[2].AsString;
cb_dl.Text:=fields.Fields[3].AsString;
dtp_start.DateTime:=fields.Fields[4].AsDateTime;
dtp_end.DateTime:=fields.Fields[5].AsDateTime;
edit_rentfee.text:=fields.Fields[6].AsString;
cb_unit.Text:=fields.Fields[7].AsString;
edit_remarks.text:=fields.Fields[8].AsString;
end;
except
showmessage('查询失败');
end;
exit;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -