Программный продукт «Базы отдыха Беларуси». Назначение и область применения. Технические характеристики. Описание, страница 4

procedure N4Click(Sender: TObject);

procedure N3Click(Sender: TObject);

procedure btndobavitClick(Sender: TObject);

procedure btnizmenitClick(Sender: TObject);

procedure btnydaliClick(Sender: TObject);

procedure btn1Click(Sender: TObject);

procedure lbl2Click(Sender: TObject);

procedure btnnaidiClick(Sender: TObject);

procedure edt2Change(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form2: TForm2;

implementation

uses

Unit3;

{$R *.dfm}

procedure TForm2.N4Click(Sender: TObject);

begin

feditor.Show;

end;

16

ВГПК.400101.К11.024-ПЗ

procedure TForm2.N3Click(Sender: TObject);

begin

Form2.bookname.Append;

feditor.Show;

end;

procedure TForm2.btndobavitClick(Sender: TObject);

begin

Form2.bookname.Append;

feditor.Show;

end;

procedure TForm2.btnizmenitClick(Sender: TObject);

begin

feditor.Show;

end;

procedure TForm2.btnydaliClick(Sender: TObject);

begin

Form4.Show;

end;

procedure TForm2.btn1Click(Sender: TObject);

begin

Form4.Show;

end;

procedure TForm2.lbl2Click(Sender: TObject);

begin

Form5.Show;

end;

procedure TForm2.btnnaidiClick(Sender: TObject);

begin

if not bookname.Locate('Город',edt1.Text,[loCaseInsensitive,loPartialKey])then

ShowMessage('Запись не найдена');

end;

procedure TForm2.edt2Change(Sender: TObject);

17

ВГПК.400101.К11.024-ПЗ

begin

if edt2.Text<>''then

begin

bookname.Filtered:=False;

bookname.Filter:='[Город]'+ #39 + '%'+ edt2.Text + '%'+ #39;

bookname.Filtered:=true;

end

else

bookname.Filtered:=False;

end;

end.

3.  Form  3

unit Unit3;

interface

uses

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

Dialogs, StdCtrls, DBCtrls, Mask;

type

Tfeditor = class(TForm)

grp1: TGroupBox;

lbl1: TLabel;

lbl2: TLabel;

lbl3: TLabel;

lbl4: TLabel;

lbl5: TLabel;

lbl6: TLabel;

lbl7: TLabel;

dbedt1: TDBEdit;

dbedt2: TDBEdit;

dbedt3: TDBEdit;

dbedt4: TDBEdit;

dbedt5: TDBEdit;

dbmmo1: TDBMemo;

dbimg1: TDBImage;

btnotmena: TButton;

btnsohr: TButton;

18

ВГПК.400101.К11.024-ПЗ

procedure btnotmenaClick(Sender: TObject);

procedure btnsohrClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

feditor: Tfeditor;

implementation

uses

Unit2;

{$R *.dfm}

procedure Tfeditor.btnotmenaClick(Sender: TObject);

begin

feditor.Close;

end;

procedure Tfeditor.btnsohrClick(Sender: TObject);

begin

if Form2.bookname.Modified then

Form2.bookname.Post;

feditor.Close;

end;

end.

4. Form 4

unit Unit4;

interface

uses

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

Dialogs, StdCtrls;

19

ВГПК.400101.К11.024-ПЗ

type

TForm4 = class(TForm)

lbl1: TLabel;

btn1: TButton;

btn2: TButton;

procedure btn2Click(Sender: TObject);

procedure btn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form4: TForm4;

implementation

uses

Unit2;

{$R *.dfm}

procedure TForm4.btn2Click(Sender: TObject);

begin

Form4.Close;

end;

procedure TForm4.btn1Click(Sender: TObject);

begin

Form2.bookname.Delete;

Form4.Close;

end;

end.

5.Form 5

unit Unit5;

interface

uses

20

ВГПК.400101.К11.024-ПЗ

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

Dialogs, StdCtrls, DBCtrls, Mask, ExtCtrls;

type

TForm5 = class(TForm)

lbl1: TLabel;

lbl2: TLabel;

lbl3: TLabel;

dbedt1: TDBEdit;

dbmmo1: TDBMemo;

btn1: TButton;

dbimg1: TDBImage;

procedure btn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form5: TForm5;

implementation

uses

Unit2;

{$R *.dfm}

procedure TForm5.btn1Click(Sender: TObject);

begin

Form5.Close;

end;

end.