unit DumpDetailUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, AesImhei;

type
  TDumpDetail = class(TForm)
    CoinCount: TEdit;
    ExitButton: TButton;
    DumpOnly: TButton;
    DumpAll: TButton;
    procedure DumpAllClick(Sender: TObject);
    procedure CoinCountChange(Sender: TObject);
    procedure DumpOnlyClick(Sender: TObject);
    procedure CoinCountKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
    DispenserNumber: integer ;
  end;

var
  DumpDetail: TDumpDetail;

implementation

{$R *.DFM}








procedure TDumpDetail.DumpAllClick(Sender: TObject);
var
    Dispenser: TDispenserBlock ;
begin
    ReadDispenserDetails(DispenserNumber, Dispenser) ;
    Dispenser.Status := DISPENSER_CASHBOX_DUMP ;
    WriteDispenserDetails(DispenserNumber, Dispenser) ;
end;

procedure TDumpDetail.CoinCountChange(Sender: TObject);
var
  I: Integer ;
  Code:Integer ;
 begin
  Val(CoinCount.Text, I, Code);
  DumpOnly.Enabled := I <> 0 ;
end;

procedure TDumpDetail.DumpOnlyClick(Sender: TObject);
var
    Dispenser: TDispenserBlock ;
    I: Integer ;
    Code:Integer ;
begin
    ReadDispenserDetails(DispenserNumber, Dispenser) ;
    Dispenser.Status := DISPENSER_PARTIAL_DUMP ;
    Val(CoinCount.Text, I, Code);
    Dispenser.NotesToDump := I ;
    WriteDispenserDetails(DispenserNumber, Dispenser) ;
end;

procedure TDumpDetail.CoinCountKeyPress(Sender: TObject; var Key: Char);
begin
    if Ord(Key) = 13 then
        DumpOnlyClick(Sender) ; 
end;

end.
