unit TownBookUnit;

interface

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

type
  TTownBookForm = class(TForm)
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    BitBtn1: TBitBtn;
    AddBtn: TBitBtn;
    SaveBtn: TBitBtn;
    DelBtn: TBitBtn;
    procedure AddBtnClick(Sender: TObject);
    procedure SaveBtnClick(Sender: TObject);
    procedure DelBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  TownBookForm: TTownBookForm;

implementation

uses DataModuleUnit;

{$R *.dfm}

procedure TTownBookForm.AddBtnClick(Sender: TObject);
begin
 DataModule1.TownTable.Insert;
 DBGrid1.SetFocus;
end;

procedure TTownBookForm.SaveBtnClick(Sender: TObject);
begin
 if DataModule1.TownTable.Modified then
  DataModule1.TownTable.Post;
end;

procedure TTownBookForm.DelBtnClick(Sender: TObject);
begin
 DataModule1.TownTable.Delete;
end;

end.
