ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/services/Unit2.pas
Revision: 45
Committed: Tue Dec 6 10:33:46 2016 UTC (7 years, 4 months ago) by tony
Content type: text/x-pascal
File size: 1867 byte(s)
Log Message:
Committing updates for Release R2-0-0

File Contents

# Content
1 unit Unit2;
2
3 {$mode objfpc}{$H+}
4
5 interface
6
7 uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
9 Buttons, ExtCtrls, IBServices;
10
11 type
12
13 { TForm2 }
14
15 TForm2 = class(TForm)
16 Bevel1: TBevel;
17 Button1: TButton;
18 Button2: TButton;
19 Edit1: TEdit;
20 Edit2: TEdit;
21 Edit3: TEdit;
22 IBBackupService1: TIBBackupService;
23 Label1: TLabel;
24 Label2: TLabel;
25 Label3: TLabel;
26 RadioButton1: TRadioButton;
27 RadioButton2: TRadioButton;
28 SaveDialog1: TSaveDialog;
29 SpeedButton1: TSpeedButton;
30 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
31 procedure FormShow(Sender: TObject);
32 procedure SpeedButton1Click(Sender: TObject);
33 private
34 { private declarations }
35 public
36 { public declarations }
37 end;
38
39 var
40 Form2: TForm2;
41
42 implementation
43
44 {$R *.lfm}
45
46 { TForm2 }
47
48 procedure TForm2.SpeedButton1Click(Sender: TObject);
49 begin
50 if SaveDialog1.Execute then
51 Edit3.Text := SaveDialog1.Filename;
52 end;
53
54 procedure TForm2.FormShow(Sender: TObject);
55 begin
56 Edit1.Text := IBBackupService1.ServerName;
57 if IBBackupService1.BackupFileLocation = flServerSide then
58 RadioButton1.Checked := true
59 else
60 RadioButton2.Checked := true;
61 Edit2.Text := IBBackupService1.DatabaseName;
62 IBBackupService1.BackupFile.Clear;
63 end;
64
65 procedure TForm2.FormClose(Sender: TObject; var CloseAction: TCloseAction);
66 begin
67 if ModalResult <> mrOK then Exit;
68 if Edit2.Text = '' then
69 raise Exception.Create('A Database Name must be given');
70 if Edit3.Text = '' then
71 raise Exception.Create('A Backup File Name must be given');
72 IBBackupService1.DatabaseName := Edit2.Text;
73 IBBackupService1.BackupFile.Add(Edit3.Text);
74 if RadioButton1.Checked then
75 IBBackupService1.BackupFileLocation := flServerSide
76 else
77 IBBackupService1.BackupFileLocation := flClientSide;
78 end;
79
80 end.
81