unit Spravochniki21;

interface

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

type
  TForm21 = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    ADOQuery1: TADOQuery;
    DataSource2: TDataSource;
    DBGrid2: TDBGrid;
    DBGrid3: TDBGrid;
    DataSource3: TDataSource;
    ADOQuery2: TADOQuery;
    ADOQuery3: TADOQuery;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure DBGrid2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure DBGrid3MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    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 Button4MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Button3MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Button2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Edit3KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure Edit2KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure FormActivate(Sender: TObject);
    procedure Button1Click(Sender: TObject);

//    procedure sqlfilter();
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form21: TForm21;

implementation

uses DobavSpr4, UdalSpr, RedakSpr16, Menu1;

//uses;

{$R *.dfm}


procedure TForm21.Button1Click(Sender: TObject);
begin
Close();
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
end;

procedure TForm21.FormActivate(Sender: TObject);
begin
ADOQuery1.Open;
ADOQuery2.Open;
ADOQuery3.Open;
end;

procedure TForm21.Edit1KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
ADOQuery1.SQL.Text:='select * from razd where 1=1 and upper(name) Like '+''''+AnsiUpperCase(trim(Edit1.Text))+'%''';
   ADOQuery1.Open;
end;

procedure TForm21.Edit2KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
ADOQuery3.SQL.Text:='select * from kem_vidan where 1=1 and upper(vidan) Like '+''''+AnsiUpperCase(trim(Edit2.Text))+'%''';
  ADOQuery3.Open;
end;

procedure TForm21.Edit3KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
ADOQuery2.SQL.Text:='select * from goroda4 where 1=1 and upper(gorod) Like '+''''+AnsiUpperCase(trim(Edit3.Text))+'%''';
  ADOQuery2.Open;
end;

procedure TForm21.Button2Click(Sender: TObject);
begin
DobavSpr4.form4.showModal;
end;

procedure TForm21.Button4Click(Sender: TObject);
begin
UdalSpr.form17.showModal;
end;

procedure TForm21.Button3Click(Sender: TObject);
begin
RedakSpr16.form16.showModal;
end;

procedure TForm21.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Справочная система ';
end;

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

procedure TForm21.Button3MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Редактирование спрвочников';
end;

procedure TForm21.Button4MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Удавление из справочников ';
end;

procedure TForm21.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Закрыть справочную систему ';
end;

procedure TForm21.Edit1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Побуквенный поиск ';
end;

procedure TForm21.Edit2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Побуквенный поиск ';
end;

procedure TForm21.Edit3MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Побуквенный поиск ';
end;

procedure TForm21.DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Справочник отделов ';
end;

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

procedure TForm21.DBGrid2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
form1.StatusBar1.Panels[0].Text:='Справочник городов ';
end;

end.
