当前文件路径:DNN/Library/Controls/Address.vb 
1
'
2
' DotNetNuke?- http://www.dotnetnuke.com
3
' Copyright (c) 2002-2008
4
' by DotNetNuke Corporation
5
'
6
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
8
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
9
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
'
11
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
12
' of the Software.
13
'
14
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
15
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
17
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
' DEALINGS IN THE SOFTWARE.
19
'
20
21
Imports DotNetNuke.Entities.Modules
22
Imports DotNetNuke.Common.Lists
23
24
Namespace DotNetNukeNamespace DotNetNuke.UI.UserControls
25
26
/**/''' -----------------------------------------------------------------------------
27
''' <summary>
28
''' The Address UserControl is used to manage User Addresses
29
''' </summary>
30
''' <remarks>
31
''' </remarks>
32
''' <history>
33
''' [cnurse] 10/08/2004 Updated to reflect design changes for Help, 508 support
34
''' and localisation
35
''' </history>
36
''' -----------------------------------------------------------------------------
37
Public MustInherit Class AddressClass Address
38
Inherits Framework.UserControlBase
39
40
Controls#Region "Controls"
41
42
Protected rowStreet As System.Web.UI.HtmlControls.HtmlTableRow
43
Protected plStreet As UI.UserControls.LabelControl
44
Protected txtStreet As System.Web.UI.WebControls.TextBox
45
Protected WithEvents chkStreet As System.Web.UI.WebControls.CheckBox
46
Protected lblStreetRequired As System.Web.UI.WebControls.Label
47
Protected valStreet As System.Web.UI.WebControls.RequiredFieldValidator
48
49
Protected rowUnit As System.Web.UI.HtmlControls.HtmlTableRow
50
Protected plUnit As UI.UserControls.LabelControl
51
Protected txtUnit As System.Web.UI.WebControls.TextBox
52
53
Protected rowCity As System.Web.UI.HtmlControls.HtmlTableRow
54
Protected plCity As UI.UserControls.LabelControl
55
Protected txtCity As System.Web.UI.WebControls.TextBox
56
Protected WithEvents chkCity As System.Web.UI.WebControls.CheckBox
57
Protected lblCityRequired As System.Web.UI.WebControls.Label
58
Protected valCity As System.Web.UI.WebControls.RequiredFieldValidator
59
60
Protected rowCountry As System.Web.UI.HtmlControls.HtmlTableRow
61
Protected plCountry As UI.UserControls.LabelControl
62
Protected WithEvents cboCountry As DotNetNuke.UI.WebControls.CountryListBox
63
Protected WithEvents chkCountry As System.Web.UI.WebControls.CheckBox
64
Protected lblCountryRequired As System.Web.UI.WebControls.Label
65
Protected valCountry As System.Web.UI.WebControls.RequiredFieldValidator
66
67
Protected rowRegion As System.Web.UI.HtmlControls.HtmlTableRow
68
Protected plRegion As UI.UserControls.LabelControl
69
Protected lblRegion As System.Web.UI.WebControls.Label
70
Protected WithEvents cboRegion As System.Web.UI.WebControls.DropDownList
71
Protected txtRegion As System.Web.UI.WebControls.TextBox
72
Protected WithEvents chkRegion As System.Web.UI.WebControls.CheckBox
73
Protected lblRegionRequired As System.Web.UI.WebControls.Label
74
Protected valRegion1 As System.Web.UI.WebControls.RequiredFieldValidator
75
Protected valRegion2 As System.Web.UI.WebControls.RequiredFieldValidator
76
77
Protected rowPostal As System.Web.UI.HtmlControls.HtmlTableRow
78
Protected plPostal As UI.UserControls.LabelControl
79
Protected txtPostal As System.Web.UI.WebControls.TextBox
80
Protected WithEvents chkPostal As System.Web.UI.WebControls.CheckBox
81
Protected lblPostalRequired As System.Web.UI.WebControls.Label
82
Protected valPostal As System.Web.UI.WebControls.RequiredFieldValidator
83
84
Protected rowTelephone As System.Web.UI.HtmlControls.HtmlTableRow
85
Protected plTelephone As UI.UserControls.LabelControl
86
Protected txtTelephone As System.Web.UI.WebControls.TextBox
87
Protected WithEvents chkTelephone As System.Web.UI.WebControls.CheckBox
88
Protected lblTelephoneRequired As System.Web.UI.WebControls.Label
89
Protected valTelephone As System.Web.UI.WebControls.RequiredFieldValidator
90
91
Protected rowCell As System.Web.UI.HtmlControls.HtmlTableRow
92
Protected plCell As UI.UserControls.LabelControl
93
Protected txtCell As System.Web.UI.WebControls.TextBox
94
Protected WithEvents chkCell As System.Web.UI.WebControls.CheckBox
95
Protected lblCellRequired As System.Web.UI.WebControls.Label
96
Protected valCell As System.Web.UI.WebControls.RequiredFieldValidator
97
98
Protected rowFax As System.Web.UI.HtmlControls.HtmlTableRow
99
Protected plFax As UI.UserControls.LabelControl
100
Protected txtFax As System.Web.UI.WebControls.TextBox
101
Protected WithEvents chkFax As System.Web.UI.WebControls.CheckBox
102
Protected lblFaxRequired As System.Web.UI.WebControls.Label
103
Protected valFax As System.Web.UI.WebControls.RequiredFieldValidator
104
#End Region
105
106
Private Members#Region "Private Members"
107
108
Private _ModuleId As Integer
109
Private _LabelColumnWidth As String = ""
110
Private _ControlColumnWidth As String = ""
111
Private _StartTabIndex As Integer = 1
112
113
Private _Street As String
114
Private _Unit As String
115
Private _City As String
116
Private _Country As String
117
Private _Region As String
118
Private _Postal As String
119
Private _Telephone As String
120
Private _Cell As String
121
Private _Fax As String
122
123
Private _ShowStreet As Boolean = True
124
Private _ShowUnit As Boolean = True
125
Private _ShowCity As Boolean = True
126
Private _ShowCountry As Boolean = True
127
Private _ShowRegion As Boolean = True
128
Private _ShowPostal As Boolean = True
129
Private _ShowTelephone As Boolean = True
130
Private _ShowCell As Boolean = True
131
Private _ShowFax As Boolean = True
132
133
Private _CountryData As String = "Text"
134
Private _RegionData As String = "Text"
135
136
Private MyFileName As String = "Address.ascx"
137
138
#End Region
139
140
Properties#Region "Properties"
141
142
Public Property ModuleId()Property ModuleId() As Integer
143
Get
144
ModuleId = Convert.ToInt32(ViewState("ModuleId"))
145
End Get
146
Set(ByVal Value As Integer)
147
_ModuleId = Value
148
End Set
149
End Property
150
Public Property LabelColumnWidth()Property LabelColumnWidth() As String
151
Get
152
LabelColumnWidth = Convert.ToString(ViewState("LabelColumnWidth"))
153
End Get
154
Set(ByVal Value As String)
155
_LabelColumnWidth = Value
156
End Set
157
End Property
158
Public Property ControlColumnWidth()Property ControlColumnWidth() As String
159
Get
160
ControlColumnWidth = Convert.ToString(ViewState("ControlColumnWidth"))
161
End Get
162
Set(ByVal Value As String)
163
_ControlColumnWidth = Value
164
End Set
165
End Property
166
Public WriteOnly Property StartTabIndex()Property StartTabIndex() As Integer
167
Set(ByVal Value As Integer)
168
_StartTabIndex = Value
169
End Set
170
End Property
171
172
173
Public Property Street()Property Street() As String
174
Get
175
Street = txtStreet.Text
176
End Get
177
Set(ByVal Value As String)
178
_Street = Value
179
End Set
180
End Property
181
Public Property Unit()Property Unit() As String
182
Get
183
Unit = txtUnit.Text
184
End Get
185
Set(ByVal Value As String)
186
_Unit = Value
187
End Set
188
End Property
189
Public Property City()Property City() As String
190
Get
191
City = txtCity.Text
192
End Get
193
Set(ByVal Value As String)
194
_City = Value
195
End Set
196
End Property
197
Public Property Country()Property Country() As String
198
Get
199
Dim retValue As String = ""
200
If Not cboCountry.SelectedItem Is Nothing Then
201
Select Case LCase(_CountryData)
202
Case "text"
203
If cboCountry.SelectedIndex = 0 Then 'Return blank if 'Not_Specified' selected
204
retValue = ""
205
Else
206
retValue = cboCountry.SelectedItem.Text
207
End If
208
Case "value"
209
retValue = cboCountry.SelectedItem.Value
210
End Select
211
End If
212
Return retValue
213
End Get
214
Set(ByVal Value As String)
215
_Country = Value
216
End Set
217
End Property
218
Public Property Region()Property Region() As String
219
Get
220
Dim retValue As String = ""
221
If cboRegion.Visible Then
222
If Not cboRegion.SelectedItem Is Nothing Then
223
Select Case LCase(_RegionData)
224
Case "text"
225
If cboRegion.SelectedIndex > 0 Then
226
retValue = cboRegion.SelectedItem.Text
227
End If
228
Case "value"
229
retValue = cboRegion.SelectedItem.Value
230
End Select
231
End If
232
Else
233
retValue = txtRegion.Text
234
End If
235
Return retValue
236
End Get
237
Set(ByVal Value As String)
238
_Region = Value
239
End Set
240
End Property
241
Public Property Postal()Property Postal() As String
242
Get
243
Postal = txtPostal.Text
244
End Get
245
Set(ByVal Value As String)
246
_Postal = Value
247
End Set
248
End Property
249
Public Property Telephone()Property Telephone() As String
250
Get
251
Telephone = txtTelephone.Text
252
End Get
253
Set(ByVal Value As String)
254
_Telephone = Value
255
End Set
256
End Property
257
Public Property Cell()Property Cell() As String
258
Get
259
Cell = txtCell.Text
260
End Get
261
Set(ByVal Value As String)
262
_Cell = Value
263
End Set
264
End Property
265
Public Property Fax()Property Fax() As String
266
Get
267
Fax = txtFax.Text
268
End Get
269
Set(ByVal Value As String)
270
_Fax = Value
271
End Set
272
End Property
273
274
275
Public WriteOnly Property ShowStreet()Property ShowStreet() As Boolean
276
Set(ByVal Value As Boolean)
277
_ShowStreet = Value
278
End Set
279
End Property
280
Public WriteOnly Property ShowUnit()Property ShowUnit() As Boolean
281
Set(ByVal Value As Boolean)
282
_ShowUnit = Value
283
End Set
284
End Property
285
Public WriteOnly Property ShowCity()Property ShowCity() As Boolean
286
Set(ByVal Value As Boolean)
287
_ShowCity = Value
288
End Set
289
End Property
290
Public WriteOnly Property ShowCountry()Property ShowCountry() As Boolean
291
Set(ByVal Value As Boolean)
292
_ShowCountry = Value
293
End Set
294
End Property
295
Public WriteOnly Property ShowRegion()Property ShowRegion() As Boolean
296
Set(ByVal Value As Boolean)
297
_ShowRegion = Value
298
End Set
299
End Property
300
Public WriteOnly