. , , ,

,,,

- "MTTS" — ,

-

- MTTS

: . 1312

. .

 

: :

..

.

2009 .


1.

1.1

1.2

2.

2.1 MTTS

2.2.

2.3. .

2.4.

2.5.

2.6.

2.7.

2.8.

2.9.

2.10.

3. MTTS ۻ

4. MTTS ۻ

5. MTTS ۻ


() (), , . , , . . , .

- ( ) . , , , , , .

Delphi , , , , . Delphi Windows 95, 98, NT. Delphi , Microsoft Visual Basic C++. , Delphi , . Delphi ( ), .


MTTS.

, , . 3 (Page Control), : DBGrid, DBEdit, Query. MainMenu, PopupMenu (, , , , , , , ..).
1.

- S , :

  () ;

  ;

  ;

  ;

 

1.1

3 :

1.  ;

2.  ;

3.  .

PARADOX7:

Tools Database Desktop File New Table Paradox7 Ok.

.

Alias , ( , ). Borland Delphi7 BDE Administrator ( ). Object New OK. : Object Apply OK. Table Database Name , Active True.


1.2

, DataAccess - DataSource DataControls - DBGrid. DataSourse - Dataset - . DBGrid Data Source, . Table Active True. , Run, Active Table False True. ACCESS SQL, ADO - ADOTable, ADO Connection. ADO Connection , . , , . ADOTable Connection ADOConnection, , DataSourse , Table Name - , Active - True. , , MasterSource , MasterFields , Add ok.


2.

 

2.1 MTTS

MTTS . , , . , , , , , . . - ; , .

, Navigator , , ..


2.2.

, , :

.

:

procedure Ttaradd.Button1Click(Sender: TObject);

var i: integer;

begin

if (edit1.Text='') or (edit2.Text='') or (edit3.Text='') then

begin

showmessage(' '+#13+' ');

end else

begin

dd.Query2.Filter:='tarkod='+edit1.Text;

dd.Query2.Filtered:=true;

if dd.Query2.RecordCount=1 then

begin

showmessage(' '+dd.Query2.Fields[1].Text+#13+' ' );

edit1.SetFocus;

dd.Query2.Filtered:=false;

end else

begin

dd.DataSource2.DataSet:=dd.Table2;

dd.Table2.Append;

dd.Table2.Fields[0].AsFloat:=strtofloat(edit1.text);

dd.Table2.Fields[1].Text:=edit2.Text;

dd.Table2.Fields[2].AsFloat:=strtofloat(edit3.Text);

dd.Table2.Post;

dd.DataSource2.DataSet:=dd.Query2;

dd.Query2.Close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('Select * FROM Tarif ORDER BY tarkod');

dd.Query2.Filtered:=false;

dd.Query2.Open;

edit1.Clear;

edit2.Clear;

edit3.Clear;

edit1.SetFocus;

end;

2.3.

, , , :

.

:

procedure Ttared.Button1Click(Sender: TObject);

var i, n, j: integer;

////

begin

//dd.Query2.RecNo:=dd.Table2.RecNo;

dd.DataSource2.DataSet:=dd.Table2;

dd.Table2.Edit;

dd.Table2.Fields[0].AsFloat:=strtofloat(kod.Text); //strtofloat(label4.Caption);

dd.Table2.Fields[1].Text:=gorod.Text; //label5.Caption;

//dd.Table2.Fields[2].AsCurrency:=strtofloat(dbedit3.Text)*1;

dd.Table2.Post;

////

begin

label4.Caption:=kod.Text;

label5.Caption:=gorod.Text;

for i:=1 to dd.Table3.RecordCount do

begin

dd.Table3.Edit;

//dd.Table3.RecNo:=i;

dd.Table3.Fields[6].AsFloat:=strtofloat(label4.Caption);

dd.Table3.Fields[1].Text:=label5.Caption;

dd.Table3.Post;

//dd.Table3.Filter:='pertel='+dbedit1.Text;

//dd.Table3.Filtered:=true;

dd.Table3.Next;

end;

end;

dd.Table3.First;

end.

2.4.

, , , :

.

:

procedure Ttardel.Button1Click(Sender: TObject);

var i: integer;

begin

if messagedlg(' : '+dd.Table2.Fields[1].Text, mtinformation,[mbYes,mbNo],0)=mrYes

then

begin

dd.Table2.Delete;

//dd.Table1.Post;

dd.Query2.Close;

dd.DataSource2.DataSet:=dd.Query2;

dd.Query2.Open;

for i:=1 to dd.Table3.RecordCount do

begin

dd.Table3.RecNo:=i;

dd.Table3.Delete;

end;

dd.Query3.Close;

dd.DataSource3.DataSet:=dd.Query3;

dd.Query3.Open;

// dd.Table3.Post;

end

else exit;

end;

 

2.5.

, , , , . :

.

:

procedure Ttarfind.Button1Click(Sender: TObject);

var s, s1: string;

begin

if pole.ItemIndex=0 then

begin

dd.DataSource2.DataSet:=dd.Query2;

s:='tarkod='+ search.Text;

dd.Query2.Filter:=s;

dd.Query2.Filtered:=true;

if dd.Query2.RecordCount=0 then

showmessage(' . ');

end;

if pole.ItemIndex=1 then

begin

dd.DataSource2.DataSet:=dd.Query2;

dd.Query2.close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('SELECT * FROM tarif');

s1:='WHERE targor'+' LIKE "'+search.Text+'%"';

dd.Query2.SQL.Add(s1);

dd.Query2.Open;

if dd.Query2.RecordCount>=1 then

label6.Caption:=' : :'+floattostr(dd.Query2.RecordCount)+' .';

if dd.Query2.RecordCount=0 then

begin

showmessage(' . ');

search.SetFocus;

end;

end;

if dd.Query2.RecordCount>1 then

begin

label1.Visible:=true;

label2.Visible:=true;

label3.Visible:=true;

label6.Visible:=true;

dbtext1.Visible:=true;

dbtext2.Visible:=true;

dbtext3.Visible:=true;

abfind.height:=264;

button2.Enabled:=true;

end;

end;


2.6

MTTS. . , .

:

procedure Ttarsor.SpeedButton1Click(Sender: TObject);

begin

//

if (pole.ItemIndex=0) and (pole.ItemIndex=0) then

begin

dd.Query2.Close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('SELECT * FROM TARIF ORDER BY tarkod');

dd.Query2.Open;

end;

if (pole.ItemIndex=0) and (pole.ItemIndex=1) then

begin

dd.Query2.Close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('SELECT * FROM TARIF ORDER BY tarkod DESC');

dd.Query2.Open;

end;

//

if (pole.ItemIndex=1) and (pole.ItemIndex=0)then

begin

dd.Query2.Close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('SELECT * FROM TARIF ORDER BY targor');

dd.Query2.Open;

end;

if (pole.ItemIndex=1) and (pole.ItemIndex=1)then

begin

dd.Query2.Close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('SELECT * FROM TARIF ORDER BY targor DESC');

dd.Query2.Open;

end;

//

if (pole.ItemIndex=2) and (pole.ItemIndex=0)then

begin

dd.Query2.Close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('SELECT * FROM TARIF ORDER BY tarprice');

dd.Query2.Open;

end;

if (pole.ItemIndex=2) and (pole.ItemIndex=1)then

begin

dd.Query2.Close;

dd.Query2.SQL.Clear;

dd.Query2.SQL.Add('SELECT * FROM TARIF ORDER BY tarprice DESC');

dd.Query2.Open;

end;

end;

.

 

2.7.

MTTS. , , .

:

procedure Ttarfilter.SpeedButton1Click(Sender: TObject);

begin

if (pole.Text='') or (ysl.Text='') or (text.Text='') then

begin

showmessage(' ');

end else

begin

if pole.ItemIndex=0 then

begin

dd.Query2.Filtered:=false;

dd.Query2.Filter:='TARkod'+ysl.Text+text.Text;

dd.Query2.Filtered:=true;

if dd.Query2.RecordCount=0 then

begin

showmessage(' '+#13+' ');

dd.Query2.Filtered:=false;

end;

end;

if pole.ItemIndex=1 then

begin

dd.Query2.Filtered:=false;

dd.Query2.Filter:='TARgor'+ysl.Text+''''+ text.Text+'''';

dd.Query2.Filtered:=true;

if dd.Query2.RecordCount=0 then

begin

showmessage(' '+#13+' ');

dd.Query2.Filtered:=false;

end;

end;

if pole.ItemIndex=2 then

begin

dd.Query2.Filtered:=false;

dd.Query2.Filter:='TARprice'+ysl.Text+''''+text.Text+'''';

dd.Query2.Filtered:=true;

if dd.Query2.RecordCount=0 then

begin

showmessage(' '+#13+' ');

dd.Query2.Filtered:=false;

end;

end;

sp.Panels[0].Text:=' : '+floattostr(dd.Query2.RecordCount)+' .';

end;

end;

2.8.

. Rave RVProject, RTF RVDataSetConection. RVDataSetConection DataSet , . : Tools Rave Designer File NewDataObject DirectDataNiew Finish. Tools Report Wieardz Simple Table Next All Next Geniered. , , . RVProject Project File .

.

:

procedure Tdd.N32Click(Sender: TObject);

begin

dd.RvProject1.Execute;

end;

2.9.

.

:

procedure Tdd.N55Click(Sender: TObject);

begin

capt.ShowModal;

end;


:

procedure Tdd.N54Click(Sender: TObject);

begin

if dd.FontDialog1.Execute then

begin

main.DBGrid1.Font:=dd.FontDialog1.Font;

main.DBGrid2.Font:=dd.FontDialog1.Font;

main.DBGrid3.Font:=dd.FontDialog1.Font;

end;

end;

:

procedure Tdd.N57Click(Sender: TObject);

begin

size.showmodal;

end;

 

2.10.

MTTS .

:

procedure Tdd.N12Click(Sender: TObject);

begin

pereg.ShowModal;

end;


:


3. MTTS ۻ

MTTS . : , . (), , , , . .


4. MTTS ۻ

MTTS ۻ , , (, , ), . (, , , , , .)


5. MTTS ۻ

MTTS ۻ , , (, , ), . : , , , , .


delphi

, .

, Delphi , , . : DBGrid, ADOTable, Query, DBEdit, ComboBox .., .

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

, , , .


1.  .. , .. , .. RAVE Delphi, , , 2006.

2.  .. Delphi7. , , , 2005.

3.  .. Delphi7 . . 2007.

-

 

 

 

! , , , .
. , :