?? dwsdfcxfrm.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 + -