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

📄 dwsdfcxfrm.pas

📁 本人编写的有关军队营房工作的管理系统
💻 PAS
字号:
unit dwsdfcxfrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, Buttons, StdCtrls, Mask, DBCtrlsEh, ImgList, dxdbtrel,
  Grids,ComCtrls, DBGridEh, PrnDbgeh;

type
  Tdwsdfcx = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    SpeedButton6: TSpeedButton;
    Label1: TLabel;
    CheckBox1: TCheckBox;
    DBNumberEditEh1: TDBNumberEditEh;
    CheckBox2: TCheckBox;
    DBNumberEditEh2: TDBNumberEditEh;
    dxLookupTreeView1: TdxLookupTreeView;
    ImageList1: TImageList;
    DBGridEh1: TDBGridEh;
    SpeedButton9: TSpeedButton;
    PrintDBGridEh1: TPrintDBGridEh;
    procedure SpeedButton6Click(Sender: TObject);
    procedure DBNumberEditEh1Change(Sender: TObject);
    procedure dxLookupTreeView1CloseUp(Sender: TObject; Accept: Boolean);
    procedure FormActivate(Sender: TObject);
    procedure SpeedButton9Click(Sender: TObject);
  private
    { Private declarations }
    procedure showcx;
  public
    { Public declarations }
  end;

var
  dwsdfcx: Tdwsdfcx;

implementation

uses datafrm;
{$R *.dfm}

procedure Tdwsdfcx.SpeedButton6Click(Sender: TObject);
begin
yfgldata.dwsdfcx.Active:=false;
close;
end;

procedure Tdwsdfcx.DBNumberEditEh1Change(Sender: TObject);
begin
dwsdfcx.showcx;
end;

procedure tdwsdfcx.showcx;
var
  str0:string;
begin
str0:='';
if trim(dwsdfcx.dxLookupTreeView1.Text)<>'' then
  begin
    if (dwsdfcx.CheckBox1.Checked) and (dwsdfcx.CheckBox2.Checked) then
    begin
      str0:='select * from yfgl_dwsdf where 单位代码='+''''+dwsdfcx.dxLookupTreeView1.Text+''''+' and 年度='+floattostr(dwsdfcx.DBNumberEditEh1.Value)+' and 月份='+floattostr(dwsdfcx.DBNumberEditEh2.Value)+' order by 年度,月份,序号';
    end;
    if (dwsdfcx.CheckBox1.Checked) and (not dwsdfcx.CheckBox2.Checked) then
    begin
      str0:='select * from yfgl_dwsdf where 单位代码='+''''+dwsdfcx.dxLookupTreeView1.Text+''''+' and 年度='+floattostr(dwsdfcx.DBNumberEditEh1.Value)+' order by 年度,月份,序号';
    end;
    if (not dwsdfcx.CheckBox1.Checked) and (dwsdfcx.CheckBox2.Checked) then
    begin
      str0:='select * from yfgl_dwsdf where 单位代码='+''''+dwsdfcx.dxLookupTreeView1.Text+''''+' and 月份='+floattostr(dwsdfcx.DBNumberEditEh2.Value)+' order by 年度,月份,序号';
    end;
    if (not dwsdfcx.CheckBox1.Checked) and (not dwsdfcx.CheckBox2.Checked) then
    begin
      str0:='select * from yfgl_dwsdf where 单位代码='+''''+dwsdfcx.dxLookupTreeView1.Text+''''+' order by 年度,月份,序号';
    end;
    yfgldata.dwsdfcx.SQL.Text:=str0;
    yfgldata.dwsdfcx.Active:=true;
    dwsdfcx.SpeedButton9.Enabled:=true;
  end
else
  dwsdfcx.SpeedButton9.Enabled:=false;
end;

procedure Tdwsdfcx.dxLookupTreeView1CloseUp(Sender: TObject;
  Accept: Boolean);
begin
dwsdfcx.showcx;
end;

procedure Tdwsdfcx.FormActivate(Sender: TObject);
var
present:tdatetime;
Year, Month, Day: Word;
begin
present:=now;
decodedate(present,year,month,day);
dwsdfcx.DBNumberEditEh1.Value:=year;
dwsdfcx.DBNumberEditEh2.Value:=month;
end;

procedure Tdwsdfcx.SpeedButton9Click(Sender: TObject);
begin
dwsdfcx.PrintDBGridEh1.PageHeader.CenterText.Clear;
dwsdfcx.PrintDBGridEh1.PageHeader.CenterText.Add(yfgldata.dw.lookup('单位代码',dwsdfcx.dxLookupTreeView1.Text,'单位名称')+'水电费表');
dwsdfcx.PrintDBGridEh1.Preview;
end;

end.

⌨️ 快捷键说明

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