unit Uarticle;

interface

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

type
  TFarticle = class(TForm)
    DBGrid1: TDBGrid;
    Btnouveau: TButton;
    Btmodifier: TButton;
    btsupprimer: TButton;
    btok: TButton;
    procedure btokClick(Sender: TObject);
    procedure BtnouveauClick(Sender: TObject);
    procedure BtmodifierClick(Sender: TObject);
    procedure btsupprimerClick(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  Farticle: TFarticle;

implementation

{$R *.dfm}
uses uprinc,udata,ufichearticle;
procedure TFarticle.btokClick(Sender: TObject);
begin
If (Data.Tarticle.State = DsEdit) or (Data.Tarticle.State = DsInsert)
 then Data.Tarticle.Post;
close;
end;

procedure TFarticle.BtnouveauClick(Sender: TObject);
begin
data.Tarticle.Append;
Ffichearticle.ShowModal;


end;

procedure TFarticle.BtmodifierClick(Sender: TObject);
begin
Ffichearticle.ShowModal;
end;

procedure TFarticle.btsupprimerClick(Sender: TObject);

begin
try
 Data.Tarticle.Delete;
except

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

end.

