unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, BoldAbstractModel, BoldModel, BoldHandles, BoldSystemHandle,
  BoldAbstractDatabaseAdapter, 
  BoldSubscription, BoldHandle, BoldPersistenceHandle,
  BoldAbstractPersistenceHandleDB, BoldPersistenceHandleDB, StdCtrls,
  Grids, BoldGrid, BoldRootedHandles, BoldAbstractListHandle,
  BoldCursorHandle, BoldListHandle, ExtCtrls, BoldNavigatorDefs,
  BoldNavigator, BoldAFPDefault;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    BoldGrid1: TBoldGrid;
    blhAuthors: TBoldListHandle;
    Button4: TButton;
    BoldNavigator1: TBoldNavigator;
    BoldGrid2: TBoldGrid;
    BoldNavigator2: TBoldNavigator;
    blhBooks: TBoldListHandle;
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    BoldGrid3: TBoldGrid;
    BoldNavigator3: TBoldNavigator;
    BoldGrid4: TBoldGrid;
    BoldNavigator4: TBoldNavigator;
    Label9: TLabel;
    Label10: TLabel;
    blhBooksOfAuthor: TBoldListHandle;
    AuthorsOfBook: TBoldListHandle;
    Bevel1: TBevel;
    Bevel2: TBevel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Dat;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
   DM.ACRDataBase1.CreateDatabase;
   ShowMessage('DB Ok');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  DM.BoldPersistenceHandleDB1.CreateDataBaseSchema();
  ShowMessage('DB schema OK');
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  DM.BoldSystemHandle1.Active := True;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  DM.BoldSystemHandle1.UpdateDatabase;
  ShowMessage('DB was updated succesfully');
end;

end.
