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

📄 fillvaluenote.pas

📁 1. 纯粹的合同管理,不涉及其它业务,独立成系统2. 简单明了,流程清析3. 合同条款可预定制4. 丰富强大的打印预览系统5. 实用的导入导出功能,可与excel交互使用6. 时刻追踪合同执行情况,包
💻 PAS
字号:
unit FillValueNote;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TEMPLETFORM, ComCtrls, Grids, DBGrids, HemisphereButton, 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.

⌨️ 快捷键说明

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