unit DobavSpr4;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls,UDM, DB, ADODB;

type
  TForm4 = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    ADOQuery1: TADOQuery;
    Edit2: TEdit;
    Label2: TLabel;
    ADOQuery2: TADOQuery;
    Button3: TButton;
    Edit1: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Label3: TLabel;
    Button2: TButton;
    Button4: TButton;
    ADOQuery3: TADOQuery;
    procedure Edit3MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Edit2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Edit1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

uses Spravochniki21, Menu1;

{$R *.dfm}

procedure TForm4.Button1Click(Sender: TObject);
begin
close();
end;

procedure TForm4.Button2Click(Sender: TObject);
begin
with ADOQuery1 do begin
ADOQuery1.Parameters.Items[0].Value:=trim(Edit1.Text);
ADOQuery1.ExecSQL;
form21.ADOQuery1.Close;
form21.ADOQuery1.Open;
Edit1.Text:='';
end;
end;

procedure TForm4.Button3Click(Sender: TObject);
begin
with ADOQuery2 do begin
Parameters.Items[0].Value:=trim(Edit2.Text);
execSQL;
form21.ADOQuery2.Close;
form21.ADOQuery2.Open;
Edit2.Text:='';
end;
end;

procedure TForm4.Button4Click(Sender: TObject);
begin
with ADOQuery3 do begin
ADOQuery3.Parameters.Items[0].Value:=trim(Edit3.Text);
ADOQuery3.ExecSQL;
form21.ADOQuery3.Close;
form21.ADOQuery3.Open;
Edit3.Text:='';
end;
end;

procedure TForm4.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:=' Для закрытия окна без сохранения изменений ';
end;

procedure TForm4.Edit1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Добавление в спрвочник "Цех"  ';
end;

procedure TForm4.Edit2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Добавление в спрвочник "Город"  ';
end;

procedure TForm4.Edit3MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Добавление в спрвочник "Кем выдан паспорт"  ';
end;

end.
