📄 chu_huo_tong.pas
字号:
unit chu_huo_tong;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask;
type
Tchu_huo_ton = class(TForm)
Button1: TButton;
Button3: TButton;
Button2: TButton;
GroupBox1: TGroupBox;
MaskEdit1: TMaskEdit;
MaskEdit2: TMaskEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure MaskEdit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure MaskEdit2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
chu_huo_ton: Tchu_huo_ton;
implementation
uses chu_huo_report;
{$R *.dfm}
procedure Tchu_huo_ton.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=Cafree;;
end;
procedure Tchu_huo_ton.MaskEdit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
maskedit2.SetFocus;
end;
procedure Tchu_huo_ton.MaskEdit2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
button1.SetFocus;
end;
procedure Tchu_huo_ton.Button3Click(Sender: TObject);
begin
close;
end;
procedure Tchu_huo_ton.Button1Click(Sender: TObject);
begin
chu_huo_repor:=Tchu_huo_repor.Create(self);
chu_huo_repor.Query1.Active:=false;
chu_huo_repor.Query1.SQL.Clear;
chu_huo_repor.Query1.SQL.Add('select * from E where (Cdr>=:mm) and (Cdr<=:nn)');
chu_huo_repor.Query1.SQL.Add('order by Cdr');
chu_huo_repor.Query1.ParamByName('mm').AsDateTime:=strtodate(maskedit1.Text);
chu_huo_repor.Query1.ParamByName('nn').AsDateTime:=strtodate(maskedit2.Text);
chu_huo_repor.Query1.Prepare;
chu_huo_repor.Query1.Active:=true;
chu_huo_repor.QRLabel4.Caption:=maskedit1.Text;
chu_huo_repor.QRLabel5.Caption:=maskedit1.Text;
chu_huo_repor.QRLabel7.Caption:=label3.Caption;
chu_huo_repor.QuickRep1.Preview;
chu_huo_repor.Free;
end;
procedure Tchu_huo_ton.Button2Click(Sender: TObject);
var chu_huo_repor:Tchu_huo_repor;
begin
chu_huo_repor:=Tchu_huo_repor.Create(self);
chu_huo_repor.Query1.Active:=false;
chu_huo_repor.Query1.SQL.Clear;
chu_huo_repor.Query1.SQL.Add('select * from E where (Cdr>=:mm) and (Cdr<=:nn)');
chu_huo_repor.Query1.SQL.Add('order by Cdr');
chu_huo_repor.Query1.ParamByName('mm').AsDateTime:=strtodate(maskedit1.Text);
chu_huo_repor.Query1.ParamByName('nn').AsDateTime:=strtodate(maskedit2.Text);
chu_huo_repor.Query1.Prepare;
chu_huo_repor.Query1.Active:=true;
chu_huo_repor.QRLabel4.Caption:=maskedit1.Text;
chu_huo_repor.QRLabel5.Caption:=maskedit1.Text;
chu_huo_repor.QRLabel7.Caption:=label3.Caption;
if chu_huo_repor.PrintDialog1.Execute then
chu_huo_repor.QuickRep1.Print;
chu_huo_repor.Release;
end;
procedure Tchu_huo_ton.FormCreate(Sender: TObject);
begin
label3.Visible:=false;
end;
procedure Tchu_huo_ton.FormActivate(Sender: TObject);
begin
maskedit1.SetFocus;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -