This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
/
AdventureWorksObjects.vb
324 lines (283 loc) · 7.25 KB
/
AdventureWorksObjects.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
Imports Microsoft.VisualBasic
Imports System
Imports DevExpress.Xpo
Namespace AdventureWorks
<Persistent("Sales.SalesOrderHeader")> _
Public Class OrderHeader
Inherits XPLiteObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
<Persistent("SalesOrderNumber"), Key> _
Private orderNumber_Renamed As String = Nothing
<PersistentAlias("orderNumber")> _
Public ReadOnly Property OrderNumber() As String
Get
Return orderNumber_Renamed
End Get
End Property
Private _subTotal As Decimal
Public Property SubTotal() As Decimal
Get
Return _subTotal
End Get
Set(ByVal value As Decimal)
SetPropertyValue("SubTotal", _subTotal, value)
End Set
End Property
Private _modifiedDate As DateTime
Public Property ModifiedDate() As DateTime
Get
Return _modifiedDate
End Get
Set(ByVal value As DateTime)
SetPropertyValue("ModifiedDate", _modifiedDate, value)
End Set
End Property
Private _territory As Territory
<Persistent("TerritoryID")> _
Public Property Territory() As Territory
Get
Return _territory
End Get
Set(ByVal value As Territory)
SetPropertyValue("Territory", _territory, value)
End Set
End Property
Private _customer As Customer
<Persistent("CustomerID")> _
Public Property Customer() As Customer
Get
Return _customer
End Get
Set(ByVal value As Customer)
SetPropertyValue("Customer", _customer, value)
End Set
End Property
Private _shipToAddress As Address
<Persistent("ShipToAddressID")> _
Public Property ShipToAddress() As Address
Get
Return _shipToAddress
End Get
Set(ByVal value As Address)
SetPropertyValue("ShipToAddress", _shipToAddress, value)
End Set
End Property
End Class
<Persistent("Sales.Customer")> _
Public Class Customer
Inherits XPLiteObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
<Persistent, Key(True)> _
Private CustomerID As Integer = 0
<PersistentAlias("CustomerID")> _
Public ReadOnly Property ID() As Integer
Get
Return CustomerID
End Get
End Property
Private _territory As Territory
<Persistent("TerritoryID"), Association("Territory-Customer")> _
Public Property Territory() As Territory
Get
Return _territory
End Get
Set(ByVal value As Territory)
SetPropertyValue("Territory", _territory, value)
End Set
End Property
Private _accountNumber As String
Public Property AccountNumber() As String
Get
Return _accountNumber
End Get
Set(ByVal value As String)
SetPropertyValue("AccountNumber", _accountNumber, value)
End Set
End Property
Private _customerType As String
Public Property CustomerType() As String
Get
Return _customerType
End Get
Set(ByVal value As String)
SetPropertyValue("CustomerType", _customerType, value)
End Set
End Property
End Class
<Persistent("Sales.SalesPerson")> _
Public Class SalesPerson
Inherits XPLiteObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
<Persistent, Key(True)> _
Private SalesPersonID As Integer = 0
<PersistentAlias("SalesPersonID")> _
Public ReadOnly Property ID() As Integer
Get
Return SalesPersonID
End Get
End Property
Private _territory As Territory
<Persistent("TerritoryID")> _
Public Property Territory() As Territory
Get
Return _territory
End Get
Set(ByVal value As Territory)
SetPropertyValue("Territory", _territory, value)
End Set
End Property
End Class
<Persistent("Sales.SalesTerritory")> _
Public Class Territory
Inherits XPLiteObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
<Persistent, Key(True)> _
Private TerritoryID As Integer = 0
<PersistentAlias("TerritoryID")> _
Public ReadOnly Property ID() As Integer
Get
Return TerritoryID
End Get
End Property
Private _mame As String
Public Property Name() As String
Get
Return _mame
End Get
Set(ByVal value As String)
SetPropertyValue("Name", _mame, value)
End Set
End Property
Private _group As String
Public Property Group() As String
Get
Return _group
End Get
Set(ByVal value As String)
SetPropertyValue("Group", _group, value)
End Set
End Property
Private _countryRegionCode As String
Public Property CountryRegionCode() As String
Get
Return _countryRegionCode
End Get
Set(ByVal value As String)
SetPropertyValue("CountryRegionCode", _countryRegionCode, value)
End Set
End Property
<Association("Territory-Customer")> _
Public ReadOnly Property Customers() As XPCollection(Of Customer)
Get
Return GetCollection(Of Customer)("Customers")
End Get
End Property
<Association("Territory-States")> _
Public ReadOnly Property States() As XPCollection(Of StateProvince)
Get
Return GetCollection(Of StateProvince)("States")
End Get
End Property
End Class
<Persistent("Person.StateProvince")> _
Public Class StateProvince
Inherits XPLiteObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
<Persistent, Key(True)> _
Private StateProvinceID As Integer = 0
<PersistentAlias("StateProvinceID")> _
Public ReadOnly Property ID() As Integer
Get
Return StateProvinceID
End Get
End Property
Private _name As String
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal value As String)
SetPropertyValue("Name", _name, value)
End Set
End Property
Private _stateCode As String
<Persistent("StateProvinceCode")> _
Public Property StateCode() As String
Get
Return _stateCode
End Get
Set(ByVal value As String)
SetPropertyValue("StateCode", _stateCode, value)
End Set
End Property
Private _territory As Territory
<Persistent("TerritoryID"), Association("Territory-States")> _
Public Property Territory() As Territory
Get
Return _territory
End Get
Set(ByVal value As Territory)
SetPropertyValue("Territory", _territory, value)
End Set
End Property
<Association("State-Addresses")> _
Public ReadOnly Property Addresses() As XPCollection(Of Address)
Get
Return GetCollection(Of Address)("Addresses")
End Get
End Property
End Class
<Persistent("Person.Address")> _
Public Class Address
Inherits XPLiteObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
<Persistent, Key(True)> _
Private AddressID As Integer = 0
<PersistentAlias("AddressID")> _
Public ReadOnly Property ID() As Integer
Get
Return AddressID
End Get
End Property
Private _state As StateProvince
<Persistent("StateProvinceID"), Association("State-Addresses")> _
Public Property State() As StateProvince
Get
Return _state
End Get
Set(ByVal value As StateProvince)
SetPropertyValue("State", _state, value)
End Set
End Property
Private _city As String
Public Property City() As String
Get
Return _city
End Get
Set(ByVal value As String)
SetPropertyValue("City", _city, value)
End Set
End Property
Private _addressLine1 As String
Public Property AddressLine1() As String
Get
Return _addressLine1
End Get
Set(ByVal value As String)
SetPropertyValue("AddressLine1", _addressLine1, value)
End Set
End Property
End Class
End Namespace