unit Ucp;

interface

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

type
  TFcp = class(TForm)
    DBGrid1: TDBGrid;
    btok: TButton;
    btannuler: TButton;
    btsupprimer: TButton;
    procedure btokClick(Sender: TObject);
    procedure btannulerClick(Sender: TObject);
    procedure btsupprimerClick(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  Fcp: TFcp;

implementation

{$R *.dfm}
uses udata;
procedure TFcp.btokClick(Sender: TObject);
begin
if (data.Tcpville.State=dsinsert) or (data.Tcpville.State=dsedit)
then data.Tcpville.Post;
close;
end;

procedure TFcp.btannulerClick(Sender: TObject);
begin
data.Tcpville.Cancel;
end;

procedure TFcp.btsupprimerClick(Sender: TObject);

begin
try
data.Tcpville.Delete;
except

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

end.
