【delphi开源代码栏目提醒】:网学会员delphi开源代码为您提供FillValueNote.pas参考,解决您在FillValueNote.pas学习中工作中的难题,参考学习。
unit FillValueNote;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TEMPLETFORM, ComCtrls, Grids, DBGrids, He
misphereButton, Menus,
ToolWin, StdCtrls, ExtCtrls, DBActns, ActnList;
type
TFillValueNoteForm = class(TMyForm)
Panel1: TPanel;
HemiBtn1: THemiBtn;
HemiBtn2: THemiBtn;
DBGrid1: TDBGrid;
StatusBar1: TStatusBar;
HemiBtn_Fill: THemiBtn;
HemiBtn3: THemiBtn;
HemiBtn4: THemiBtn;
ActionList1: TActionList;
DataSetPrint: TDataSetDelete;
DataSetLocate: TDataSetRefresh;
DataSetShowAll: TDataSetRefresh;
DataSetFillValue: TDataSetRefresh;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure DataSetLocateExecute(Sender: TObject);
procedure DataSetFillValueExecute(Sender: TObject);
procedure DataSetShowAllExecute(Sender: TObject);
procedure DataSetPrintExecute(Sender: TObject);
procedure FormResize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
allTime:integer;
allMoney:double;
procedure FillCount;
end;
var
FillValueNoteForm: TFillValueNoteForm;
implementation
uses data, FillValueLocate, FillValue, OnlineLocate, FillValueRep;
{$R *.dfm}
procedure TFillValueNoteForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
Action:=caFree;
end;
procedure TFillValueNoteForm.FormCreate(Sender: TObject);
begin
inherited;
Statusbar1.Panels[3].Text := CopyRight;
DM.ADOQFillValue.Active :=true;
end;
procedure TFillValueNoteForm.FillCount;
begin
with DM.ADOQFillValue do
begin
if not Active then Active:=true;
first;
allTime:=0;
allMoney:=0.0;
while not Eof do
begin
allTime:=allTime+FieldValues['充值机时'];
allMoney:=allMoney+FieldByName('充值金额').AsFloat;
//['充值金额'];
next;
end;
Statusbar1.Panels[1].Text :='共有'+IntToStr(RecordCount)+'条记录,合计'+
IntToStr(allTime)+' 分钟机时; '+FloatToStr(allMoney)+' 元金额.';
end;
end;
procedure TFillValueNoteForm.DataSetLocateExecute(Sender: TObject);
begin
inherited;
FillValueLocateForm:=TFillValueLocateForm.Create(Application);
if FillValueLocateForm.ShowModal=mrOK then
FillCount;
end;
procedure TFillValueNoteForm.DataSetFillValueExecute(Sender: TObject);
var
strWhere:string;
begin
inherited;
FillValueForm:=TFillValueForm.Create(Application);
if FillValueForm.ShowModal=mrOK then
begin
DM.ADOQFillValue.Active :=false;
strWhere:='Where fillDate between #'+DateToStr(Date)
+'# and #'+DateToStr(Date)+'#';
with DM.ADOQFillValue do
begin
Active:=false;
SQL.Strings[1]:=strWhere;
Active:=true;
end;
FillCount;
end;
end;
procedure TFillValueNoteForm.DataSetShowAllExecute(Sender: TObject);
begin
inherited;
with DM.ADOQFillValue do
begin
Active:=false;
SQL.Strings[1]:='';
Active:=true;
FillCount;
end;
end;
procedure TFillValueNoteForm.DataSetPrintExecute(Sender: TObject);
begin
inherited;
if FillValueRepForm=nil then
FillValueRepForm:=TFillValueRepForm.Create(Application);
with FillValueRepForm do
begin
qrlbCountTime.Caption :='共计:'+IntTostr(AllTime)+' 分钟机时';
qrlbCountMoney.Caption :='共计:'+FloatToStr(AllMoney)+' 元金额';
QuickRep1.Preview;
end;
end;
procedure TFillValueNoteForm.FormResize(Sender: TObject);
begin
inherited;
Statusbar1.Panels[0].Width :=palClient.Width -480;
end;
end.