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

📄 searchbytimeunit.pas

📁 短小而实用的房地产销售管理软件
💻 PAS
📖 第 1 页 / 共 5 页
字号:
Unit SearchByTimeUnit;

Interface

Uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, AAFont, AACtrls, StdCtrls, LbButton, LbSpeedButton, DB, ADODB,
   Grids, DBGridEh, ExtCtrls, ACReportClass, Mask, DBCtrlsEh, ComCtrls;

Type
   TSearchByTimeForm = 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;
      CheckBox1: TCheckBox;
      LbButton4: TLbButton;
      LbButton5: TLbButton;
      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;
      AALabel35: 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;
      Panel5: TPanel;
      CheckBox2: TCheckBox;
      LbButton1: TLbButton;
      LbButton2: TLbButton;
      LbButton3: TLbButton;
      Panel9: TPanel;
      Panel6: TPanel;
      DBGridEh4: TDBGridEh;
      SaveDialog1: TSaveDialog;
      AcReport1: TAcReport;
      ADOQuery4: TADOQuery;
      DataSource4: TDataSource;
      StaticText41: TStaticText;
      PageControl1: TPageControl;
      TabSheet1: TTabSheet;
      Panel8: TPanel;
      AALabel21: TAALabel;
      ComboBox4: TComboBox;
      TabSheet2: TTabSheet;
      Panel7: TPanel;
      Label13: TLabel;
      Label3: TLabel;
      AALabel37: TAALabel;
      DBDateTimeEditEh1: TDBDateTimeEditEh;
      DBDateTimeEditEh2: TDBDateTimeEditEh;
      AcReport2: TAcReport;
      LbButton6: TLbButton;
      LbButton8: TLbButton;
      LbButton9: TLbButton;
      LbButton10: TLbButton;
      LbButton11: TLbButton;
      LbButton12: TLbButton;
      LbButton13: TLbButton;
      LbButton14: TLbButton;
      TabSheet3: TTabSheet;
      RadioButton1: TRadioButton;
      RadioButton2: TRadioButton;
      RadioButton3: TRadioButton;
      TabSheet4: TTabSheet;
      AALabel36: TAALabel;
      Panel10: TPanel;
      AALabel38: TAALabel;
      AALabel39: TAALabel;
      AALabel40: TAALabel;
      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 + -