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

📄 czfcx.pas

📁 房屋出租信息管理系统,房屋出租信息的录入、查询、删除以及用户管理等功能
💻 PAS
字号:
unit CzfCx;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, StdCtrls, Buttons, Grids, DBGrids, ExtCtrls;

type
  TCzfCxForm = class(TForm)
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    ADQ_CzFcx: TADOQuery;
    DS_CzFcx: TDataSource;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Ed_Fh: TEdit;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Com_Fx: TComboBox;
    Com_Cx: TComboBox;
    Ed_Yz: TEdit;
    GroupBox2: TGroupBox;
    BitBtn_find: TBitBtn;
    Rad_Yzf: TRadioButton;
    Rad_Wzf: TRadioButton;
    BBtn_Print: TBitBtn;
    procedure FormClose(Sender: TObject; var Action: TCloseAction); 
    procedure BitBtn_findClick(Sender: TObject);
    procedure BBtn_PrintClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  CzfCxForm: TCzfCxForm;

implementation

uses Cbreport, Unit_common_files,DateUtils;

{$R *.dfm}

procedure TCzfCxForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action   :=cafree;
  CzfCxForm:=nil;
end;

procedure TCzfCxForm.BitBtn_findClick(Sender: TObject);
begin
    ADQ_CzFcx.Close ;
    ADQ_CzFcx.SQL.Clear ;
    ADQ_CzFcx.SQL.Add('SELECT A.fangno, A.area, A.housetype, A.facetype,');
    ADQ_CzFcx.SQL.Add(' A.Sb, A.fangya, A.fangprice, A.Ljf, ');
    ADQ_CzFcx.SQL.Add('case B.status when ''1'' then ''已出租'' else ''未出租'' end as status');
    ADQ_CzFcx.SQL.Add('FROM dbo.Zf_Fangjian A LEFT OUTER JOIN');
    ADQ_CzFcx.SQL.Add('dbo.Zf_Rz B ON A.fangno = B.fangno');
    ADQ_CzFcx.SQL.Add('where A.fangno like '''+trim(Ed_Fh.Text)+'%'+'''');
 if Ed_Yz.Text <>'' then
    ADQ_CzFcx.SQL.Add('and A.fangprice='''+Ed_Yz.Text+'''');
 if Com_Cx.Text<>''  then
    ADQ_CzFcx.SQL.Add('and A.facetype='''+trim(Com_Cx.Text)+'''');
 if Com_Fx.Text<>''  then
    ADQ_CzFcx.SQL.Add('and A.housetype='''+Com_FX.Text+'''');
 if Rad_Wzf.Checked =true then
     ADQ_CzFcx.SQL.Add('and (B.status is null or B.status=0)')
else
     ADQ_CzFcx.SQL.Add('and B.status =1');

    ADQ_CzFcx.Close  ;
    ADQ_CzFcx.Open ;
 if ADQ_CzFcx.IsEmpty  then
    begin
      messagebox(0,'没有查到符合条件的记录','余科华提示',Mb_OK+MB_ICONWARNING);
      Ed_Fh.SetFocus ;
      exit;
    end;  
end;

procedure TCzfCxForm.BBtn_PrintClick(Sender: TObject);
begin
  if ADQ_CzFcx.IsEmpty then
     begin
       messagebox(0,'请查询后再打印!','余科华提示',MB_OK+MB_ICONWARNING);
       exit;
     end
  else
     begin
         BbForm_report:=TBbForm_report.Create(nil);
      try
         BbForm_report.QRL_printdate.Caption   :=inttostr(yearof(date))+'年'+inttostr(monthof(date))+'月'+inttostr(dayof(date))+'日';
         BbForm_report.QRL_printR.Caption :=CurrentUserName;  
         BbForm_report.Czf_report.Preview ;
      finally
         BbForm_report.Free;
      end;
     end;     
end;

end.

⌨️ 快捷键说明

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