unit Uheader;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, StdCtrls,db ;

type
  TFheader = class(TForm)
    DBGrid1: TDBGrid;
    btdetail: TButton;
    btsupprimer: TButton;
    btok: TButton;
    Button1: TButton;
    procedure btdetailClick(Sender: TObject);
    procedure btsupprimerClick(Sender: TObject);
    procedure btokClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  Fheader: TFheader;

implementation

{$R *.dfm}
uses uprinc,udata, Udetailcommande;
procedure TFheader.btdetailClick(Sender: TObject);
begin
fdetailcommande.showmodal;
end;

procedure TFheader.btsupprimerClick(Sender: TObject);
begin
try
 Data.Theader.Delete;
except

showmessage('Suppression impossible');
end;
end;

procedure TFheader.btokClick(Sender: TObject);
begin
data.Theader.Filtered := false;
data.Theader.IndexName := 'ihea_pk';
If (Data.Theader.State = DsEdit) or (Data.Theader.State = DsInsert)
 then Data.Theader.Post;
close;
end;

procedure TFheader.Button1Click(Sender: TObject);
begin
fheader.ShowModal;
data.Theader.Filtered:=true;

end;

end.
