-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLMS.Helper.FormFactory.pas
69 lines (58 loc) · 1.25 KB
/
LMS.Helper.FormFactory.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
unit LMS.Helper.FormFactory;
interface
uses
LMS._interface.LMS;
procedure ViewForm(const aCourse: ICourse); overload;
procedure ViewForm(const aCourse: ICourse; const aUser: IUser); overload;
procedure ViewForm(const aCategory: ICategory); overload;
procedure ViewForm(const aLMS: ILMS); overload;
procedure ViewForm(const aUser: IUser); overload;
implementation
uses
LMS.Form.Main,
LMS.Form.Course,
LMS.Form.Category,
LMS.Form.User,
LMS.Form.LMS;
procedure ViewForm(const aCourse: ICourse; const aUser: IUser);
begin
with TLMSCourseForm.Create(MainForm) do
begin
Course := aCourse;
show();
FilterUser := aUser; // Lets force select this user
end;
end;
procedure ViewForm(const aCourse: ICourse);
begin
with TLMSCourseForm.Create(MainForm) do
begin
Course := aCourse;
show();
end;
end;
procedure ViewForm(const aCategory: ICategory);
begin
with TLMSCategoryForm.Create(MainForm) do
begin
Category := aCategory;
show();
end;
end;
procedure ViewForm(const aLMS: ILMS);
begin
with TLMSForm.Create(MainForm) do
begin
LMS := aLMS;
show();
end;
end;
procedure ViewForm(const aUser: IUser); overload;
begin
with TLMSUserForm.Create(MainForm) do
begin
User := aUser;
show();
end;
end;
end.