/
Employee.vb
66 lines (58 loc) · 1.89 KB
/
Employee.vb
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
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl.PermissionPolicy
Imports DevExpress.Persistent.Validation
Imports DevExpress.Xpo
Imports System
Imports System.ComponentModel
Namespace MainDemo.[Module].BusinessObjects
<DefaultClassOptions>
<DefaultProperty("FullName")>
<ImageName("BO_User")>
Public Class Employee
Inherits PermissionPolicyUser
Private _LastName As String
Private _FirstName As String
Private _department As Department
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Property FirstName As String
Get
Return _FirstName
End Get
Set(ByVal value As String)
SetPropertyValue("FirstName", _FirstName, value)
End Set
End Property
Public Property LastName As String
Get
Return _LastName
End Get
Set(ByVal value As String)
SetPropertyValue("LastName", _LastName, value)
End Set
End Property
<PersistentAlias("concat(FirstName, ' ', LastName)")>
Public ReadOnly Property FullName As String
Get
Return Convert.ToString(EvaluateAlias("FullName"))
End Get
End Property
<Association>
<RuleRequiredField>
Public Property Department As Department
Get
Return _department
End Get
Set(ByVal value As Department)
SetPropertyValue("Department", _department, value)
End Set
End Property
<Association>
Public ReadOnly Property Tasks As XPCollection(Of EmployeeTask)
Get
Return GetCollection(Of EmployeeTask)("Tasks")
End Get
End Property
End Class
End Namespace