. , , ,

,,,

,

1.

2.

3. ,

4.


, , , , . .

- , . .

, , . , : Aushan, Metro, , , , .

, .

. , , . . . , . .


1.

1, 29 1969 225 . 1992 . .

- . 1993 tr . 1999 l, . l, . : .

2001 . 2004 . . 2008 200 . . . 180 000 . 200 : , , , , .

30 . , -, --, , , .

, WorldFood , , . . 2007-2008 20 , 6 , . , . : , , , , , .

:

ü  

ü   ,

ü  

ü  

ü  

, , . Online.

.1

.2

, . :

ü   ;

ü   ;

ü   .

, . , . . , . , .

, , :

ü   Word

ü   Access

ü   Delphi

2

Access. Microsoft Access , , .

MS Access:

-    ;

-    ;

-    SQL- ( SQL MS Access ANSI);

-    , .

. MS Access , Access.

MS Access , . Access , . .

, , ( Microsoft Office Access) , .mdb.

:

 (, , ..) ;

 - ;

 ;

 ;

 ; ; ; .

"":

 , . , . (, ).

 - , .

 , , .

 - , , , , .

 - Web-, , Microsoft Access MS SQL Server.

 - , .

 - , Visual Basic, .

Access

, , . , Access , , .

:

           , Access

           , ,

           ,

           , ,

          

           , ,

          

           ,

           , ,

ss

ss : ; ; .

. ss .

. ( ). . , . , .

. , , ( ), . , Access , .

Access , . :

Access ( Microsoft Excel);

;

( ).

. . .

1. Access.

2. . .mdb .

3. : .

4. .

5. .

6. .

7. , . , .

.

, , , , .

. , . , , .

1. .

2. , , .

3. . .

4. , ( , Access ).

5. -> , Access.

6. . , , .

6 (.3).

.3


.4

.5

.6

.7

.8


.9

.10

.11

.12

.13


.14

.15

3. ,

. . , . , . , , , , , , .

m a1, a2,... am. n b1, b2... bn. Cij, i=1,2,...m; j=1,2,...n i- j- . , , , .

:

 

:

-    =(a1,a2,...,am)

-    B=(b1,b2,...,bn)

-    :

() xij, i=1,2,...,m j=1,2,...,n i- j- . :


Cij*Xij i- j- , :

. , :

. m , m :

n n :

:


, , ..:

 

: X=(xij), i=1,2,...,m; j=1,2,...,n, ( 2 ), .

4.

Delphi7 Delphi , Object Pascal. - turbo pascal, - windows, linux. , . Form1 Delphi. Form, File->New->Form (.16).

.16 .


:

ü   Label, Labe2 - ( ) . , . Caption .

ü   Edit1, Edit2 - , . Delphi Edit, , Edit1.Text String.

ü   Button1, Button2 - Delphi Button . Delphi Button OnClick .

Unit1 :

procedure TForm1.Button2Click(Sender: TObject);

begin

Form1.Close;

end;

procedure TForm1.Button1Click(Sender: TObject);

const

log='admin';

pas='505';

var log0,pas0:string;

begin

log0:=edit1.Text;

pas0:=edit2.Text;

if (log=log0) and (pas=pas0) then begin Form2.show; form1.Hide; end else

if (log<>log0) or (pas<>pas0) then showmessage(' login\password ');

end; end.

Form2, . (.17). , . , , .

.17 .

.18 .

.19 .

.20 .


.21 .

.22 .

:

ü   DBEdit1-25 - . DBEdit Edit. : , , . , DBEdit, .

ü   DBNavigator1-6 , , .

ü   GroupBox1-6 - , .

ü   Image1- . .

ü   ADOConnection1 .

ü   DataSource1-6 - . .

ü   ADOTable1-6 - . ( ).

Unit2 :

procedure TForm2.Button1Click(Sender: TObject);

begin

Form2.Close;

Form1.Close;

end;

procedure TForm2.Button2Click(Sender: TObject);

begin

form3.showmodal;

end;

end.

(Form3), (.23). , . , .

.23 .


:

ü   StringGrid1 - , . StringGrid.

Unit3 :

procedure TForm3.Button1Click(Sender: TObject);

begin

Form1.Close;

Form2.Close;

Form3.Close;

end;

procedure TForm3.FormActivate(Sender: TObject)

begin

tabl.Cells[0,0]:= ';

tabl.Cells[1,0]:=' (km)';

tabl.Cells[0,1]:=' ';

tabl.Cells[0,2]:=' ';

tabl.Cells[0,3]:=' ';

tabl.Cells[0,4]:='777';

end;

procedure TForm3.Button2Click(Sender: TObject);

var

c,r:integer;

s:integer;

p:integer;

m:integer;

buf:array[0..5] of string;

i:integer;

begin

for r:=1 to tabl.rowcount do /

begin

for c:=1 to 3 do

if tabl.cells[c,r] <> ''

then s:=s+StrToInt(tabl.cells[c,r])

else tabl.cells[c,r]:='0';

p:=7*StrToInt(tabl.cells[1,r])+

6*StrToInt(tabl.cells[2,r])+

5*StrToInt(tabl.cells[3,r]);

tabl.cells[4,r]:=IntToStr(s); // âñåãî ìåäàëåé

tabl.cells[5,r]:=IntToStr(p); // î÷êîâ

end;

for r:=1 to tabl.rowcount-1 do

begin

m:=r; // for i:=r to tabl.rowcount-1 do

if StrToInt(tabl.cells[5,i])>StrToInt(tabl.cells[5,m])

then m:=i;

if r <> m then

begin

for c:=0 to 5 do

begin

buf[c]:=tabl.Cells[c,r];

tabl.Cells[c,r]:=tabl.Cells[c,m];

tabl.Cells[c,m]:=buf[c];

end;

end;

end;

end;

procedure TForm3.Button3Click(Sender: TObject);

begin

form4.showmodal;

end; end.

(Form4), (.24). , , , , . .

.24 .

:

ü   LabeledEdit1-2 - . 6.

ü   WordApplication1 - .

ü   WordParagraphFormat1 - Microsoft Word Delphi.

ü   SaveDialog - ....

Unit4 :

procedure TForm4.Button1Click(Sender: TObject);

begin

Form1.Close;

Form2.Close;

Form3.Close;

Form4.Close;

end;

procedure TForm4.FormCreate(Sender: TObject);

var TS: OleVariant;

NT: OleVariant;

begin

WordApplication1.Connect;

TS:='Normal';

NT:=FALSE;

WordApplication1.Documents.AddOld(TS,NT);

WordApplication1.ActiveDocument.PageSetup.LeftMargin:=15.0;

WordApplication1.ActiveDocument.PageSetup.TopMargin:=10.0;

WordApplication1.ActiveDocument.PageSetup.RightMargin:=10.0;

WordApplication1.ActiveDocument.PageSetup.BottomMargin:=10.0; // end;

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

begin

WordApplication1.Disconnect

end;

procedure TForm4.Button2Click(Sender: TObject);

var CD: OleVariant;

FN: OleVariant;

FT: OleVariant;

begin

if SaveDialog.Execute then

begin

CD:=wdCollapseEnd;

FN:=SaveDialog.FileName;

FT:=wdFormatDocument;

WordApplication1.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter; WordApplication1.Selection.InsertBefore(labeledEdit1.text+' '+ #30);

WordApplication1.Selection.Collapse(CD); WordApplication1.Selection.InsertBefore(LabeledEdit2.Text+#13);

WordApplication1.Selection.Collapse(CD); WordApplication1.ActiveDocument.SaveAs(FN,FT,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);

WordApplication1.Visible:=TRUE

end

end;

procedure TForm4.WordApplicationQuit(Sender: TObject);

begin

Close

end; end.

5.

, (.25).

.25


, , (.26).

.26

, (.27).

.27

, Access, Delphi on-line (.28). (, , ), DBEdit. . . .


.28

, (.29). , . .

.29

, (.30).


.30 .

, , (.31). .

. 31

:

‑5

‑7

‑25

, , .

, , , , . , . :

ü   Word 2003

ü   Access2003

ü   Delphi 7

.


, . , , . , , .

- . , , , .

, , , , , .

. , , .


1.   , . : . / , , , , , ; . .. . 2- ., . . .: , 2005. - 736 .

2.   ., . : // . 2005. - 8. 30 .

3.   .. : . - ., , , 1994. - 685 .

4.   .. : . .: , 2001.

5.   Delhphi 6.5, .., . . 2002, 816 .

6.   1. . , . , .

7.   (HELP) Delphi 5 Object Pascal (32 . CD-ROM) , ISBN 5-7989-0168-8.

8.   . . Delphi 5 , ISBN 5-7989-0104-1.

9.   . . Delphi 6 , ISBN 5-7989-0227-7.

10.                  .p, .p Delphi 4 .


program Project1;

uses

Forms,

Unit1 in 'Unit1.pas' {Form1},

Unit2 in 'Unit2.pas' {Form2},

Unit3 in 'Unit3.pas' {Form3},

Unit4 in 'Unit4.pas' {Form4};

{$R *.res}

begin

Application.Initialize;

Application.CreateForm(TForm1, Form1);

Application.CreateForm(TForm2, Form2);

Application.CreateForm(TForm3, Form3);

Application.CreateForm(TForm4, Form4);

Application.Run;

end.

unit Unit1;

interface

uses

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

Dialogs, StdCtrls;

type

TForm1 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Edit1: TEdit;

Edit2: TEdit;

Button1: TButton;

Button2: TButton;

procedure Button2Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);

begin

Form1.Close;

end;

procedure TForm1.Button1Click(Sender: TObject);

const

log='admin';

pas='505';

var log0,pas0:string;

begin

log0:=edit1.Text;

pas0:=edit2.Text;

if (log=log0) and (pas=pas0) then begin Form2.show; form1.Hide; end else

if (log<>log0) or (pas<>pas0) then showmessage(' login\password ');

end;

unit Unit2;

interface

uses

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

Dialogs, StdCtrls, DB, ADODB, ExtCtrls, DBCtrls, Mask, Grids, DBGrids,

XPMan, ComCtrls, jpeg;

type

TForm2 = class(TForm)

PageControl1: TPageControl;

TabSheet1: TTabSheet;

TabSheet2: TTabSheet;

TabSheet3: TTabSheet;

TabSheet4: TTabSheet;

TabSheet5: TTabSheet;

TabSheet6: TTabSheet;

GroupBox1: TGroupBox;

Button1: TButton;

XPManifest1: TXPManifest;

DBGrid1: TDBGrid;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

DBNavigator1: TDBNavigator;

ADOConnection1: TADOConnection;

ADOTable1: TADOTable;

GroupBox2: TGroupBox;

GroupBox3: TGroupBox;

GroupBox4: TGroupBox;

GroupBox5: TGroupBox;

DBGrid2: TDBGrid;

DBGrid3: TDBGrid;

GroupBox6: TGroupBox;

DBGrid4: TDBGrid;

DBGrid5: TDBGrid;

DBGrid6: TDBGrid;

Label6: TLabel;

Label7: TLabel;

Label8: TLabel;

Label9: TLabel;

DBEdit6: TDBEdit;

DBEdit7: TDBEdit;

DBEdit8: TDBEdit;

DBEdit9: TDBEdit;

Label10: TLabel;

Label11: TLabel;

Label12: TLabel;

Label13: TLabel;

DBEdit10: TDBEdit;

DBEdit11: TDBEdit;

DBEdit12: TDBEdit;

DBEdit13: TDBEdit;

Label14: TLabel;

Label15: TLabel;

Label16: TLabel;

Label17: TLabel;

DBEdit14: TDBEdit;

DBEdit15: TDBEdit;

DBEdit16: TDBEdit;

DBEdit17: TDBEdit;

DBEdit18: TDBEdit;

DBEdit19: TDBEdit;

DBEdit20: TDBEdit;

DBEdit21: TDBEdit;

Label18: TLabel;

Label19: TLabel;

Label20: TLabel;

Label21: TLabel;

Label22: TLabel;

Label23: TLabel;

Label24: TLabel;

Label25: TLabel;

DBEdit22: TDBEdit;

DBEdit23: TDBEdit;

DBEdit24: TDBEdit;

DBEdit25: TDBEdit;

DBNavigator2: TDBNavigator;

DBNavigator3: TDBNavigator;

DBNavigator4: TDBNavigator;

DBNavigator5: TDBNavigator;

DBNavigator6: TDBNavigator;

ADOTable2: TADOTable;

ADOTable3: TADOTable;

ADOTable4: TADOTable;

ADOTable5: TADOTable;

ADOTable6: TADOTable;

DataSource1: TDataSource;

DataSource2: TDataSource;

DataSource3: TDataSource;

DataSource4: TDataSource;

DataSource5: TDataSource;

DataSource6: TDataSource;

Image1: TImage;

Button2: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form2: TForm2;

implementation

uses Unit1, Unit3;

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);

begin

Form2.Close;

Form1.Close;

end;

procedure TForm2.Button2Click(Sender: TObject);

begin

form3.showmodal;

end;

unit Unit3;

interface

uses

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

Dialogs, StdCtrls, Grids;

type

TForm3 = class(TForm)

Button1: TButton;

tabl: TStringGrid;

Label1: TLabel;

Button2: TButton;

Button3: TButton;

procedure Button1Click(Sender: TObject);

procedure FormActivate(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var Form3: TForm3;

implementation

uses Unit1, Unit2, Unit4;

{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject);

begin

Form1.Close;

Form2.Close;

Form3.Close;

end;

procedure TForm3.FormActivate(Sender: TObject)

begin

tabl.Cells[0,0]:= ';

tabl.Cells[1,0]:=' (km)';

tabl.Cells[0,1]:=' ';

tabl.Cells[0,2]:=' ';

tabl.Cells[0,3]:=' ';

tabl.Cells[0,4]:='777';

end;

procedure TForm3.Button2Click(Sender: TObject);

var

c,r:integer;

s:integer;

p:integer;

m:integer;

buf:array[0..5] of string;

i:integer;

begin

for r:=1 to tabl.rowcount do /

begin

for c:=1 to 3 do

if tabl.cells[c,r] <> ''

then s:=s+StrToInt(tabl.cells[c,r])

else tabl.cells[c,r]:='0';

p:=7*StrToInt(tabl.cells[1,r])+

6*StrToInt(tabl.cells[2,r])+

5*StrToInt(tabl.cells[3,r]);

tabl.cells[4,r]:=IntToStr(s); // âñåãî ìåäàëåé

tabl.cells[5,r]:=IntToStr(p); // î÷êîâ

end;

for r:=1 to tabl.rowcount-1 do

begin

m:=r; // ìàêñèìàëüíûé ýëåìåíò - â r-îé ñòðîêå

for i:=r to tabl.rowcount-1 do

if StrToInt(tabl.cells[5,i])>StrToInt(tabl.cells[5,m])

then m:=i;

if r <> m then

begin

for c:=0 to 5 do

begin

buf[c]:=tabl.Cells[c,r];

tabl.Cells[c,r]:=tabl.Cells[c,m];

tabl.Cells[c,m]:=buf[c];

end;

end;

end;

end;

procedure TForm3.Button3Click(Sender: TObject);

begin

form4.showmodal;

end;

unit Unit4;

interface

uses

Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,

Buttons, ExtCtrls, Menus, Dialogs, Mask, ShellApi, Grids, DBGrids, DB,

ADODB, WordXP, OleServer, Messages, Variants,ComObj;

type

TForm4 = class(TForm)

Button1: TButton;

ADOConnection1: TADOConnection;

ADOTable1: TADOTable;

DataSource1: TDataSource;

Button2: TButton;

WordApplication1: TWordApplication;

WordParagraphFormat1: TWordParagraphFormat;

SaveDialog: TSaveDialog;

GroupBox1: TGroupBox;

DBGrid1: TDBGrid;

LabeledEdit1: TLabeledEdit;

LabeledEdit2: TLabeledEdit;

procedure Button1Click(Sender: TObject);

procedure FormCreate(Sender: TObject);

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

procedure Button2Click(Sender: TObject);

procedure WordApplicationQuit(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form4: TForm4;

implementation

uses Unit1, Unit2, Unit3;

{$R *.dfm}

procedure TForm4.Button1Click(Sender: TObject);

begin

Form1.Close;

Form2.Close;

Form3.Close;

Form4.Close;

end;

procedure TForm4.FormCreate(Sender: TObject);

var TS: OleVariant;

NT: OleVariant;

begin

WordApplication1.Connect;

TS:='Normal';

NT:=FALSE;

WordApplication1.Documents.AddOld(TS,NT);

WordApplication1.ActiveDocument.PageSetup.LeftMargin:=15.0;

WordApplication1.ActiveDocument.PageSetup.TopMargin:=10.0;

WordApplication1.ActiveDocument.PageSetup.RightMargin:=10.0;

WordApplication1.ActiveDocument.PageSetup.BottomMargin:=10.0; // end;

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

begin

WordApplication1.Disconnect

end;

procedure TForm4.Button2Click(Sender: TObject);

var CD: OleVariant;

FN: OleVariant;

FT: OleVariant;

begin

if SaveDialog.Execute then

begin

CD:=wdCollapseEnd;

FN:=SaveDialog.FileName;

FT:=wdFormatDocument;

WordApplication1.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter; WordApplication1.Selection.InsertBefore(labeledEdit1.text+' '+ #30);

WordApplication1.Selection.Collapse(CD); WordApplication1.Selection.InsertBefore(LabeledEdit2.Text+#13);

WordApplication1.Selection.Collapse(CD); WordApplication1.ActiveDocument.SaveAs(FN,FT,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);

WordApplication1.Visible:=TRUE

end

end;

procedure TForm4.WordApplicationQuit(Sender: TObject);

begin

Close

end; end.

1. 2. 3. , 4.

 

 

 

! , , , .
. , :