📄 searchbytimefm.pas.~2~
字号:
Unit SearchByTimeUnit;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,DB, ADODB,Grids, DBGridEh, ExtCtrls,Mask, DBCtrlsEh, ComCtrls,
Buttons, GridsEh, LbButton, LbSpeedButton;
Type
TSearchByTimeForm = 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;
CheckBox1: TCheckBox;
LbButton4: TButton;
LbButton5: TButton;
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;
AALabel35: 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;
Panel5: TPanel;
CheckBox2: TCheckBox;
LbButton1: TButton;
LbButton2: TButton;
LbButton3: TButton;
Panel9: TPanel;
Panel6: TPanel;
DBGridEh4: TDBGridEh;
SaveDialog1: TSaveDialog;
// AcReport1: TAcReport;
ADOQuery4: TADOQuery;
DataSource4: TDataSource;
StaticText41: TStaticText;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Panel8: TPanel;
AALabel21: TLabel;
ComboBox4: TComboBox;
TabSheet2: TTabSheet;
Panel7: TPanel;
Label13: TLabel;
Label3: TLabel;
AALabel37: TLabel;
DBDateTimeEditEh1: TDBDateTimeEditEh;
DBDateTimeEditEh2: TDBDateTimeEditEh;
// AcReport2: TAcReport;
LbButton6: TButton;
LbButton8: TButton;
LbButton9: TButton;
LbButton10: TButton;
LbButton11: TButton;
LbButton12: TButton;
LbButton13: TButton;
LbButton14: TButton;
TabSheet3: TTabSheet;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
TabSheet4: TTabSheet;
AALabel36: TLabel;
Panel10: TPanel;
AALabel38: TLabel;
AALabel39: TLabel;
AALabel40: TLabel;
combobox1: TComboBox;
ComboBox3: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit;
Procedure GetReportFile2;
Procedure ClearSTEXT;
Procedure GetReportFile1(LB8Index: integer);
Procedure GetCount;
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 LbButton1Click(Sender: TObject);
Procedure LbButton2Click(Sender: TObject);
Procedure LbButton4Click(Sender: TObject);
Procedure LbButton6Click(Sender: TObject);
Procedure LbSpeedButton1Click(Sender: TObject);
Procedure LbButton8Click(Sender: TObject);
Procedure DBGridEh4DblClick(Sender: TObject);
Procedure ComboBox1Change(Sender: TObject);
Private
{ Private declarations }
Public
{ Public declarations }
End;
Var
SearchByTimeForm : TSearchByTimeForm;
LB8I : integer;
Implementation
Uses DM, PUBFunction, ViewUnitUnit;
{$R *.dfm}
Procedure TSearchByTimeForm.FormClose(Sender: TObject;
Var Action: TCloseAction);
Begin
Action := cafree;
SearchByTimeForm := Nil;
End;
Procedure TSearchByTimeForm.LbSpeedButton2Click(Sender: TObject);
Begin
Close;
End;
Procedure TSearchByTimeForm.DBGridEh1CellClick(Column: TColumnEh);
Var
SL : TStringlist;
Begin
With ADOQuery2 Do Begin
sql.Text :=
'select * FROM 项目信息表 WHERE 公司编号=''' +
ADOQuery1.fieldbyname('公司编号').Text + '''';
open;
SL := TStringlist.create;
SL := PUBFunction.Split(fieldbyname('规划用途').Text, '_');
ComboBox4.Items := SL;
SL.Free;
End;
DBGridEh2CellClick(DBGridEh2.Columns.Items[0]);
End;
Procedure TSearchByTimeForm.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 TSearchByTimeForm.ADOQuery1AfterScroll(DataSet: TDataSet);
Begin
DBGridEh1CellClick(DBGridEH1.Columns.Items[0]);
End;
Procedure TSearchByTimeForm.ADOQuery2AfterScroll(DataSet: TDataSet);
Begin
DBGridEh2CellClick(DBGridEh2.Columns.Items[0]);
End;
Procedure TSearchByTimeForm.LbButton1Click(Sender: TObject);
Begin
SaveDBGridEhToFile(ADOQuery4, DBGridEh4, SaveDialog1);
End;
Procedure TSearchByTimeForm.LbButton2Click(Sender: TObject);
Begin
If (ADOQuery4.Active = false) Then Exit;
If (ADOQuery4.recordcount = 0) Then Exit;
GetReportFile1(LB8I);
Application.ProcessMessages;
Case TLbButton(Sender).tag Of
100: AcReport1.Preview;
101: AcReport1.Print;
End;
End;
Procedure TSearchByTimeForm.LbButton4Click(Sender: TObject);
Begin
GetReportFile2();
Application.ProcessMessages;
Case TLbButton(Sender).tag Of
200: AcReport2.Preview;
201: AcReport2.Print;
End;
End;
Procedure TSearchByTimeForm.LbButton6Click(Sender: TObject);
Var
s : pchar;
Begin
s := '按日期查询说明如下:' + #13 +
'在选中了按日期查询的选项框后,即可填写日期查询条件,' + #13 +
'这时的日期对应不同的销售类型,其意义也随之不同。' + #13 + #13 +
'预售、拆迁还建:日期代表:合同签订日期' + #13 +
'抵押:日期代表:抵押起始日期' + #13 +
'租赁:日期代表:租赁登记日期' + #13 +
'预定:日期代表:认购书签订日期' + #13 +
'预留:日期代表:预留起始日期' + #13 +
'未售:日期代表:待售起始日期';
Application.MessageBox(s, '日期查询说明', MB_ICONINFORMATION);
End;
Procedure TSearchByTimeForm.GetReportFile2();
Var
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -