📄 searchbysellfm.pas.~6~
字号:
Unit SearchBySellUniT;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, LbSpeedButton, DB, ADODB, Grids, DBGridEh, ExtCtrls,
AAFont, AACtrls, ComCtrls, LbButton, ACReportClass;
Type
TSearchBySellForm = Class(TForm)
AALabel1: TAALabel;
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: TLbSpeedButton;
LbSpeedButton1: TLbSpeedButton;
ADOQuery4: TADOQuery;
DataSource4: TDataSource;
CheckBox1: TCheckBox;
Panel3: TPanel;
AALabel2: TAALabel;
AALabel3: TAALabel;
AALabel4: TAALabel;
AALabel5: TAALabel;
AALabel6: TAALabel;
AALabel7: TAALabel;
AALabel8: TAALabel;
AALabel9: TAALabel;
AALabel10: TAALabel;
AALabel11: TAALabel;
AALabel12: TAALabel;
AALabel13: TAALabel;
AALabel14: TAALabel;
AALabel15: TAALabel;
AALabel16: TAALabel;
AALabel17: TAALabel;
AALabel18: TAALabel;
AALabel19: TAALabel;
AALabel20: TAALabel;
AALabel22: TAALabel;
AALabel23: TAALabel;
AALabel24: TAALabel;
AALabel25: TAALabel;
AALabel26: TAALabel;
AALabel27: TAALabel;
AALabel28: TAALabel;
AALabel29: TAALabel;
AALabel30: TAALabel;
AALabel31: TAALabel;
AALabel32: TAALabel;
AALabel33: TAALabel;
AALabel34: TAALabel;
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: TAALabel;
Panel5: TPanel;
CheckBox2: TCheckBox;
LbButton1: TLbButton;
LbButton2: TLbButton;
LbButton3: TLbButton;
Panel9: TPanel;
Panel6: TPanel;
DBGridEh4: TDBGridEh;
AcReport1: TAcReport;
SaveDialog1: TSaveDialog;
LbButton4: TLbButton;
LbButton5: TLbButton;
AcReport2: TAcReport;
AALabel36: TAALabel;
AALabel21: TAALabel;
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
SearchBySellForm : TSearchBySellForm;
Implementation
Uses DM, ViewUnitUnit, PUBFunction;
{$R *.dfm}
Procedure TSearchBySellForm.FormClose(Sender: TObject;
Var Action: TCloseAction);
Begin
Action := cafree;
SearchBySellForm := Nil;
End;
Procedure TSearchBySellForm.LbSpeedButton2Click(Sender: TObject);
Begin
Close;
End;
Procedure TSearchBySellForm.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 TSearchBySellForm.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 TSearchBySellForm.ADOQuery1AfterScroll(DataSet: TDataSet);
Begin
DBGridEh1CellClick(DBGridEH1.Columns.Items[0]);
End;
Procedure TSearchBySellForm.ADOQuery2AfterScroll(DataSet: TDataSet);
Begin
DBGridEh2CellClick(DBGridEh2.Columns.Items[0]);
End;
Procedure TSearchBySellForm.LbSpeedButton1Click(Sender: TObject);
Begin
ClearSTEXT;
GetCount;
GetRecByTypestr(combobox1.Text);
End;
Procedure TSearchBySellForm.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 := DM.DataModule2.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 + -