unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, StdCtrls, Buttons, DBCtrls, ExtCtrls, jpeg;

type
  TForm5 = class(TForm)
    GroupBox1: TGroupBox;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    DBGrid1: TDBGrid;
    DBText1: TDBText;
    Label1: TLabel;
    DBGrid2: TDBGrid;
    BitBtn3: TBitBtn;
    DBNavigator1: TDBNavigator;
    DBNavigator2: TDBNavigator;
    BitBtn4: TBitBtn;
    Image1: TImage;
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;

implementation

uses Unit3;

{$R *.dfm}

procedure TForm5.BitBtn3Click(Sender: TObject);
begin
if form5.DBtext1.caption='' then
form5.DBNavigator1.BtnClick(nbdelete) else
begin
repeat
form5.DBNavigator2.BtnClick(nbdelete);
until form5.DBtext1.caption='';
form5.DBNavigator1.BtnClick(nbdelete);
end;
end;

procedure TForm5.BitBtn1Click(Sender: TObject);
begin
form5.Height:=720;
form5.DBGrid1.Visible:=true;
form5.DBGrid2.Visible:=true;
form5.DBNavigator1.Visible:=true;
form5.DBNavigator2.Visible:=true;
form5.DBText1.Visible:=true;
form5.Label1.Visible:=true;
form5.BitBtn3.Visible:=true;
form5.GroupBox1.Visible:=false;
end;

procedure TForm5.BitBtn4Click(Sender: TObject);
begin
if form5.DBtext1.caption='' then
showmessage('Нет данных для удаления!') else
form5.DBNavigator2.BtnClick(nbdelete);
end;

procedure TForm5.BitBtn2Click(Sender: TObject);
begin
form5.Height:=720;
form5.DBGrid1.Visible:=true;
form5.DBGrid2.Visible:=true;
form5.DBNavigator1.Visible:=true;
form5.DBNavigator2.Visible:=true;
form5.DBText1.Visible:=true;
form5.Label1.Visible:=true;
form5.GroupBox1.Visible:=false;
form5.BitBtn4.Visible:=true;
end;

end.
