unit FormOsoby;

interface

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

type
  TFOsoby = class(TForm)
    DBGrid1: TDBGrid;
    Panel1: TPanel;
    Panel2: TPanel;
    SpeedButton1: TSpeedButton;
    ActionList1: TActionList;
    ActionClose: TAction;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormDestroy(Sender: TObject);
    procedure ActionCloseExecute(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  FOsoby: TFOsoby;

implementation
{$R *.DFM}

uses
   DataModule;

procedure TFOsoby.FormCreate(Sender: TObject);
begin
   DM.QueryOsoby.Open();
end;

procedure TFOsoby.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Action := caFree;
end;

procedure TFOsoby.FormDestroy(Sender: TObject);
begin
   DM.QueryOsoby.Close();
   FOsoby := NIL;   

end;

procedure TFOsoby.ActionCloseExecute(Sender: TObject);
begin
   Close();
end;

end.
