Програмне забезпеченння для адміністрування комп'ютерного клубу, страница 19

if logtype=LOG_DELETECARD then result.info:=AsDeleteCard(logrec);

if logtype=LOG_DELTIMEFROMCARD then result.info:=AsDelTimeFromCard(logrec)

end

end;

//Adds data to whole log system for

//required date

procedure AddToLogForDate;

var filename:string;

pl:packedlogrec;

begin

with logrec do begin

addcash(cash);

filename:=getlogfilename(whatdate);

assign(flog,filename);


if fileexists(filename) then begin

reset(flog);

seek(flog,filesize(flog))

end

else rewrite(flog);

pl:=processLogRecord(logrec);

pl.time:=encode(pl.time);

pl.logtype:=encode(pl.logtype);

pl.comp:=encode(pl.comp);

pl.info:=encode(pl.info);

pl.cash:=encode(pl.cash);

pl.card:=encode(pl.card);

pl.comments:=encode(pl.comments);

write(flog,pl.time);

write(flog,pl.logtype);

write(flog,pl.comp);

write(flog,pl.info);

write(flog,pl.cash);

write(flog,pl.card);  

write(flog,pl.comments)

end

end;

//Reads a log record from opened file

procedure GetFromLog;

begin

read(flog,logrec.time);

logrec.time:=decode(logrec.time);

read(flog,logrec.logtype);

logrec.logtype:=decode(logrec.logtype);

read(flog,logrec.comp);

logrec.comp:=decode(logrec.comp);

read(flog,logrec.info);

logrec.info:=decode(logrec.info);

read(flog,logrec.cash);

logrec.cash:=decode(logrec.cash);

read(flog,logrec.card);

logrec.card:=decode(logrec.card);

read(flog,logrec.comments);

logrec.comments:=decode(logrec.comments)

end;

end.

Лист

 

докум.

 

Дата

 

Изм.

 
Подпись: Инв.№ дубл.Подпись: Подп. и датаПодпись: Подп. и датаПодпись: Инв.№ подл.

Подп.

 

Лист

 
Подпись: Взам. инв. №

ИАЛЦ.467.449.001.ПЗ

 

unit GiveTimeUnit;

interface

uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls, Mask, Spin, Common;

type

TGiveTime = class(TForm)

btOk: TButton;

btCancel: TButton;

lbHours: TLabel;

lbMins: TLabel;

seHours: TSpinEdit;

seMins: TSpinEdit;

lbPayed: TLabel;

seHrns: TSpinEdit;

seCops: TSpinEdit;

edComments: TEdit;

lbComments: TLabel;

cbComps: TComboBox;

lbComps: TLabel;

edCardName: TEdit;

lbCardName: TLabel;

cxFromCard: TCheckBox;

procedure FormShow(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure FormKeyDown(Sender: TObject; var Key: Word;

Shift: TShiftState);

procedure btOkClick(Sender: TObject);

procedure cxFromCardClick(Sender: TObject);

private

public

end;

const

//Tags

TG_ADDTIME=       1;

TG_CARDNAME=      2;

TG_DELTIME=       8;

TG_FOREVERTIME=   16;

TG_MOVE=          32;

TG_INFO=          512;

//Additional tags

ATG_ADDTIME=         1;

ATG_ADDHOUR=         2;

ATG_ADDTIMETO=       4;

ATG_DELTIME=         8;

ATG_FOREVERTIME=     16;

ATG_MOVE=            32;

ATG_CHANGE=          64;

ATG_GETFROMCASH=     128;

ATG_PUTTOCASH=       256;

ATG_INFO=            512;

ATG_DELALL=          1024;

ATG_PUTNIGHTCASH=    2048;

ATG_INFODELNIGHT=    4096;

ATG_INFOPASSWORD=    8192;

ATG_CARDNAME=        16384;

ATG_LEFTIN=          32768;

ATG_ADDTIMETOCARD=   65536;

ATG_DELETECARD=      $20000;

ATG_DELTIMEFROMCARD= $40000;

var

GiveTime: TGiveTime;

tag_info:record

tag:cardinal;

atag:cardinal

end;

implementation

{$R *.DFM}

uses MainUnit, LogFunc, CardsForm1;

const

//Index of info about it in array

FORM=1;

LB_HOURS=2;

LB_MINSS=3;

SE_HOURS=4;

LB_PAYED=5;

SE_HRNS=6;

LB_COMMENTS=8;

ED_COMMENTS=9;

BT_OK=10;

BT_CANCEL=11;

CB_COMPS=13;

LB_COMPS=14;

LB_CARDNAME=15;

ED_CARDNAME=16;

CX_FROMCARD=17;

var def:array [1..17] of record

a,b:integer

end;

checkproc:procedure;

//Restores default positions of controls

procedure RestoreDefPos;

begin

givetime.width:=def[1].a;