source: trunk/Packages/ChronisPlatform/Forms/UFormConnection.pas

Last change on this file was 5, checked in by chronos, 12 years ago
  • Added: Required packages.
File size: 1.2 KB
Line 
1unit UFormConnection;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
9 maskedit, USqlDatabase;
10
11type
12
13 { TFormConnection }
14
15 TFormConnection = class(TForm)
16 ButtonConnect: TButton;
17 ButtonCancel: TButton;
18 EditHostName: TEdit;
19 EditUserName: TEdit;
20 EditSchema: TEdit;
21 EditPassword: TEdit;
22 Label1: TLabel;
23 Label2: TLabel;
24 Label3: TLabel;
25 Label4: TLabel;
26 private
27 { private declarations }
28 public
29 procedure LoadFromDatabase(Database: TSqlDatabase);
30 procedure SaveToDatabase(Database: TSqlDatabase);
31 end;
32
33var
34 FormConnection: TFormConnection;
35
36implementation
37
38{$R *.lfm}
39
40{ TFormConnection }
41
42procedure TFormConnection.LoadFromDatabase(Database: TSqlDatabase);
43begin
44 EditHostName.Text := Database.HostName;
45 EditUserName.Text := Database.UserName;
46 EditPassword.Text := '';
47 EditSchema.Text := Database.Database;
48end;
49
50procedure TFormConnection.SaveToDatabase(Database: TSqlDatabase);
51begin
52 Database.HostName := EditHostName.Text;
53 Database.UserName := EditUserName.Text;
54 Database.Password := EditPassword.Text;
55 Database.Database := EditSchema.Text;
56end;
57
58end.
59
Note: See TracBrowser for help on using the repository browser.