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

📄 lssfcx.pas

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

interface

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

type
  TLsSfCxForm = class(TSfCxForm)
    procedure BitBtn_findClick(Sender: TObject);
    procedure BBtn_OkClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BBtn_PrintClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  LsSfCxForm: TLsSfCxForm;

implementation

uses LsSfGjCx, ZfSfGjcx, Cbreport, Unit_common_files,DateUtils;

{$R *.dfm}

procedure TLsSfCxForm.BitBtn_findClick(Sender: TObject);
var
  f_name,Filterstr:string;
  f_value:Variant;
begin
  inherited;
  if (Com_first.Text='') or (Com_term.Text='') then exit;
  f_name := fieldname.Items.Strings[Com_first.Items.IndexOf(Com_first.Text)];
  case ADQ_SfCx.FieldByName(f_name).DataType of
    ftString,ftFloat:f_value := Com_result.Text;
    ftdatetime:f_value := datetostr(DateTP.Date);
  end;
  Filterstr := 'SELECT A.ID,A.fangno, A.manid, B.manname,A.Jkrq, A.Sybd, A.Bybd, A.Sys, A.lsdj,'
               +'A.Yfj,A.sfj,case A.status when ''1'' then ''已交款'' else ''未交款'' end as status'
               +' FROM dbo.Zf_Lenshui A INNER JOIN dbo.Zf_Man B ON A.manid = B.manid where '
               +'' + f_name + ' ' + Com_term.Text + ' ''' + f_value + '''';
  ADQ_SfCx.close;
  ADQ_SfCx.SQL.Clear;
  ADQ_SfCx.SQL.Add(filterstr);
  ADQ_SfCx.Open;
end;

procedure TLsSfCxForm.BBtn_OkClick(Sender: TObject);
var
  lop,f_count:integer;
begin
  inherited;
  LsSfGjCxForm:= TLsSfGjCxForm.create(nil);
  try
    if not ADQ_SfCx.Active then ADQ_SfCx.Open;
       f_count := DBGrid1.columns.Count;
       for lop := 0 to f_count -1 do
      begin
        fieldname.Items.Add(DBGrid1.columns[lop].FieldName);
        LsSfGjcxForm.Com_jl.Items.Add(DBGrid1.columns[lop].Title.Caption);
      end;
      LsSfGjCxForm.fieldname.items.Assign(fieldname.items);
      if LsSfGjCxForm.ShowModal = mryes then
    begin
      ADQ_SfCx.Close;
      ADQ_SfCx.SQL.Clear;
      ADQ_SfCx.SQL.Add('SELECT A.ID,A.fangno, A.manid, B.manname,A.Jkrq, A.Sybd, A.Bybd, A.Sys, A.lsdj,');
      ADQ_SfCx.SQL.Add('A.Yfj,A.sfj,case A.status when ''1'' then ''已交款'' else ''未交款'' end as status ');
      ADQ_SfCx.SQL.Add('FROM dbo.Zf_Lenshui A INNER JOIN dbo.Zf_Man B ON A.manid = B.manid ');
      ADQ_SfCx.SQL.Add(LsSfGjCxForm.returnstr);
      ADQ_SfCx.Open;
    end;
  finally
    LsSfGjCxForm.Free;
  end;
end;

procedure TLsSfCxForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  inherited;
  Action    :=cafree;
  LsSfCxForm:=nil;
end;

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

end.

⌨️ 快捷键说明

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