364 , , : , , , , , , . , , , .
:
364150
(304)
(123)
(23)
(113)
(4)
(4814)
(5227)
(2616)
(3423)
(4214)
(1518)
(68)
- (2836)
(8269)
(50)
(50)
(762)
(2)
(5275)
(30)
(1222)
(43)
(20403)
(465)
(19)
(108)
(173)
(96)
(899)
(54)
(34)
(476)
(106)
(62792)
(3562)
, (6444)
(2165)
(21320)
(766)
(64)
(3145)
(60)
(17)
(588)
(1000)
(106)
(48)
(3)
(1167)
(8485)
(537)
: (2044)
(11657)
(532)
(21)
(7985)
(3721)
, (10549)
(88)
(58)
(36)
(2257)
(12491)
(91)
(797)
(1338)
(24)
, (214)
(1141)
(3)
(8)
(21697)
(7850)
(3801)
(682)
, (2881)
(475)
(1)
, (7100)
(8694)
, (4121)
(443)
(952)
(2967)
(23)
(748)
(4876)
(95)
(107)
(7)
(2004)
(15)
(663)
(240)
(39)
(25)
(624)
(16)
(2652)
(136)
(90)
(406)
(95)
(24)
(3463)
(4482)
(7216)
(4592)
(5386)
(3)
(2244)
(23)
(29)
(35)
(4517)
(20645)
- (666)
(119)
(2573)
(889)
(288)
(148)
, (1140)

:

:
: ,
: 19:45:49 21 2010
: 32 : 2 : 0 : 0 :    

ic

c

1. pi

1.1 c i

1.2 c i ipi

1.3 c p ipi

1.4 pi c i

1.5 c ic i pi

2. Pp i p p

2.1 c p p cpp pii i i

2.2 Pp c pp pii pi p i

2.3 C i pc , p, p i pi

3. Ci pi

3.1 Icpi ici pp p

3.2 Icpi ci p

4. i pi

4.1 Pp pc pp pp p

c

ipp

c

i ipi iip p. p -i ppc ipi c c i i i. p c ipi p p: c ¢i cc, i pic i p i ic. pi p pi p p, c i ic . p p ipi c c c, ᒺ ipi ic, i ci .

pc pi ip i ci cp i cc pii ipi cc. i cc piiii - i pc ipi cc c ipi cc, i ᒺ i . Ci - ipci 'p. i p ciici pi . p pc iic ipc, pii, ip i c pi ipi. p i pi ipi pc ipii cc, c pi . pi pi ic pi, p ipi, p.

, p, ip c p ii icc ipi p c, i p ii, i pc i c. , pi ip p iic , p i ipi cc. p - pi i ipi. p , i i ii, ic iic i, c ipi p ii c. c i pci ip: pi p ipi i , pi ipi i i ppi, p i, pp p p.

pc pc p p p ipc pii. p c - ipi, i , i p ic i ipi, i pi.

ii , pc p c ci i c cc i p ip c p ii.

1. pi

1.1 c i

Cc c p p ipi ip c p ii pp , ci pc.

C pi cp pp p, pic pc pi. c pc p pp cc c p ii. pc p ci i cpi, p c pi , i p pi pc c ci i p p:

cp p p , p pi ipi;

pi ipi pc i;

p i ( ii, i pc i pp) p i.

, ipi cc pcc pi, c i c p i pc -cpp i ci ii cc - p pi.

pc p i ciic: c cpc c , c cic i i ᒺ, i cpc i c i, i i p c, i cpc pp , p pi ipi p i.

1.2 c i ipi

P i c i p ipi pi ip c p ii . i ipi c i , ci , c c iic i, ic. pi ipi ci cc p:

i, i i p ipi: I i, ; , , pp p - i pp;

ii, i i p ipi: pcpi p i, p i, pi c;

c, i i p ipi: c ip c p ii, pic i c;

c, i i p ipi: c, i c, iic;

: i i c, p c, c.

c ipi c i cipic ic i pc i .

1.3 c p ipi

p , c p ipi cc p p ipi. c p ipi ip pi i ppi, ppi.

ip, i c p ii c i ici ipi, p, ipi p ii, , ipc p i ipi. p, i, p i i:

cc c, i pi pi ii pic;

cc , i pci p i c pic;

pp c p i;

cp i: p p pi, ii, i pc i pp;

, c i ipi, c pc pp pi - p i ipi.

1.4 pi c i

i p p c i, i p pi , i p i:

i cpp;

/p ipi;

p ipi;

p ipi;

p;

i䒺 i cpp.

i cpp p i cpp, c cp . Cpp i p, i p pc. i c 璺 cpp i c i pc p c.

/p p i ipi cpi i , , ipi , ip. p ipi ic i pc p, ic i pc c p. c p i pc, p c . p pc i - .

p ipi pcc p ipi p pc i.

p ipi p p pc ci p pc, i, i pc p-c i. c p c i. i pci p p pp p. ci cp i, ci i p c. p c: c pc i pp ip, i p c i pc, i pc cpp ipi . p i ipi pp p . i p ipi p.

p p ii ci pc pci p pp. ci pp p c i i pc pp i i - i.

i䒺 i cpp p pp i cpp p p pp.

p p pp p pi 2.

1.5 c ic i pi

pi pp pp , pi p ici cc p ipi cc, pc pi i, p i , p p cc. c c i pi p i cc p i i c i p cci pii c i.

p pii pci p ipi cc p pc pii .

p ipi cc - pii cc cp, ipc ii c p.

ci p ipi cc ci pp c :

i, p pc p: i, c, i, pii ;

c i p pi: pi, p;

pii pci p - pii piii .

p i p.

Cp i i pci p p pc i c, c ppi ci, IC cc pi ipc, i cci i i cpp pi.

pci p ipi cc ci ci ccc i p:

i , p pci i i (ii ii i, i, pic i );

i pci (ci pc i p cic i, c pi cpi p , i p i ici, p, ii, pi ii).

cc i pii pc i- , c pi.

p pp p i: p, pi, pc.

p pp - cic i, p p pi ci p, i p ( ii i ppi p pi).

pc pp - pp, ic p c, c p i c p p pi.

pi pp - pp, c p cc p; , ppi p pi c p pi i, pci ic pp.

, pp ci i p pi.

p i pi i p ipi cc pi p cc , icc, ᒺ i p.

p i icc pii p p pi ci ipi, pp, i i .

i c cc icc p i c pii icc, c . p cc i icc, iiii ii ipi 'i, pp cpic p icc, pic c i ppi.

ᒺ p p cp p ipi cc ᒺ, i p ᒺi . p p ᒺi (p, i).

p - cp pi ipi cc ci CP, pc i ipii i ᒺ pi ( p). ic pi c ipi i i i i , i ' pi i.

piii p.

i p p (c p), pii pc p icc i p-p, p p - i c p i.

p i cp pp ipi ic i. i ipii ', i c cci, ipi p pii ic i i, pi i, icc ciii ipc.

P pp ipi ipi cc pi i cp i c pi pc, pi cp i pii p ppici ii (ci ).

Cpp p ic pp, i c cpp ci ipi cc. p c ci ci pi, p i ip ci pii cci ipi . pc i c cp , i cp i i ci .

ci i p p i ip pp i- i, cp p p' i c p pp.

ppci p cc , ic cp ipi cc pci i c i, ic ii i pi, iic c i cc. pc c ipii, i pc p p . i c p ipi cc i p pp i pii pi i , i c , i ic c i.

Cci i ipii cc c ci , cpi, ii pci . pi i i c, i p . Ic .

i pic i cc p ci cpp. c - ip c, p pi p c, ci - c. i pcc ip c i ci p cpp.

cc i i c pi. Pi p pc pi i pii, cp pi cc.

i . i ii, i pi:

ippi - i pii i p

p - i i ci cci i

ᒺ - pic i, i p i pp .

Ic ci pip C:

- pp i pii pi. pip p iic ci p pp.

- cpp - pi i pi (cppi), pci p ii p p. p ci ici pp, i pc p p.

i - cpp - i pipi cppi pic , i p pp C, p pc i p ip ci. p pp pc p p p i i, pc C, pi. C ci iicic , p c ipi c pi.

Pi - pi p i cppi, i i pii i c c i ci. cppi i c i C. c pcc ii pp, i cpp p pp. p i ici pci i piip pi pi.

Ip - c i C pi pi pi icc pp p cp p. i pp " i", i p i c pcp.

c p p -cpp pip , i i pi - ipi pi cpp, i pic , ii p pci ic i pc i c, pc cpp.

p, pp p pi pc i i c BDE, ADO ODBC. ci c p, i i. P i.

ODBC Open Database Connectivity ( ip ) - i c i c pi p. i pii cii X/Open SAG CLI (SQL Access Group Call Level Interface) - ipc pi p c SQL, ip Microsoft. ODBC p i i pp, p, , i i , p c ipi p , i ic.

pip ODBC cc c pii: p pi, ipc ODBC, cp ppi, pp p .

p pi pi GUI (Graphical User Interface - pi ipc pc) ic-i. i c i pp, i Java, Visual Basic C++. p pp pc i ipc ODBC i .

cp ppi c ODBC Microsoft. i p pi pp, c cci, , cp i pi pp i pi ppi ipi p pp, i. ci p pp i , cp ppi p, ii cc p p ci , , ci i p pi pi ppi.

pp - c pip, c p - . Cc ppi ODBC p pi WINDOWS, i i, p UNIX, pp API ODBC i icp cp p- cc. pi ODBC p pc cci ccc SQL cp, pp cc i i . pp p , p, pp Access, Oracle pp SQL Server. Ipc ODBC ip i, pp SQL, pi 璺, ipi p . pp pii. , pp i ipc ODBC, i ipc cc p . i p pc i , p ii i ip pi ppi. , p p Internet, pp ip p .

p ci ODBC cc p pc p i pc c. i pc Microsoft Access ip, i cpp pi ipi p ii i i p.

ci pc ii BDE (Borland Database Engine), c i IDAPI (Integrated Database Application Program Interface). ii cc p ci IDE ip Borland, C++ Builder Delphi. cc C: \Program Files\Borland\Common Files\BDE.

BDE cp i ci i:

cpi c (dBase, Paradox, ci )

c SQL-cppi (Oracle, Sybase, MS SQL Server, InterBase, Informix, DB2) ppi Borland SQL Links

c - p , ip pp ODBC (Open DataBase Connectivity), p, i p (Excel, Lotus 1-2-3), cpp , ip ppi SQL Links (p, Gupta/Centura)

cp i i-cpp, pc pipii i

c pic p pi

pc SQL (Structured Query Language - i) ii i i ci ip .

pp p pp cpi pp Delphi, pci, , cp pp p pp . Cp pp Delphi p: p ipc, pc p, c pi, cp pp ci p i ipc pp, pp - Object Pascal. cp InterBase, InterBase - -cpp i, p i . InterBase icc p ci Delphi. ii i i Paradox i dBase, i InterBase pic i p i, p cpi . ic i pic i , . pp pc pic pi pc, c ipi c p cppi.

pp p pi pc cp i pp Delphi. i p:

Delphi - cp i pp c i pp Object Pascal.

Delphi i pi i cp;

Delphi - pci, , cp cp , , i i;

pc i i cp pc ᒺi i ccpi pi. i cc ᒺ pcc p. p - iii cci, i c ᒺ i pcc i ppi ᒺ.

p Delphi cp BDE (Borland database Engine). i ic c c pi (Oracle, Informix, Dbase, Paradox, InterBase).

Delphi ip i SQL (Structured Query Language). p ip i p i ipi c i.

i ip , p pci cp pp c ci IC:

pc pci IC;

pic ci;

c i, pi i cp.

2. Pp i p p

2.1 c p p cpp pii i i

i pc p i pp IC. p i pi p . c pii c ic i pi p - ci i pi ᒺi p cp, cc i. i ci , i c p ᒺi p ci:

I i

p i

Pcpi p i

p i

Pi c i

c, ip

c

pic c

c

i c

iic c

pc i p pc , ic ci p p cp. c pi pi pi. p i i i pc pii i i.

pii - p i i i , i p cc p i, ii i i . c pii c p p , 'c ici, ipic ipi. pc ci i 'i, ci cpci p .

p p p (1) p, i i i ic p p. p i i 1, i pi I p i: pi, I, -i , i i.

p p p (2) p, i c 1 i p i c p . pi p , p p pi i . ic p i 2 p i i: "i", "c".

"i" i :

I i

p i

Pcpi p i

p i

Pi c i

"c" i :

c, ip

c

pic c

c

i c

iic c

pi i . i "i" " i", i "c" - " c".

p p p (3) p, i c 1 i 2, , , p i i i. pi c p c . p, c i, c p i p i c p i. i pc ipi p i "ii", i :

Pcpi p i

p i

Pi c i

"pcpi p" p i.

i pi cp "c" :

c

c

i c

iic c

" c" p i.

pi cp "", c : i, c, c, c ipi p , , c .

p p p p p , p i p i i.

i i c , -i i pi, i c c i ci i p i, i i p, i , icc p i.

p - p, c i i . p c , i i .

, i i cpi InterBase, p pcc -cpp i, pi ii, c cppi. InterBase ci cpi i c i i, - . , ci i c pi - cppi. pp pc c ip cpp i p p.

P p pii cpp , p pi 1. p p, p, p p p.

2.2 Pp c pp pii pi p i

pp p pi pc cp i pp Delphi. Delphi p p, i ci pii 1.5

pii p ci c, pcc p pi IC c p ii.

c Delphi icc p BDE (Borland Database Engine). pc BDE ic c i (Paradox i dBase), i i , p SQL-cpp (Interbase, Sybase, MS SQL Server, Oracle, Informix).

BDE Administrator, cp ic - c . p Object → New. pp p Interbase. i ic - avtoser. i ServerName , i User Name - SYSDBA, pi ic Object → Apply.

cp, i. i c cp, pci i InterBase. Ci cp i ii c Delphi i IBConsole. pc i i pp . ci i:

cp ppi, i pic i. ppi - , c . - Avto_BD;

(ServisAvto. GDB) i WISQL ic - avtoser;

cp i䒺c cpp i IBConsole;

cp i ' i i IBConsole.

Cp pc i c p. i cc InterBase , icc i, cp p . InterBase cpc ii WISQL. c ppi , pc p i䒺 . i IBConsole pc , i pc p c. ic SQL i icpi ip pp Interactive SQL. ppi cp i i SQL.

cpi pp Delphi p i ic i , : DataSourse, DBGRid, DBNavigator, Query ic ' i ii , i cpi pi.

ipi i pii ci ci ii Delphi. , pc c i c pi, i c i ii p i i ic i p. c cci, i i Icpi ᒺi p pii i. pi i p Icpi ᒺi i i. ic ipc i , pi c pp . ii ii i pp c .

, ip i i pi pcc i ip (cpi Data Controls):

TDBEdit - , i p ic p.

TDBMemo - p ip i p p .

TDBListBox - p ' c p p i cc. cc c cci Items.

TDBComboBox - ip i cc p .

TDBLookupList i TDBLookupCombo - pcc , i p pii c i c ' c ipi i i.

TDBGrid - pcc p i p , pc pi.

' i Table i i ip ic DataSource (cpi DataAccess). i p i i, i pc Table.

p DataModule: File-New-DataModule. ic ii , p c p. pic DataBase, 8 Table, i ii . icpi ᒺi cic DatabaseName AVSIS - ic, pcc Table, cic TableName - Clientu, Avto, Zapchastunu, Poslygu. Zakaz ii. i 8 DataSource i icpi ᒺi DataSet i : Table1, Table2, Table3, Table4 i .. ii. cci Database - DatabaseName AVSIS, AliasName - avtoser - ic, cp BDE Administratori.

pic p TDBGrid ip ipi . cc i DataSource p DataSource1, DataSource2 i .. ii. i p i i - Activ - true. p c ipi ipc DBGrid. ii pc TDBNavigator - , i pi p (p, p, c, c, c, p, , ic, p, i). cc i DataSource p DataSource1, DataSource2 i .. ii. c p TDBEdit, cc DataSource DataSource1, DataSource2, DataSource3 i .., DataField - ii i.

ii i pi , pi .

i "i" i "ii" (i p i cp ). i "ii" "_i". i i i Delphi i i: p Table4, ii i "ii". icpi ᒺi cic MasterSource c DataSource3, cic MasterFields - ii, ipc, c DetailFields ( ), MasterFields ( ) p , i i ( p ic), "ii" - id_clienta, i "i" - id_clienta, i c Ok. i p .

Query, ip . c i c pp i. pci i pi - Edit, c pi c pp i. P ic c ii , pi .

p i i pc QuickRep, ic p. QRBand, QRSubDetail pic QuickRep. pic QRLabel, QRDBText. QuickRep pi p . i IBQuery. P i ic c ii , i.

c pp i p .

2.3 C i pc , p, p i pi

ipii pc p pi i pc p i.

p c i pc , p, p i pi pi i pc i i, c pi.

pc pi i ci :

/p ;

p ipi;

p pi i;

p/p ii.

/p ci pi, c p ipi, pi, p c. pi p ici i p. Cc c i pc /p c : c pi p c , ip i-i "c": i → c, c ipi p c, ip, "c": i → c, i c. i pi ip "Ipi p i": → Ipi p i, pi i i p i i i. i pi "": → . ic pi pip pic ipi. ipi i pi i, pi ip pi i i.

p ipi icc pc . pi, i i p ipi, ip i p: → p ipi.

pc p p i ic ppi ip ipi: → (p pi ). p, ip p c, ip pi pi p pi "Cc p c" c pi pi.

p ii ic pc ic ip i : i → (p pi i). p pi pc pp i "p p pi pi" "iic p i".

ci p pp pci pi pp p c.

C pp p pi 3.

3. Ci pi

3.1 Icpi ici pp p

p pp pii cci Windows XP, c pc, i pi i p i Windows 95, Windows 98, Windows 2000, Windows NT, ci pi cc Windows. pp c p pi cc Linux Unix, pp (i, i pii cc ip pp). , p pp pi c pp : BDE Administrator, InterBase.

p p ici. , p p pp i ci p pc. i pc ic BDE Administratori. BDE Administrator. p Object → New. pp p Interbase. c ic - avtoser. i ServerName , i User Name - SYSDBA, p ic Object → Apply. i i c i IBConsole pcp cpp InterBase. Server → Register. ǒc i p cpp. pi pcp cpp: c pc UserName - SYSDBA, p password - masterkey. i pi p cpp. DataBase → Register. i DataBase . i Alias Name ic, cp BDE Administratori, i c pc SYSDBA p masterkey. p pi p pi i ci AvtoDB, i c , i p. pcp cpp InterBase pi, pi pc pcp cpp InterBase pi.

3.2 Icpi ci p

c pp c: , pp, c i "AvtoServis": AvtoDB - , icc , pp/AvtoServis. exe - pp i cpici.

p i IC i, c pc pi. ii ipi pc p c:

c p pcp - 500 ;

ᒺ p i 64 ;

ᒺ i ic pc c 4 ;

i p ic CD-ROM USB-p;

c pc p pp 3.72 c pcp.

ic c pp AvtoServis. exe pi pc cpp → ic cpp. ic i䒺 p i, p ip pi p ici p i. , pc i p i pi c p c: → c p c. Cp p c: 1111. p ici pc i p: → i p. p pc i cc Info. ini.

ic i p i i䒺c i cpp: → i䒺c i cpp pp.

i c icpi ci p p i pp.

4. i pi

4.1 Pp pc pp pp p

Pp pp pi i p, c , ic cc ci p i pi.

pc p cpi cc c:

pii p;

pi ;

pcpi p;

Ii p;

p c c, pc p 1

(1)

- pii p;

- pcpi p;

- p pi ;

- p pi ;

- p pi ;

- ip cii p.

P i ip p, i p 1.

P i pp pci pi p, c p pc p 2 i c pic ci pii, pc p ppi ipi cc c i ipc pii c ppi.

(2)

- cp pic pii;

- c i ipc pii;

- c ppi.

c p i pi cc c i i i- () pi iic (), ip pi 1

(3)

ip pp pci ci pii p i i 1.

1

i , p iic, . pic, p.
CD-R c 1,2 1 1,2
2 1 2
ip 4 0,1 60 6
P 1 1 1
c 10,2

p pc p c (), i ii ipc pii p c pi:

cpc pi p pi 3 (3 c 0,50 p) - 1,5 p;

p pi 4 (60 ci 0,25 p) - 15 p.

c pc i c =16,5 (p)

pc i c pc p p pi icc p (4).

(4)

- i 1 /, p;

- ic, c , ;

- c p, .

p ic ipi Athlon 3000+, 17 TFT-ip LG, cp c p 350 0,35 ppi.

p, , p i c ip picci, ic p 160 . i ppi c:

(p)

c pi p, ic pi i p 2:

(p)

pcpi p - p, i c p ic pcpi , ii i i i, pp pc p p i c cp p (2 ic).

pi pc:

2 ic p pc 13,5 p, 27 p;

10 i pp ci 0,8 p, ci 8 p.

, c pcpi p p =35 p.

c ip p pi .

p ci ccc pc p pi, c pi pi p c iic ip .

c pi picic () pi (iic ip ) ppi p IC, cc c , p pi () i cc p 5.

(5)

p picic ci pi i 2.

2

p picic,
p 1
p i p 6
Pp p, pi i 5
Ici i pp 2
ip i ipi 8
p ipp 10
ic i pi 2
Pp p p pp 10
ip cpp pii i i 6
Pp pp p 104
c pp 2
i i 40
Pp pc p 2
c 198

i i 2 c ip 198. p pi ip p c () picic pi (), ip pi 6.

(6)

, ic pi ppic c 800 p., p c c 5 p/. i ip p p 6 i p:

(p)

pi () - 20% i pip c, i p i i:

(p)

c p - ip cii p, i ip i c: ci - 31,8%; ci cp c p pci - 2,9%; ci cp pi - 1,3%

ci cp i c i pci p - 1%. c, pc p c (p), i c ci ci ip c 37% i p,

(p)

pic () pc p i p pi () pii pii ip () p 7.

(7)

p p p. % pii ip ci (p), p, pi p pc c 2 ici, p pi p i () c (p)

pi pi pp . pi i pp :

C Windows XP Professional Rus - 680.85 p.

MS Office 2003 - 1122 p.

Delphi 7 Professional - 5600, 77 p.

C pci pp - 7403,62 p.

pic () pp p pi () pii pii ip () p 8.

(8)

p p p. % pii ip ci

(p),

p, pi p pc c 2 ici, p pi pp () c (p)

c pi ip c

(p)

C ci p ip p p 1, p pc p ipi cc:

(p)

c

ic, c p, c, pc p i i p pi i i p . ipp i i i i i , i pi p pii cpp i.

ic i p cp pi ipc pc, i p c pc i c, ip cp pp Borland Delphi 7, p pi i .

i pc p cp IC c p ii. p ppi cc pc -cpp i, p cc pi. pp ii cc ic pp p, i i.

ipp

1. c .., i . ., Pc .. "c. Turbo Pascal i Delphi", 3- ., - i: ", 2002p.

2. ., . , . Cp " : pp, p cp. p p", BH, 2003p

3. p . "ppp Delphi 7: pc". - C.: p, 2003p.

4. http://omega. km.ua/katalog. php? lev=3&dep=7&type=0&code=144

5. http://www.ibase.ru/prices/borland. htm#d10

- pp p

program AvtoServis;

uses

Forms,

UAvto in 'UAvto. pas' {Form1},

UPoslygu in 'UPoslygu. pas' {Form2},

Unit1 in 'Unit1. pas' {DataModule1: TDataModule},

UZapchastunu in 'UZapchastunu. pas' {Form3},

UClientu in 'UClientu. pas' {Form4},

UZakaz in 'UZakaz. pas' {Form5},

UShow in 'UShow. pas' {Form6},

UZaputPoslyg in 'UZaputPoslyg. pas' {Form7},

UZaputZapchastun in 'UZaputZapchastun. pas' {Form8},

UPrint in 'UPrint. pas' {fmPrint},

UZvit1 in 'UZvit1. pas' {Form9},

UZvit2 in 'UZvit2. pas' {Form10},

UConnect in 'UConnect. pas' {fmConnect},

UPassword2 in 'UPassword2. pas' {Form12},

UZminaPassword in 'UZminaPassword. pas' {Form13};

{$R *. res}

begin

Application. Initialize;

Application. CreateForm (TForm1, Form1);

Application. CreateForm (TForm2, Form2);

Application. CreateForm (TDataModule1, DataModule1);

Application. CreateForm (TForm3, Form3);

Application. CreateForm (TForm4, Form4);

Application. CreateForm (TForm5, Form5);

Application. CreateForm (TForm6, Form6);

Application. CreateForm (TForm7, Form7);

Application. CreateForm (TForm8, Form8);

Application. CreateForm (TForm9, Form9);

Application. CreateForm (TForm10, Form10);

Application. CreateForm (TfmConnect, fmConnect);

Application. CreateForm (TForm12, Form12);

Application. CreateForm (TForm13, Form13);

Application.run;

end.

unit UAvto;

interface

uses

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

Dialogs, Menus, StdCtrls, ExtCtrls;

type

TForm1 = class (TForm)

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

N4: TMenuItem;

N5: TMenuItem;

N7: TMenuItem;

N8: TMenuItem;

N9: TMenuItem;

N10: TMenuItem;

N11: TMenuItem;

N12: TMenuItem;

N13: TMenuItem;

Help1: TMenuItem;

N14: TMenuItem;

N16: TMenuItem;

N17: TMenuItem;

N18: TMenuItem;

N19: TMenuItem;

N15: TMenuItem;

N20: TMenuItem;

N21: TMenuItem;

N6: TMenuItem;

N22: TMenuItem;

N23: TMenuItem;

Label1: TLabel;

GroupBox1: TGroupBox;

Label2: TLabel;

procedure N9Click (Sender: TObject);

procedure N2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

procedure N7Click (Sender: TObject);

procedure N17Click (Sender: TObject);

procedure N10Click (Sender: TObject);

procedure N11Click (Sender: TObject);

procedure N12Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N18Click (Sender: TObject);

procedure N19Click (Sender: TObject);

procedure N20Click (Sender: TObject);

procedure N21Click (Sender: TObject);

procedure N23Click (Sender: TObject);

procedure N6Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

tfl: TextFile;

str1, str2, str3: String;

password: string;

implementation

uses UPoslygu, Unit1, UZapchastunu, UClientu, UZakaz, UShow, UZaputPoslyg,

UZaputZapchastun, UZvit1, UZvit2, UConnect, UPassword2, UZminaPassword;

{$R *. dfm}

procedure TForm1. N9Click (Sender: TObject);

begin

Form2. ShowModal;

end;

procedure TForm1. N2Click (Sender: TObject);

begin

fmConnect. ShowModal;

end;

procedure TForm1. FormShow (Sender: TObject);

begin

Form1. N3. Enabled: =false;

Form1. N4. Enabled: =false;

Form1. N7. Enabled: =false;

Form1. N8. Enabled: =false;

Form1. N13. Enabled: =false;

Form1. N15. Enabled: =false;

Form1. N23. Enabled: =false;

Form1. N6. Enabled: =false;

password: ='1111';

Label2. Caption: =password;

end;

procedure TForm1. N7Click (Sender: TObject);

begin

Form1. N3. Enabled: =false;

Form1. N4. Enabled: =false;

Form1. N7. Enabled: =false;

Form1. N8. Enabled: =false;

Form1. N13. Enabled: =false;

Form1. N15. Enabled: =false;

Form1. N23. Enabled: =false;

Form1. N6. Enabled: =false;

Form1. N17. Enabled: =true;

Form1. N2. Enabled: =true;

DataModule1. IBTable1. Close;

DataModule1. IBTable2. Close;

DataModule1. IBTable3. Close;

DataModule1. IBTable4. Close;

DataModule1. IBTable5. Close;

DataModule1. Avto. Close;

DataModule1. Poslygu. Close;

DataModule1. Zapchastunu. Close;

DataModule1. IBDatabase1. Connected: =false;

Form1. GroupBox1. Visible: =false;

end;

procedure TForm1. N17Click (Sender: TObject);

begin

Form1. Close;

end;

procedure TForm1. N10Click (Sender: TObject);

begin

Form3. ShowModal;

end;

procedure TForm1. N11Click (Sender: TObject);

begin

Form4. ShowModal;

end;

procedure TForm1. N12Click (Sender: TObject);

begin

Form5. ShowModal;

end;

procedure TForm1. N4Click (Sender: TObject);

begin

Form6. ShowModal;

end;

procedure TForm1. N18Click (Sender: TObject);

begin

Form7. ShowModal;

end;

procedure TForm1. N19Click (Sender: TObject);

begin

Form8. ShowModal;

end;

procedure TForm1. N20Click (Sender: TObject);

begin

Form9. ShowModal;

end;

procedure TForm1. N21Click (Sender: TObject);

begin

Form10. ShowModal;

end;

procedure TForm1. N23Click (Sender: TObject);

begin

Form12. ShowModal;

{if not pass then

begin

ShowMessage ('ip p! ');

Exit;

end

else

begin

Form1. N3. Enabled: =true;

Form1. N8. Enabled: =true;

end; }

end;

procedure TForm1. N6Click (Sender: TObject);

begin

form13. showmodal;

end;

end.

unit UPoslygu;

interface

uses

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

Dialogs, Grids, DBGrids, ExtCtrls, DBCtrls, StdCtrls, Mask;

type

TForm2 = class (TForm)

GroupBox1: TGroupBox;

DBGrid1: TDBGrid;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

DBNavigator1: TDBNavigator;

Button1: TButton;

DBNavigator2: TDBNavigator;

Label4: TLabel;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form2: TForm2;

index,max: Integer;

implementation

uses UAvto, Unit1;

{$R *. dfm}

procedure TForm2. GiveIndex;

begin

if DataModule1. IBTable1. RecNo<>0 then

begin

DataModule1. IBTable1. First;

max: =DataModule1. IBTable1. FieldByName ('id_poslygu'). AsInteger;

while not DataModule1. IBTable1. Eof do begin

if max<DataModule1. IBTable1. fieldByName ('id_poslygu'). AsInteger then max: =DataModule1. IBTable1. fieldByName ('id_poslygu'). AsInteger;

DataModule1. IBTable1. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm2. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable1. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm2. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm2. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit Unit1;

interface

uses

SysUtils, Classes, DB, DBTables, IBDatabase, IBCustomDataSet, IBTable,

IBQuery;

type

TDataModule1 = class (TDataModule)

DataSource1: TDataSource;

DataSource2: TDataSource;

DataSource3: TDataSource;

DataSource4: TDataSource;

IBTable1: TIBTable;

IBTable2: TIBTable;

IBTable3: TIBTable;

IBTable4: TIBTable;

IBDatabase1: TIBDatabase;

IBTransaction1: TIBTransaction;

IBTable5: TIBTable;

DataSource5: TDataSource;

avto: TIBTable;

IBTable5ID_ZAKAZY: TIntegerField;

IBTable5ID_AVTO: TIntegerField;

IBTable5ID_POSLYGU: TIntegerField;

IBTable5ID_ZAPCHASTUN: TIntegerField;

IBTable5COUNT_ZAPCHASTUN: TIntegerField;

IBTable5DATA_POSLYGU: TDateTimeField;

IBTable5DATA_OPLATU: TDateTimeField;

IBTable5avto: TStringField;

Poslygu: TIBTable;

IBTable5poslygu: TStringField;

Zapchastunu: TIBTable;

IBTable5zapchastunu: TStringField;

IBQuery1: TIBQuery;

DataSource6: TDataSource;

IBTable1ID_POSLYGU: TIntegerField;

IBTable1POSLYGA: TIBStringField;

IBTable1PRICE_POSLYGU: TIBBCDField;

IBQuery2: TIBQuery;

DataSource7: TDataSource;

IBQuery3: TIBQuery;

DataSource8: TDataSource;

IBQuery2ID_ZAKAZY: TIntegerField;

IBQuery2POSLYGA: TIBStringField;

IBQuery2PRICE: TIBBCDField;

IBQuery2ZAPCHASTUNU: TIBStringField;

IBQuery2PRICE1: TIBBCDField;

IBQuery2KOUNT: TIntegerField;

IBQuery2SYMA: TIBBCDField;

IBQuery3ID_ZAKAZY: TIntegerField;

IBQuery3POSLYGA: TIBStringField;

IBQuery3PRICE: TIBBCDField;

IBQuery3ZAPCHASTUNU: TIBStringField;

IBQuery3PRICE1: TIBBCDField;

IBQuery3KOUNT: TIntegerField;

IBQuery3SYMA: TIBBCDField;

IBQuery1NAME: TIBStringField;

IBQuery1PRICE: TIBBCDField;

IBQuery1KOUNT: TIntegerField;

IBQuery1F_1: TIBBCDField;

IBQuery3SYMA1: TIBBCDField;

private

{ Private declarations }

public

{ Public declarations }

end;

var

DataModule1: TDataModule1;

implementation

uses UPrint;

{$R *. dfm}

end.

unit UZapchastunu;

interface

uses

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

Dialogs, StdCtrls, Mask, DBCtrls, ExtCtrls, Grids, DBGrids;

type

TForm3 = class (TForm)

GroupBox1: TGroupBox;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

DBNavigator2: TDBNavigator;

DBNavigator1: TDBNavigator;

Label4: TLabel;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form3: TForm3;

index,max: Integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm3. GiveIndex;

begin

if DataModule1. IBTable2. RecNo<>0 then

begin

DataModule1. IBTable2. First;

max: =DataModule1. IBTable2. FieldByName ('id_zapchastun'). AsInteger;

while not DataModule1. IBTable2. Eof do begin

if max<DataModule1. IBTable2. fieldByName ('id_zapchastun'). AsInteger then max: =DataModule1. IBTable2. fieldByName ('id_zapchastun'). AsInteger;

DataModule1. IBTable2. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm3. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable2. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm3. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm3. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit UClientu;

interface

uses

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

Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, Grids, DBGrids;

type

TForm4 = class (TForm)

GroupBox1: TGroupBox;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

GroupBox2: TGroupBox;

DBEdit12: TDBEdit;

DBEdit13: TDBEdit;

DBEdit14: TDBEdit;

Label12: TLabel;

Label13: TLabel;

Label14: TLabel;

Label15: TLabel;

DBEdit15: TDBEdit;

DBNavigator2: TDBNavigator;

Button1: TButton;

DBNavigator1: TDBNavigator;

DBNavigator3: TDBNavigator;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form4: TForm4;

index,max: Integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm4. GiveIndex;

begin

if DataModule1. IBTable3. RecNo<>0 then

begin

DataModule1. IBTable3. First;

max: =DataModule1. IBTable3. FieldByName ('id_clienta'). AsInteger;

while not DataModule1. IBTable3. Eof do begin

if max<DataModule1. IBTable3. fieldByName ('id_clienta'). AsInteger then max: =DataModule1. IBTable3. fieldByName ('id_clienta'). AsInteger;

DataModule1. IBTable3. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm4. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable3. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm4. DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm4. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit UZakaz;

interface

uses

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

Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, Grids, DBGrids;

type

TForm5 = class (TForm)

GroupBox1: TGroupBox;

DBEdit1: TDBEdit;

DBEdit3: TDBEdit;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

DBEdit6: TDBEdit;

DBEdit7: TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

DBLookupComboBox1: TDBLookupComboBox;

DBEdit2: TDBEdit;

Label8: TLabel;

DBLookupComboBox2: TDBLookupComboBox;

DBLookupComboBox3: TDBLookupComboBox;

Label9: TLabel;

Label10: TLabel;

DBGrid1: TDBGrid;

DBNavigator2: TDBNavigator;

Button1: TButton;

DBNavigator3: TDBNavigator;

Label11: TLabel;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form5: TForm5;

index,max: Integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm5. GiveIndex;

begin

if DataModule1. IBTable5. RecNo<>0 then

begin

DataModule1. IBTable5. First;

max: =DataModule1. IBTable5. FieldByName ('id_zakazy'). AsInteger;

while not DataModule1. IBTable5. Eof do begin

if max<DataModule1. IBTable5. fieldByName ('id_zakazy'). AsInteger then max: =DataModule1. IBTable5. fieldByName ('id_zakazy'). AsInteger;

DataModule1. IBTable5. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm5. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable5. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm5. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm5. DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit UShow;

interface

uses

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

Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, Mask;

type

TForm6 = class (TForm)

GroupBox1: TGroupBox;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

DBGrid2: TDBGrid;

DBNavigator2: TDBNavigator;

GroupBox2: TGroupBox;

GroupBox3: TGroupBox;

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form6: TForm6;

implementation

uses Unit1;

{$R *. dfm}

end.

unit UZaputPoslyg;

interface

uses

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

Dialogs, StdCtrls, Grids, DBGrids, ComCtrls;

type

TForm7 = class (TForm)

DBGrid1: TDBGrid;

Button1: TButton;

GroupBox1: TGroupBox;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Picker1: TDateTimePicker;

Picker2: TDateTimePicker;

GroupBox2: TGroupBox;

Edit1: TEdit;

Label5: TLabel;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form7: TForm7;

sum: real;

i: integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm7. Button1Click (Sender: TObject);

var dat1,dat2: TDate;

begin

dat1: =Picker1. Date;

dat2: =Picker2. Date;

DataModule1. IBQuery1. Close;

DataModule1. IBQuery1. SQL. Clear;

DataModule1. IBQuery1. SQL. Add ('select poslyga, price_poslygu');

DataModule1. IBQuery1. SQL. Add ('from zakaz, poslygu');

DataModule1. IBQuery1. SQL. Add ('where poslygu. id_poslygu=zakaz. id_poslygu');

DataModule1. IBQuery1. SQL. Add ('and data_oplatu between'+Label1. Caption+DateToStr (dat1) +Label1. Caption+'and'+Label1. Caption+DateToStr (dat2) +Label1. Caption);

DataModule1. IBQuery1. Open;

sum: =0;

for i: =1 to DataModule1. IBQuery1. RecordCount do

begin

sum: =sum+DataModule1. IBQuery1. fieldbyname ('price_poslygu'). AsFloat;

DataModule1. IBQuery1. Next;

end;

Edit1. Text: =FloatToStr (sum);

end;

procedure TForm7. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery1. Close;

end;

end.

unit UZaputZapchastun;

interface

uses

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

Dialogs, StdCtrls, Grids, DBGrids, ComCtrls;

type

TForm8 = class (TForm)

GroupBox1: TGroupBox;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

Label1: TLabel;

Picker1: TDateTimePicker;

Picker2: TDateTimePicker;

GroupBox2: TGroupBox;

Edit1: TEdit;

Label5: TLabel;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form8: TForm8;

sum: real;

i: integer;

implementation

uses Unit1, UPrint;

{$R *. dfm}

procedure TForm8. Button1Click (Sender: TObject);

var dat1,dat2: TDate;

begin

dat1: =Picker1. Date;

dat2: =Picker2. Date;

DataModule1. IBQuery1. Close;

DataModule1. IBQuery1. SQL. Clear; // F_1

DataModule1. IBQuery1. SQL. Add ('select name_zapchastun as name, price_zapchastun as price, count_zapchastun as kount, price_zapchastun*count_zapchastun');

DataModule1. IBQuery1. SQL. Add ('from zakaz, zapchastunu');

DataModule1. IBQuery1. SQL. Add ('where zapchastunu. id_zapchastun=zakaz. id_zapchastun');

DataModule1. IBQuery1. SQL. Add ('and data_oplatu between'+Label1. Caption+DateToStr (dat1) +Label1. Caption+'and'+Label1. Caption+DateToStr (dat2) +Label1. Caption);

DataModule1. IBQuery1. Open;

sum: =0;

for i: =1 to DataModule1. IBQuery1. RecordCount do

begin

sum: =sum+DataModule1. IBQuery1. fieldbyname ('F_1'). AsFloat;

DataModule1. IBQuery1. Next;

end;

Edit1. Text: =FloatToStr (sum);

end;

procedure TForm8. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery1. Close;

end;

end.

unit UPrint;

interface

uses

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

Dialogs, QRCtrls, QuickRpt, ExtCtrls;

type

TfmPrint = class (TForm)

QuickRep1: TQuickRep;

QRBand1: TQRBand;

QRBand2: TQRBand;

QRSubDetail1: TQRSubDetail;

QRLabel1: TQRLabel;

QRLabel2: TQRLabel;

QRLabel3: TQRLabel;

QRLabel4: TQRLabel;

QRLabel5: TQRLabel;

QRLabel6: TQRLabel;

QRLabel7: TQRLabel;

QRLabel8: TQRLabel;

QRLabel9: TQRLabel;

QRLabel10: TQRLabel;

QRLabel11: TQRLabel;

QRLabel12: TQRLabel;

QRLabel13: TQRLabel;

QRDBText1: TQRDBText;

QRDBText2: TQRDBText;

QRDBText3: TQRDBText;

QRDBText4: TQRDBText;

QRDBText5: TQRDBText;

QRDBText6: TQRDBText;

QRDBText7: TQRDBText;

QRBand3: TQRBand;

QRLabel14: TQRLabel;

QRSysData1: TQRSysData;

QRLabel15: TQRLabel;

QRLabel17: TQRLabel;

QRLabel16: TQRLabel;

QRLabel18: TQRLabel;

QRSysData2: TQRSysData;

QRLabel19: TQRLabel;

private

{ Private declarations }

public

{ Public declarations }

end;

var

fmPrint: TfmPrint;

implementation

uses UZaputPoslyg, Unit1, UZvit1;

{$R *. dfm}

end.

unit UZvit1;

interface

uses

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

Dialogs, StdCtrls, Grids, DBGrids, ExtCtrls, ComCtrls;

type

TForm9 = class (TForm)

GroupBox1: TGroupBox;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

Button2: TButton;

Label1: TLabel;

Edit3: TEdit;

Label5: TLabel;

Label6: TLabel;

Edit4: TEdit;

Label7: TLabel;

Label8: TLabel;

Edit5: TEdit;

Label9: TLabel;

Panel1: TPanel;

Button3: TButton;

Picker1: TDateTimePicker;

Picker2: TDateTimePicker;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

procedure Button2Click (Sender: TObject);

procedure Button3Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form9: TForm9;

i: integer;

sum: real;

dat1,dat2: TDate;

implementation

uses Unit1, UPrint, DB;

{$R *. dfm}

procedure TForm9. Button1Click (Sender: TObject);

begin

dat1: =Picker1. Date;

dat2: =Picker2. Date;

DataModule1. IBQuery2. Close;

DataModule1. IBQuery2. SQL. Clear;

DataModule1. IBQuery2. SQL. Add ('select id_zakazy, poslyga as poslyga, price_poslygu as price, name_zapchastun as zapchastunu, price_zapchastun as price, count_zapchastun as kount, (price_poslygu+price_zapchastun*count_zapchastun) as syma');

DataModule1. IBQuery2. SQL. Add ('from zakaz, poslygu, zapchastunu');

DataModule1. IBQuery2. SQL. Add ('where zapchastunu. id_zapchastun=zakaz. id_zapchastun and poslygu. id_poslygu=zakaz. id_poslygu');

DataModule1. IBQuery2. SQL. Add ('and data_oplatu between'+Label1. Caption+DateToStr (dat1) +Label1. Caption+'and'+Label1. Caption+DateToStr (dat2) +Label1. Caption);

DataModule1. IBQuery2. Open;

sum: =0;

for i: =1 to DataModule1. IBQuery2. RecordCount do

begin

sum: =sum+DataModule1. IBQuery2. fieldbyname ('syma'). AsFloat;

DataModule1. IBQuery2. Next;

end;

Edit3. Text: =FloatToStr (sum);

end;

procedure TForm9. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery2. Close;

Edit3. Text: ='';

Edit5. Text: ='';

end;

procedure TForm9. Button2Click (Sender: TObject);

begin

if DataModule1. IBQuery2. Active=false

then MessageDlg (' ', mtWarning, mbOKCancel, 0)

else begin

fmPrint: =TfmPrint. Create (Self);

fmPrint. QRLabel4. Caption: =DateToStr (Picker1. Date);

fmPrint. QRLabel6. Caption: =DateToStr (Picker2. Date);

fmPrint. QRLabel17. Caption: =Form9. Edit3. Text+' p. ';

fmPrint. QRLabel18. Caption: =Form9. Edit5. Text+' p. ';

fmPrint. QuickRep1. Preview;

fmPrint. Free;

end;

end;

procedure TForm9. Button3Click (Sender: TObject);

begin

if DataModule1. IBQuery2. Active=false

then MessageDlg (' ', mtWarning, mbOKCancel, 0)

else begin

Edit5. Text: =FloatToStr (StrToFloat (Edit3. Text) *StrToFloat ('0,'+Edit4. Text));

end;

end;

end.

unit UZvit2;

interface

uses

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

Dialogs, StdCtrls, Grids, DBGrids, ExtCtrls, ComObj;

type

TForm10 = class (TForm)

GroupBox1: TGroupBox;

Label2: TLabel;

Label4: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

Edit1: TEdit;

Edit2: TEdit;

Button2: TButton;

Label1: TLabel;

Label3: TLabel;

Edit3: TEdit;

Panel1: TPanel;

Label5: TLabel;

Edit4: TEdit;

Edit5: TEdit;

Label6: TLabel;

Edit6: TEdit;

Label7: TLabel;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

procedure Button2Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form10: TForm10;

sum,sum1,sum2: real;

i: integer;

implementation

uses Unit1, UPrint1;

{$R *. dfm}

procedure TForm10. Button1Click (Sender: TObject);

begin

if (Edit1. Text='') or (Edit2. Text='') or (Edit3. Text='') then MessageDlg ('i ', mtWarning, [mbOk], 0) else

begin

DataModule1. IBQuery3. Close;

DataModule1. IBQuery3. SQL. Clear;

DataModule1. IBQuery3. SQL. Add ('select id_zakazy, poslyga as poslyga, price_poslygu as price, name_zapchastun as zapchastunu, price_zapchastun as price, count_zapchastun as kount, (price_zapchastun*count_zapchastun) as syma1, (price_poslygu+price_zapchastun*count_zapchastun) as syma');

DataModule1. IBQuery3. SQL. Add ('from zakaz, poslygu, zapchastunu, avto, clientu');

DataModule1. IBQuery3. SQL. Add ('where zapchastunu. id_zapchastun=zakaz. id_zapchastun and poslygu. id_poslygu=zakaz. id_poslygu');

DataModule1. IBQuery3. SQL. Add ('and avto. nomer_reestracii=zakaz. id_avto and clientu. id_clienta=avto. id_clienta');

DataModule1. IBQuery3. SQL. Add ('and first_name='+Label1. Caption+Edit1. Text+Label1. Caption+'and nomer_reestracii='+Label1. Caption+Edit2. Text+Label1. Caption+'and marka='+Label1. Caption+Edit3. Text+Label1. Caption);

DataModule1. IBQuery3. Open;

sum: =0;

sum1: =0;

sum2: =0;

for i: =1 to DataModule1. IBQuery3. RecordCount do

begin

sum: =sum+DataModule1. IBQuery3. fieldbyname ('syma'). AsFloat;

sum1: =sum1+DataModule1. IBQuery3. fieldbyname ('price'). AsFloat;

sum2: =sum2+DataModule1. IBQuery3. fieldbyname ('syma1'). AsFloat;

DataModule1. IBQuery3. Next;

end;

Edit4. Text: =FloatToStr (sum);

Edit5. Text: =FloatToStr (sum1);

Edit6. Text: =FloatToStr (sum2);

end;

end;

procedure TForm10. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery3. Close;

end;

procedure TForm10. Button2Click (Sender: TObject);

var

Exc,Colum: OleVariant;

i,jj,j: byte;

begin

if DataModule1. IBQuery3. Active=false

then MessageDlg (' ', mtWarning, mbOKCancel, 0)

else begin

Exc: =CreateOleObject ('Excel. Application');

// Exc. WorkBooks. Open ('D: \\\ pc\pc - IC\InterBase-p\p\akt. xls');

Exc. Visible: =true;

Exc. Workbooks. Add (-4167);

Exc. Workbooks [1]. WorkSheets [1]. Name: ='';

Colum: =Exc. Workbooks [1]. WorkSheets ['']. Columns;

Colum. Columns [1]. ColumnWidth: =7;

Colum. Columns [2]. ColumnWidth: =25;

Colum. Columns [3]. ColumnWidth: =10;

Colum. Columns [4]. ColumnWidth: =25;

Colum. Columns [5]. ColumnWidth: =10;

Colum. Columns [6]. ColumnWidth: =7;

Colum. Columns [7]. ColumnWidth: =10;

j: =1;

for i: =0 to DBGrid1. Columns. Count-1 do

begin

Exc. Cells [1,j]: =DBGrid1. Columns [i]. Title. Caption;

Exc. Cells [1,j]. Font. Bold: = True;

Exc. Cells [1,j]. Font. Size: =12;

j: =j+1;

end;

j: =0;

DataModule1. IBQuery3. First;

for i: =1 to DataModule1. IBQuery3. RecordCount do

begin

jj: =1;

begin

for j: =0 to DBGrid1. Columns. Count-1 do

begin

Exc. Cells [i+1,jj]: =DBGrid1. Columns [j]. Field. AsString;

jj: =jj+1;

end;

end;

DataModule1. IBQuery3. Next;

end;

end;

end;

end.

unit UConnect;

interface

uses

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

Dialogs, StdCtrls, ExtCtrls;

type

TfmConnect = class (TForm)

GroupBox1: TGroupBox;

RadioGroup1: TRadioGroup;

Button2: TButton;

Button3: TButton;

OpenDialog1: TOpenDialog;

Label1: TLabel;

Label2: TLabel;

Edit1: TEdit;

Edit2: TEdit;

procedure Button3Click (Sender: TObject);

procedure RadioGroup1Click (Sender: TObject);

procedure Button2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

fmConnect: TfmConnect;

tfl: TextFile;

implementation

uses Unit1, UAvto;

{$R *. dfm}

procedure TfmConnect. Button3Click (Sender: TObject);

begin

if (Edit2. Text='') then MessageDlg ('i ! ', mtWarning, [mbOk], 0) else

begin

if RadioGroup1. ItemIndex=0 then

begin

DataModule1. IBDatabase1. DatabaseName: =Edit2. Text;

end

else

begin

DataModule1. IBDatabase1. DatabaseName: =Edit1. Text+': '+Edit2. Text;

end;

DataModule1. IBDatabase1. Connected: =true;

DataModule1. IBTable1. Open;

DataModule1. IBTable2. Open;

DataModule1. IBTable3. Open;

DataModule1. IBTable4. Open;

DataModule1. IBTable5. Open;

DataModule1. Avto. Open;

DataModule1. Poslygu. Open;

DataModule1. Zapchastunu. Open;

Form1. N4. Enabled: =true;

Form1. N7. Enabled: =true;

Form1. N13. Enabled: =true;

Form1. N15. Enabled: =true;

Form1. N23. Enabled: =true;

Form1. N6. Enabled: =true;

Form1. N2. Enabled: =false;

Form1. N17. Enabled: =false;

AssignFile (tfl,ExtractFileDir (Application. ExeName) +'/connect. db');

Rewrite (tfl);

writeln (tfl,Edit1. Text);

writeln (tfl,Edit2. Text);

if RadioGroup1. ItemIndex=0 then writeln (tfl,'0') else writeln (tfl,'1');

CloseFile (tfl);

Form1. GroupBox1. Visible: =true;

fmConnect. Close;

end;

end;

procedure TfmConnect. RadioGroup1Click (Sender: TObject);

begin

if RadioGroup1. ItemIndex=0 then

begin

Label1. Enabled: =false;

Edit1. Enabled: =FALSE;

end

else

begin

Label1. Enabled: =true;

Edit1. Enabled: =true;

end;

end;

procedure TfmConnect. Button2Click (Sender: TObject);

begin

OpenDialog1. Execute;

Edit2. Text: =OpenDialog1. FileName;

end;

procedure TfmConnect. FormShow (Sender: TObject);

begin

AssignFile (tfl,ExtractFileDir (Application. ExeName) +'/connect. db');

Reset (tfl);

readln (tfl,str1);

readln (tfl,str2);

readln (tfl,str3);

if str3='0' then RadioGroup1. ItemIndex: =0 else RadioGroup1. ItemIndex: =1;

Edit1. Text: =str1;

Edit2. Text: =str2;

CloseFile (tfl);

end;

end.

unit UPassword2;

interface

uses

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

Dialogs, StdCtrls, Mask;

type

TForm12 = class (TForm)

MaskEdit1: TMaskEdit;

Label1: TLabel;

Button1: TButton;

Button2: TButton;

procedure Button1Click (Sender: TObject);

procedure Button2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

PWchar=record

C: string [1];

end;

var

Form12: TForm12;

pass: boolean;

password: string;

PSWDChar: array [1. .36] of PWchar;

f2: file of PWchar;

implementation

uses UAvto, UZminaPassword;

{$R *. dfm}

procedure TForm12. Button1Click (Sender: TObject);

begin

if MaskEdit1. Text=Form1. Label2. Caption then

begin

Form1. N3. Enabled: =true;

Form1. N8. Enabled: =true;

Close;

end

else

ShowMessage ('ip p. ');

end;

procedure TForm12. Button2Click (Sender: TObject);

begin

Close;

end;

procedure TForm12. FormShow (Sender: TObject);

var i: byte;

chk: byte;

begin

password: ='';

MaskEdit1. Text: ='';

chk: =2;

AssignFile (f2,ExtractFileDir (Application. ExeName) +'/info. ini');

Reset (f2);

for i: =1 to 36 do begin

Read (f2,PSWDChar [i]);

if (chk=i) {and (PSWDChar [i]. C<>'') } then begin

password: =password+PSWDChar [i]. C;

chk: =chk+3;

end;

end;

CloseFile (f2);

Form1. Label2. Caption: =password;

end;

end.

unit UZminaPassword;

interface

uses

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

Dialogs, StdCtrls, Mask;

const

Chars='~PCި,. ! pcqwertyuiop [] \; lkjhgfdsazxcvbnm,. /1234567890-=`~! @#$%^&* () _+<>?: |}{MNBVCXZLKJHGFDSAPOIUYTREWQ';

type

TForm13 = class (TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

MaskEdit1: TMaskEdit;

MaskEdit2: TMaskEdit;

MaskEdit3: TMaskEdit;

Button1: TButton;

Button2: TButton;

procedure Button1Click (Sender: TObject);

procedure Button2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

PWchar=record

C: string [1];

end;

var

Form13: TForm13;

password: string;

PSWDChar: array [1. .36] of PWchar;

f2: file of PWchar;

implementation

uses UAvto, UPassword2;

{$R *. dfm}

procedure TForm13. Button1Click (Sender: TObject);

var l,r, i: byte;

begin

r: =0;

i: =0;

if MaskEdit1. Text=password then

begin

if MaskEdit2. Text=MaskEdit3. Text then

begin

password: =MaskEdit2. Text;

Form1. Label2. Caption: =password;

l: =length (password);

while i<=33 do begin

inc (r);

inc (i);

PSWDChar [i]. C: =copy (Chars,random (162),1);

inc (i);

if i<l*3 then PSWDChar [i]. C: =copy (password,r,1)

else PSWDChar [i]. C: ='';

inc (i);

PSWDChar [i]. C: =copy (Chars,random (162),1);

end;

assignfile (f2,ExtractFileDir (Application. ExeName) +'/info. ini');

rewrite (f2);

for i: =1 to 36 do begin

Write (f2,PSWDChar [i]);

end;

CloseFile (f2);

Form1. Label2. Caption: =password;

Close;

end

else ShowMessage ('pi ci. ');

end

else ShowMessage ('ip p. ');

end;

procedure TForm13. Button2Click (Sender: TObject);

begin

Close;

end;

procedure TForm13. FormShow (Sender: TObject);

var i: byte;

chk: byte;

begin

MaskEdit1. Text: ='';

MaskEdit2. Text: ='';

MaskEdit3. Text: ='';

password: ='';

chk: =2;

AssignFile (f2,ExtractFileDir (Application. ExeName) +'/info. ini');

Reset (f2);

for i: =1 to 36 do begin

Read (f2,PSWDChar [i]);

if (chk=i) and (PSWDChar [i]. C<>'') then begin

password: =password+PSWDChar [i]. C;

chk: =chk+3;

end;

end;

CloseFile (f2);

Form1. Label2. Caption: =password;

end;

end

/
:
? : letsdoit777.blogspot.com
07:32:19 19 2016
9000 " "? : business1777.blogspot.com ! C !
19:45:58 28 2015

, :



, ?

, .
, .
, .
, .
, .



(151312)
(1844)
Copyright 2005-2016 BestReferat.ru bestreferat@mail.ru

@Mail.ru