unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ADODB, DB, Grids, DBGrids, StdCtrls, Mask, DBCtrls, Menus, ToolWin,
  ComCtrls;

type
  TForm2 = class(TForm)
    MainMenu1: TMainMenu;
    N6: TMenuItem;
    ADOConnection1: TADOConnection;
    ADOQuery1: TADOQuery;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    N11: TMenuItem;
    N2: TMenuItem;
    Dabav: TMenuItem;
    Spravochnic: TMenuItem;
    N4: TMenuItem;
    vuhod: TMenuItem;
    Label4: TLabel;
    Label5: TLabel;
    Edit4: TEdit;
    Edit5: TEdit;
    Label6: TLabel;
    Label7: TLabel;
    Edit6: TEdit;
    Button1: TButton;
    DBEdit1: TDBEdit;
    procedure DBEdit1Change(Sender: TObject);
    procedure SpravochnicClick(Sender: TObject);
    procedure YdalClick(Sender: TObject);
    procedure IzmenClick(Sender: TObject);
    procedure DabavClick(Sender: TObject);
    procedure vuhodClick(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure N8Click(Sender: TObject);
    procedure N9Click(Sender: TObject);
    procedure N10Click(Sender: TObject);
    procedure N11Click(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);


  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Unit1, Unit3, Unit4, Unit7;

{$R *.dfm}


procedure TForm2.Button1Click(Sender: TObject);
var S: integer;
begin
AdoQuery1.sql.clear;
AdoQuery1.sql.add('SELECT *');
AdoQuery1.sql.add('FROM Vse');
AdoQuery1.sql.add('WHERE FindField Like'+#39+DBEdit1.Text+'%'+#39);

AdoQuery1.open;
//ShowMessage('Запись не найдена');
end;

procedure TForm2.DabavClick(Sender: TObject);
begin
Form4.Show;
AdoQuery1.Insert;
end;

procedure TForm2.DBEdit1Change(Sender: TObject); var help1, help2:string;
begin
end;

procedure TForm2.IzmenClick(Sender: TObject);
begin
Form4.ShowModal;
end;

procedure TForm2.N10Click(Sender: TObject);
begin
ADOQuery1.Sort := '[Пол]';
end;

procedure TForm2.N11Click(Sender: TObject);
begin
ADOQuery1.Sort := '[Дата рождения]';
end;

procedure TForm2.N3Click(Sender: TObject);
begin
 Form7.show;
end;

procedure TForm2.N7Click(Sender: TObject);
begin
ADOQuery1.Sort := '[Специализация бригады]';
end;

procedure TForm2.N8Click(Sender: TObject);
begin
ADOQuery1.Sort := '[Адрес]';
end;

procedure TForm2.N9Click(Sender: TObject);
begin
ADOQuery1.Sort := '[ФИО пациента]';
end;

procedure TForm2.vuhodClick(Sender: TObject);
begin
Form2.Close;
end;

procedure TForm2.YdalClick(Sender: TObject);
begin
 AdoQuery1.Delete
end;

procedure TForm2.SpravochnicClick(Sender: TObject);
begin
Form3.showModal;
end;


end.
