📄 searchbysellfm.pas.~10~
字号:
Unit SearchBySellFM;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, Grids, DBGridEh, ExtCtrls, ComCtrls,GridsEh,
Buttons;
Type
TfrmSearchBySell = Class(TForm)
AALabel1: TLabel;
Panel1: TPanel;
Splitter3: TSplitter;
Splitter2: TSplitter;
Splitter4: TSplitter;
DBGridEH1: TDBGridEh;
DBGridEh2: TDBGridEh;
DBGridEh3: TDBGridEh;
DataSource1: TDataSource;
ADOQuery1: TADOQuery;
DataSource2: TDataSource;
ADOQuery2: TADOQuery;
DataSource3: TDataSource;
ADOQuery3: TADOQuery;
Panel2: TPanel;
Panel4: TPanel;
LbSpeedButton2: TSpeedButton;
LbSpeedButton1: TSpeedButton;
ADOQuery4: TADOQuery;
DataSource4: TDataSource;
CheckBox1: TCheckBox;
Panel3: TPanel;
AALabel2: TLabel;
AALabel3: TLabel;
AALabel4: TLabel;
AALabel5: TLabel;
AALabel6: TLabel;
AALabel7: TLabel;
AALabel8: TLabel;
AALabel9: TLabel;
AALabel10: TLabel;
AALabel11: TLabel;
AALabel12: TLabel;
AALabel13: TLabel;
AALabel14: TLabel;
AALabel15: TLabel;
AALabel16: TLabel;
AALabel17: TLabel;
AALabel18: TLabel;
AALabel19: TLabel;
AALabel20: TLabel;
AALabel22: TLabel;
AALabel23: TLabel;
AALabel24: TLabel;
AALabel25: TLabel;
AALabel26: TLabel;
AALabel27: TLabel;
AALabel28: TLabel;
AALabel29: TLabel;
AALabel30: TLabel;
AALabel31: TLabel;
AALabel32: TLabel;
AALabel33: TLabel;
AALabel34: TLabel;
StaticText1: TStaticText;
StaticText2: TStaticText;
StaticText3: TStaticText;
StaticText4: TStaticText;
StaticText5: TStaticText;
StaticText6: TStaticText;
StaticText7: TStaticText;
StaticText8: TStaticText;
StaticText9: TStaticText;
StaticText10: TStaticText;
StaticText11: TStaticText;
StaticText12: TStaticText;
StaticText13: TStaticText;
StaticText14: TStaticText;
StaticText15: TStaticText;
StaticText16: TStaticText;
StaticText17: TStaticText;
StaticText18: TStaticText;
StaticText19: TStaticText;
StaticText20: TStaticText;
StaticText21: TStaticText;
StaticText22: TStaticText;
StaticText23: TStaticText;
StaticText24: TStaticText;
StaticText25: TStaticText;
StaticText26: TStaticText;
StaticText27: TStaticText;
StaticText28: TStaticText;
StaticText29: TStaticText;
StaticText30: TStaticText;
StaticText31: TStaticText;
StaticText32: TStaticText;
StaticText33: TStaticText;
StaticText34: TStaticText;
StaticText35: TStaticText;
StaticText36: TStaticText;
StaticText37: TStaticText;
StaticText38: TStaticText;
StaticText39: TStaticText;
StaticText40: TStaticText;
AALabel35: TLabel;
Panel5: TPanel;
CheckBox2: TCheckBox;
LbButton1: TButton;
LbButton2: TButton;
LbButton3: TButton;
Panel9: TPanel;
Panel6: TPanel;
DBGridEh4: TDBGridEh;
SaveDialog1: TSaveDialog;
LbButton4: TButton;
LbButton5: TButton;
AALabel36: TLabel;
AALabel21: TLabel;
combobox1: TComboBox;
StaticText41: TStaticText;
Procedure ClearSTEXT;
Procedure GetCount;
Procedure GetRecByTypestr(stype: String);
Procedure GetReportFile2();
Procedure GetReportFile1();
Procedure FormClose(Sender: TObject; Var Action: TCloseAction);
Procedure LbSpeedButton2Click(Sender: TObject);
Procedure DBGridEh1CellClick(Column: TColumnEh);
Procedure DBGridEh2CellClick(Column: TColumnEh);
Procedure ADOQuery1AfterScroll(DataSet: TDataSet);
Procedure ADOQuery2AfterScroll(DataSet: TDataSet);
Procedure LbSpeedButton1Click(Sender: TObject);
Procedure LbButton1Click(Sender: TObject);
Procedure LbButton2Click(Sender: TObject);
Procedure LbButton4Click(Sender: TObject);
Procedure DBGridEh4DblClick(Sender: TObject);
Private
{ Private declarations }
Public
{ Public declarations }
End;
Var
frmSearchBySell : TfrmSearchBySell;
Implementation
Uses MainDM, ViewUnitFM, PUBFunction;
{$R *.dfm}
Procedure TfrmSearchBySell.FormClose(Sender: TObject;
Var Action: TCloseAction);
Begin
Action := cafree;
frmSearchBySell := Nil;
End;
Procedure TfrmSearchBySell.LbSpeedButton2Click(Sender: TObject);
Begin
Close;
End;
Procedure TfrmSearchBySell.DBGridEh1CellClick(Column: TColumnEh);
Begin
With ADOQuery2 Do Begin
sql.Text :=
'select * FROM 项目信息表 WHERE 公司编号=''' +
ADOQuery1.fieldbyname('公司编号').Text + '''';
open;
End;
DBGridEh2CellClick(DBGridEh2.Columns.Items[0]);
End;
Procedure TfrmSearchBySell.DBGridEh2CellClick(Column: TColumnEh);
Begin
With ADOQuery3 Do Begin
sql.Text :=
'SELECT * from 单体信息表 WHERE 公司编号=''' +
ADOQuery1.fieldbyname('公司编号').Text + ''' and 项目编号=''' +
ADOQuery2.fieldbyname('项目编号').Text + '''';
open;
End;
CheckBox1.Caption := '查询整个[' + ADOQuery2.fieldbyname('项目名称').Text +
']项目';
End;
Procedure TfrmSearchBySell.ADOQuery1AfterScroll(DataSet: TDataSet);
Begin
DBGridEh1CellClick(DBGridEH1.Columns.Items[0]);
End;
Procedure TfrmSearchBySell.ADOQuery2AfterScroll(DataSet: TDataSet);
Begin
DBGridEh2CellClick(DBGridEh2.Columns.Items[0]);
End;
Procedure TfrmSearchBySell.LbSpeedButton1Click(Sender: TObject);
Begin
ClearSTEXT;
GetCount;
GetRecByTypestr(combobox1.Text);
End;
Procedure TfrmSearchBySell.GetCount;
Var
wstr1 : String;
ADOC : TADOQuery;
Begin
wstr1 := ' 公司编号=''' + ADOQuery1.fieldbyname('公司编号').Text +
''' AND 项目编号=''' + ADOQuery2.fieldbyname('项目编号').Text + '''';
If Not (CheckBox1.Checked) Then
wstr1 := wstr1 + ' and 幢号=''' + ADOQuery3.fieldbyname('幢号').Text +
'''';
ADOC := TADOQuery.create(self);
With ADOC Do Begin
connection := DMMain.ADOConnection1;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1;
open;
StaticText1.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''预(销)售''';
open;
StaticText2.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''抵押''';
open;
StaticText3.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''租赁''';
open;
StaticText4.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''预定''';
open;
StaticText5.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''预留''';
open;
StaticText6.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''拆迁还建''';
open;
StaticText7.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''未售''';
open;
StaticText8.Caption := fieldbyname('SUM1').Text;
//面积完毕
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1;
open;
StaticText37.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''预(销)售''';
open;
StaticText9.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''抵押''';
open;
StaticText10.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''租赁''';
open;
StaticText11.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''预定''';
open;
StaticText12.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''预留''';
open;
StaticText13.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''拆迁还建''';
open;
StaticText14.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select count(合同约定建筑面积) as sum1 from 单元信息表 where '
+
wstr1 + ' and 销售类型=''未售''';
open;
StaticText15.Caption := fieldbyname('SUM1').Text;
//套数完成
wstr1 := wstr1 + ' and 是否过期=FALSE';
sql.Text := 'select sum(成交总价) as sum1 from 单元预售表 where ' +
wstr1;
open;
StaticText16.Caption := fieldbyname('SUM1').Text;
sql.Text := 'select sum(抵押贷款额) as sum1 from 单元抵押表 where ' +
wstr1;
open;
StaticText17.Caption := fieldbyname('SUM1').Text;
sql.Text :=
'select sum(已交租金) as sum1,sum(未交租金) as sum2 from 单元租赁表 where ' +
wstr1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -