-
Notifications
You must be signed in to change notification settings - Fork 1
/
uMembers.pas
83 lines (68 loc) · 1.48 KB
/
uMembers.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
unit uMembers;
interface
type
TMembers = class
private
FMemberId: Integer;
FFirstName: string;
FMiddleName: string;
FLastName: string;
FAge: Integer;
function GetAge: Integer;
function GetFirstName: string;
function GetLastName: string;
function GetMiddleName: string;
function GetMemberId: Integer;
public
property MemberId: Integer read GetMemberId write FMemberId;
property FirstName: string read GetFirstName write FFirstName;
property MiddleName: string read GetMiddleName write FMiddleName;
property LastName: string read GetLastName write FLastName;
property Age: Integer read GetAge write FAge;
function GetMember(Id: Integer): TMembers;
end;
implementation
{ TMembers }
// *** Properties ***
function TMembers.GetMemberId: Integer;
begin
Result := FMemberId;
end;
function TMembers.GetAge: Integer;
begin
Result := FAge;
end;
function TMembers.GetFirstName: string;
begin
Result := FFirstName;
end;
function TMembers.GetLastName: string;
begin
Result := FLastName;
end;
function TMembers.GetMiddleName: string;
begin
Result := FMiddleName;
end;
// *** End Properties ***
function TMembers.GetMember(Id: Integer): TMembers;
begin
if Id = 0 then
begin
FirstName := 'Jon';
LastName := 'Don';
Age := 35;
end else
if Id = 1 then
begin
FirstName := 'Bob';
LastName := 'Eaton';
Age := 44;
end else
begin
FirstName := '';
LastName := '';
Age := 0;
end;
end;
end.