⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 housefrm.pas

📁 房屋中介管理系统.支持多用户有不同的权限 采用MDI界面 由于没有打包
💻 PAS
📖 第 1 页 / 共 5 页
字号:

begin
date12.visible:=false;
edit12.setfocus;
end;


end;

procedure Thouseform.Edit9KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if key=13 then selectprintdata;
end;

procedure Thouseform.selechousedetail;
var
  s,s1,s2:string;
begin

with datamodule2 do
begin
case  printindex2 of
0:begin
  printdetail.DisableControls;
  if combobox11.text='买卖用房' then
  s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明  from house where 交易类型=:s1'
else
  s:='select 中介编号,地点,建筑面积,层次,楼高,房型,月租金,建筑年份,水,电,煤气,闭路电视,备注说明  from house where 交易类型=:s1';
  printdetail.close ;
  printdetail.sql.clear;
  printdetail.sql.Add(s);
  if combobox11.text='买卖用房' then   printdetail.ParamByName('s1').asstring:='买卖'
  else printdetail.ParamByName('s1').asstring:='租赁';
  printdetail.open;
  printdetail.EnableControls;
  end;

1:begin
  printdetail.DisableControls;
  if combobox11.text='买卖用房' then
  s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 中介编号=:s2'
else
    s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 中介编号=:s2';
  printdetail.close ;
  printdetail.sql.clear;
  printdetail.sql.Add(s);
 if combobox11.text='买卖用房' then   printdetail.ParamByName('s1').asstring:='买卖'
  else printdetail.ParamByName('s1').asstring:='租赁';
printdetail.ParamByName('s2').asstring:=edit12.Text;
  printdetail.open;
  printdetail.EnableControls;
  end;
2:begin
  printdetail.DisableControls;
  if combobox11.text='买卖用房' then
  s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 登记日期>:s2'
else
    s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 登记日期>:s2';
  printdetail.close ;
  printdetail.sql.clear;
  printdetail.sql.Add(s);
 if combobox11.text='买卖用房' then   printdetail.ParamByName('s1').asstring:='买卖'
  else printdetail.ParamByName('s1').asstring:='租赁';
printdetail.ParamByName('s2').asstring:=datetostr(date12.date);
  printdetail.open;
  printdetail.EnableControls;
  end;
3:begin
  printdetail.DisableControls;
  if combobox11.text='买卖用房' then
  s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 登记日期=:s2'
else
    s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 登记日期=:s2';
  printdetail.close ;
  printdetail.sql.clear;
  printdetail.sql.Add(s);
 if combobox11.text='买卖用房' then   printdetail.ParamByName('s1').asstring:='买卖'
  else printdetail.ParamByName('s1').asstring:='租赁';
printdetail.ParamByName('s2').asstring:=datetostr(date12.date);
  printdetail.open;
  printdetail.EnableControls;
  end;
4:begin
  printdetail.DisableControls;
  if combobox11.text='买卖用房' then
  s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 登记日期<:s2'
else
    s:='select 中介编号,地点,建筑面积,层次,楼高,房型,销售价,建筑年份,水,电,煤气,闭路电视,备注说明 from house where 交易类型=:s1 and 登记日期<:s2';
  printdetail.close ;
  printdetail.sql.clear;
  printdetail.sql.Add(s);
 if combobox11.text='买卖用房' then   printdetail.ParamByName('s1').asstring:='买卖'
  else printdetail.ParamByName('s1').asstring:='租赁';
printdetail.ParamByName('s2').asstring:=datetostr(date12.date);
  printdetail.open;
  printdetail.EnableControls;
  end;
end;
end;
   end;


procedure Thouseform.Edit12KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if key=13 then selechousedetail;
end;

procedure Thouseform.SpeedButton11Click(Sender: TObject);
var
  printform1:tprinthouse2form;
  printform2:tprinthouse3form;
begin
if combobox11.text='买卖用房' then
begin
printform1:=tprinthouse2form.Create(application);
selechousedetail;
printform1.QuickRep1.Preview;
end
else
begin
printform2:=tprinthouse3form.Create(application);
selechousedetail;
printform2.QuickRep1.Preview;
end;
end;

procedure Thouseform.Button3Click(Sender: TObject);
var
  inform:tinputform;
begin
inform:=tinputform.Create(application);
inform.ShowModal;

end;

procedure Thouseform.ToolButton7Click(Sender: TObject);
begin
mainform.N14Click(sender);
end;

procedure Thouseform.ToolButton8Click(Sender: TObject);
begin
mainform.N15Click(sender);
end;

procedure Thouseform.SpeedButton12Click(Sender: TObject);
var
  printform1:tprinthouse2form;
  printform2:tprinthouse3form;
begin

if combobox11.text='买卖用房' then
begin
printform1:=tprinthouse2form.Create(application);
selechousedetail;
printform1.QuickRep1.print;
end
else
begin
printform2:=tprinthouse3form.Create(application);
selechousedetail;
printform2.QuickRep1.print;

end;


end;

procedure Thouseform.ComboBox13Change(Sender: TObject);
begin
if (combobox13.itemindex=0) or (combobox13.itemindex=1)then
begin
 csdata1.visible:=false;
 edit10.SetFocus;
end
else if combobox13.itemindex=2 then

begin
 csdata1.visible:=true;
 csdata1.setfocus;
 end;
end;

procedure Thouseform.SpeedButton7Click(Sender: TObject);

begin
if combobox13.itemindex=0 then
begin
  cstable.SetKey;
  cstable.FieldByName('编号').asstring:=edit10.text;
  if not cstable.GotoKey then showmessage('没有找到此条记录') ;

end
else if combobox13.itemindex=1 then
begin
  cstable.SetKey;
  cstable.FieldByName('标题').asstring:=edit10.text;
  cstable.GotoNearest;

end
else if combobox13.itemindex=2 then
begin
  cstable.SetKey;
  cstable.FieldByName('录入日期').asstring:=datetostr(csdata1.Date);
  if not cstable.Gotokey then showmessage('没有找到此记录!');

end;
    end;
procedure Thouseform.csedit1KeyPress(Sender: TObject; var Key: Char);
begin
key:=#0;
end;



procedure Thouseform.csdatasourceDataChange(Sender: TObject;
  Field: TField);
begin
csedit1.text:=cs1.AsString;
csedit2.text:=cs2.AsString;
csmemo.Lines.text:=cs3.Value;
csdate2.date:=cs4.Value;
end;

procedure Thouseform.Button10Click(Sender: TObject);
var
 s:string;
begin
cstable.DisableControls;
cstable.edit;
s:=csedit1.Text;
cs2.asstring:=csedit2.text;
cs3.value:=csmemo.Lines.Text;
cs4.asstring:=datetostr(csdate2.date);
cstable.post;
cstable.close ;
cstable.open;
cstable.FindKey([s]);
cstable.Enablecontrols;

end;

procedure Thouseform.Button9Click(Sender: TObject);
begin
cstable.DisableControls;
cstable.Append;

cs2.asstring:=csedit2.text;
cs3.value:=csmemo.Lines.Text;
cs4.asstring:=datetostr(csdate2.date);
cstable.post;
cstable.close ;
cstable.open;
cstable.Last;
cstable.Enablecontrols;
end;

procedure Thouseform.fgdatasourceDataChange(Sender: TObject;
  Field: TField);
begin
fgedit1.text:=fg1.AsString;
fgedit2.text:=fg2.AsString;
fgmemo.Lines.text:=fg3.Value;
fgdate2.date:=fg4.Value;

end;

procedure Thouseform.Button11Click(Sender: TObject);
begin
fgtable.DisableControls;
fgtable.Append;
fg2.asstring:=fgedit2.text;
fg3.value:=fgmemo.Lines.Text;
fg4.asstring:=datetostr(fgdate2.date);
fgtable.post;
fgtable.close ;
fgtable.open;
fgtable.Last;
fgtable.Enablecontrols;

end;

procedure Thouseform.Button12Click(Sender: TObject);
var
 s:string;
begin
fgtable.DisableControls;
fgtable.edit;
s:=fgedit1.Text;
fg2.asstring:=fgedit2.text;
fg3.value:=fgmemo.Lines.Text;
fg4.asstring:=datetostr(fgdate2.date);
fgtable.post;
fgtable.close ;
fgtable.open;
fgtable.FindKey([s]);
fgtable.Enablecontrols;



end;

procedure Thouseform.fgedit1KeyPress(Sender: TObject; var Key: Char);
begin
key:=#0;
end;

procedure Thouseform.changedbchar;
var
  s:string;
begin
case planradiogroup2.ItemIndex of
0:begin
   s:='select * from count where 交易类型=:atype and 年份=:year order by 月份';
   planquery.Close;
   series1.XLabelsSource:='';
   series1.YValues.ValueSource:='';
   planquery.SQL.Clear;
   planquery.SQL.Add(s);
   if planradiogroup1.itemindex=0 then
    planquery.Params[0].AsString:='买卖' else
    planquery.Params[0].AsString:='租赁';
   planquery.Params[1].AsInteger:=strtoint(plancombobox.Text);
   planquery.Open;
   series1.DataSource:=planquery;
   series1.XLabelsSource:=planquery.Fields[2].FieldName;
   series1.YValues.ValueSource:=planquery.Fields[3].FieldName;
   dbchart1.Title.Text.Text:='销售套数统计表';

   end;
1:begin
   s:='select * from money1 where 交易类型=:atype and 年份=:year order by 月份';
   planquery.Close;
   series1.XLabelsSource:='';
   series1.YValues.ValueSource:='' ;
   planquery.SQL.Clear;
   planquery.SQL.Add(s);
   if planradiogroup1.itemindex=0 then
  planquery.Params[0].AsString:='买卖' else
  planquery.Params[0].AsString:='租赁';
  planquery.Params[1].AsInteger:=strtoint(plancombobox.Text);
   planquery.Open;
 series1.DataSource:=planquery;
 series1.XLabelsSource:=planquery.Fields[2].FieldName;
 series1.YValues.ValueSource:=planquery.Fields[3].FieldName;
 dbchart1.Title.Text.Text:='销售金额统计表';
  end;
2:begin
   s:='select * from area where 交易类型=:atype and 年份=:year order by 月份';
   planquery.Close;
   series1.XLabelsSource:='';
   series1.YValues.ValueSource:='';
   planquery.SQL.Clear;
   planquery.SQL.Add(s);
   if planradiogroup1.itemindex=0 then
    planquery.Params[0].AsString:='买卖' else
    planquery.Params[0].AsString:='租赁';
   planquery.Params[1].AsInteger:=strtoint(plancombobox.Text);
   planquery.Open;
   series1.DataSource:=planquery;
   series1.XLabelsSource:=planquery.Fields[2].FieldName;
   series1.YValues.ValueSource:=planquery.Fields[3].FieldName;
   dbchart1.Title.Text.Text:='销售面积统计表';
  end;
3:begin
   s:='select * from model where 交易类型=:atype and 年份=:year order by 房型';
   planquery.Close;
   series1.XLabelsSource:='';
   series1.YValues.ValueSource:='' ;
   planquery.SQL.Clear;
   planquery.SQL.Add(s);
   if planradiogroup1.itemindex=0 then
    planquery.Params[0].AsString:='买卖' else
    planquery.Params[0].AsString:='租赁';
   planquery.Params[1].AsInteger:=strtoint(plancombobox.Text);
   planquery.Open;
   series1.DataSource:=planquery;
   series1.XLabelsSource:=planquery.Fields[2].FieldName;
   series1.YValues.ValueSource:=planquery.Fields[3].FieldName;
   dbchart1.Title.Text.Text:='销售房型统计表';
  end;
4:begin
   s:='select * from floor where 交易类型=:atype and 年份=:year order by 层次';
   planquery.Close;
   series1.XLabelsSource:='';
   series1.YValues.ValueSource:='';
   planquery.SQL.Clear;
   planquery.SQL.Add(s);
   if planradiogroup1.itemindex=0 then
    planquery.Params[0].AsString:='买卖' else
    planquery.Params[0].AsString:='租赁';
   planquery.Params[1].AsInteger:=strtoint(plancombobox.Text);
   planquery.Open;
   series1.DataSource:=planquery;
   series1.XLabelsSource:=planquery.Fields[2].FieldName;
   series1.YValues.ValueSource:=planquery.Fields[3].FieldName;
   dbchart1.Title.Text.Text:='销售层次统计表';
  end;
5:begin
   s:='select * from place where 交易类型=:atype and 年份=:year order by 地点';
   planquery.Close;
   series1.XLabelsSource:='';
   series1.YValues.ValueSource:='';
   planquery.SQL.Clear;
   planquery.SQL.Add(s);
   if planradiogroup1.itemindex=0 then
    planquery.Params[0].AsString:='买卖' else
    planquery.Params[0].AsString:='租赁';
   planquery.Params[1].AsInteger:=strtoint(plancombobox.Text);
   planquery.Open;
   series1.DataSource:=planquery;
   series1.XLabelsSource:=planquery.Fields[2].FieldName;
   series1.YValues.ValueSource:=planquery.Fields[3].FieldName;
   dbchart1.Title.Text.Text:='销售地点统计表';
  end;
end;
end;

procedure Thouseform.planRadioGroup1Click(Sender: TObject);
begin
changedbchar;
end;

procedure Thouseform.planComboBoxChange(Sender: TObject);
begin
if plancombobox.Text<>'' then
changedbchar;
end;

procedure Thouseform.planRadioGroup2Click(Sender: TObject);
begin
changedbchar;
end;

procedure Thouseform.DBGrid2DblClick(Sender: TObject);
var
  TypeStr:string;
   buyform2:tbuyform;
   hireform2:thireform;
begin
TypeStr:=datamodule2.inputtable.Fields[8].AsString;
if TypeStr='买卖' then
    begin
      buyform2:=tbuyform.Create(application);
      buyform2.ShowModal;
      buyform2.Caption:=typestr;
    end
else if TypeStr='租赁'  then
    begin
      hireform2:=thireform.Create(application);
      hireform2.ShowModal;
      hireform2.Caption:=typestr;
    end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -