forked from DNNCommunity/DNN.Links
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LinksInfo.vb
299 lines (250 loc) · 8.94 KB
/
LinksInfo.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
'
' DotNetNuke® - http://www.dotnetnuke.com
' Copyright (c) 2002-2008
' by DotNetNuke Corporation
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
Imports System
Imports System.Configuration
Imports System.Data
Imports DotNetNuke.Entities.Modules
Namespace DotNetNuke.Modules.Links
''' -----------------------------------------------------------------------------
''' <summary>
''' The LinkInfo Class provides the Links Business Object
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [cnurse] 9/23/2004 Moved Links to a separate Project
''' </history>
''' -----------------------------------------------------------------------------
Public Class LinkInfo
Implements IHydratable
#Region "Private Members"
Private _ItemId As Integer
Private _ModuleId As Integer
Private _Title As String
Private _Url As String
Private _ViewOrder As Integer
Private _Description As String
Private _CreatedByUser As Integer
Private _CreatedDate As Date
Private _TrackClicks As Boolean
Private _NewWindow As Boolean
Private _RefreshInterval As Integer = 0
Private _GrantRoles As String
Private _ImageURL As String
#End Region
#Region "Constructors"
Public Sub New()
End Sub
#End Region
#Region "Properties"
Public Property ItemId() As Integer
Get
Return _ItemId
End Get
Set(ByVal Value As Integer)
_ItemId = Value
End Set
End Property
Public Property ModuleId() As Integer
Get
Return _ModuleId
End Get
Set(ByVal Value As Integer)
_ModuleId = Value
End Set
End Property
Public Property Title() As String
Get
Return _Title
End Get
Set(ByVal Value As String)
_Title = Value
End Set
End Property
Public Property Url() As String
Get
Return _Url
End Get
Set(ByVal Value As String)
_Url = Value
End Set
End Property
Public Property ViewOrder() As Integer
Get
Return _ViewOrder
End Get
Set(ByVal Value As Integer)
_ViewOrder = Value
End Set
End Property
Public Property Description() As String
Get
Return _Description
End Get
Set(ByVal Value As String)
_Description = Value
End Set
End Property
Public Property CreatedByUser() As Integer
Get
Return _CreatedByUser
End Get
Set(ByVal Value As Integer)
_CreatedByUser = Value
End Set
End Property
Public Property CreatedDate() As Date
Get
Return _CreatedDate
End Get
Set(ByVal Value As Date)
_CreatedDate = Value
End Set
End Property
Public Property TrackClicks() As Boolean
Get
Return _TrackClicks
End Get
Set(ByVal Value As Boolean)
_TrackClicks = Value
End Set
End Property
Public Property NewWindow() As Boolean
Get
Return _NewWindow
End Get
Set(ByVal Value As Boolean)
_NewWindow = Value
End Set
End Property
Public ReadOnly Property RefreshContent() As Boolean
Get
If RefreshInterval > 0 Then
Return True
End If
Return False
End Get
End Property
Public Property RefreshInterval() As Integer
Get
Return _RefreshInterval
End Get
Set(ByVal value As Integer)
_RefreshInterval = value
End Set
End Property
Public Property GrantRoles() As String
Get
Return _GrantRoles
End Get
Set(ByVal value As String)
_GrantRoles = value
End Set
End Property
Public Property ImageURL() As String
Get
Return _ImageURL
End Get
Set(ByVal value As String)
_ImageURL = value
End Set
End Property
#End Region
#Region "IHydratable Implementation"
''' -----------------------------------------------------------------------------
''' <summary>
''' Fill hydrates the object from a Datareader
''' </summary>
''' <remarks>The Fill method is used by the CBO method to hydrate the object
''' rather than using the more expensive Refection methods.</remarks>
''' <history>
''' [erikvb] 06/02/2008 Created
''' </history>
''' -----------------------------------------------------------------------------
Public Sub Fill(ByVal dr As System.Data.IDataReader) Implements Entities.Modules.IHydratable.Fill
ItemId = Convert.ToInt32(Null.SetNull(dr("ItemId"), ItemId))
ModuleId = Convert.ToInt32(Null.SetNull(dr("ModuleId"), ModuleId))
Title = Convert.ToString(Null.SetNull(dr("Title"), Title))
Url = Convert.ToString(Null.SetNull(dr("URL"), Url))
ViewOrder = Convert.ToInt32(Null.SetNull(dr("ViewOrder"), ViewOrder))
Description = Convert.ToString(Null.SetNull(dr("Description"), Description))
CreatedByUser = Convert.ToInt32(Null.SetNull(dr("CreatedByUser"), CreatedByUser))
RefreshInterval = Convert.ToInt32(Null.SetNull(dr("RefreshInterval"), RefreshInterval))
CreatedDate = Convert.ToDateTime(Null.SetNull(dr("CreatedDate"), CreatedDate))
TrackClicks = Convert.ToBoolean(Null.SetNull(dr("TrackClicks"), TrackClicks))
NewWindow = Convert.ToBoolean(Null.SetNull(dr("NewWindow"), NewWindow))
GrantRoles = Convert.ToString(Null.SetNull(dr("GrantRoles"), GrantRoles))
End Sub
''' -----------------------------------------------------------------------------
''' <summary>
''' Gets and sets the Key ID
''' </summary>
''' <remarks>The KeyID property is part of the IHydratble interface. It is used
''' as the key property when creating a Dictionary</remarks>
''' <history>
''' [erikvb] 06/02/2008 Created
''' </history>
''' -----------------------------------------------------------------------------
Public Property KeyID() As Integer Implements Entities.Modules.IHydratable.KeyID
Get
Return ItemId
End Get
Set(ByVal value As Integer)
ItemId = value
End Set
End Property
#End Region
End Class
Public Class TargetInfo
#Region " Constructors "
Public Sub New(ByVal Url As String)
Me._Url = Url
End Sub
#End Region
#Region " Private Members "
#End Region
#Region " Properties "
Private _Url As String
Public ReadOnly Property Url() As String
Get
Return _Url
End Get
End Property
Private _Description As String
Public Property Description() As String
Get
Return _Description
End Get
Set(ByVal value As String)
_Description = value
End Set
End Property
Private _Title As String
Public Property Title() As String
Get
Return _Title
End Get
Set(ByVal value As String)
_Title = value
End Set
End Property
#End Region
End Class
End Namespace