首页->企业网站->中小企业网站系统前台源码(SmallBusinessStarterKit)>>smallbusiness_vb/App-Code/Testimonials/Testimonial.vb>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:中小企业网站系统前台源码(SmallBusinessStarterKit)
当前文件:
SmallBusinessStarterKit/smallbusiness_vb/App_Code/Testimonials/Testimonial.vb[3K,2009-6-12 11:54:22],打开代码结构图
SmallBusinessStarterKit/smallbusiness_vb/App_Code/Testimonials/Testimonial.vb[3K,2009-6-12 11:54:22],打开代码结构图1Imports Microsoft.VisualBasic 2
Imports System 3
Imports System.Data 4
Imports System.Configuration 5
6
_ 7
8
9
'/<summary> 10
'/ class Testimonial 11
'/ represents a testimonial 12
'/</summary> 13
Public Class Testimonial 14
Private _id As String 15
Private _visible As Boolean 16
Private _title As String 17
Private _date As DateTime 18
Private _content As String 19
Private _testifier As String 20
Private _testifierCompany As String 21
Private _imageUrl As String 22
Private _imageAltText As String 23
24
25
26
Public Sub New(ByVal id As String, ByVal visible As Boolean, ByVal title As String, ByVal [date] As DateTime, ByVal content As String, ByVal testifier As String) 27
' exceptions thrown if reqd attributes are missing 28
' 29
If [String].IsNullOrEmpty(id) Then 30
Throw New ArgumentException(Messages.TestimonialsIdUndefined) 31
End If 32
If [String].IsNullOrEmpty(title) Then 33
Throw New ArgumentException(Messages.TestimonialsTitleUndefined) 34
End If 35
If [String].IsNullOrEmpty(content) Then 36
Throw New ArgumentException(Messages.TestimonialsContentUndefined) 37
End If 38
If [String].IsNullOrEmpty(testifier) Then 39
Throw New ArgumentException(Messages.TestimonialsTestifierUndefined) 40
End If 41
If [date].Equals(Nothing) Then 42
Throw New ArgumentException(Messages.TestimonialsDateUndefined) 43
End If 44
_id = id 45
_visible = visible 46
_title = title 47
_date = [date] 48
_content = content 49
_testifier = testifier 50
End Sub 'New 51
52
53
Public ReadOnly Property Id() As String 54
Get 55
Return Util.ReturnEmptyStringIfNull(_id) 56
End Get 57
End Property 58
59
60
Public Property Visible() As Boolean 61
Get 62
Return Util.ReturnEmptyStringIfNull(_visible) 63
End Get 64
Set(ByVal value As Boolean) 65
_visible = value 66
End Set 67
End Property 68
69
70
Public Property Title() As String 71
Get 72
Return Util.ReturnEmptyStringIfNull(_title) 73
End Get 74
Set(ByVal value As String) 75
If [String].IsNullOrEmpty(value) Then 76
Throw New InvalidOperationException(Messages.TitleUndefined) 77
End If 78
_title = value 79
End Set 80
End Property 81
82
83
84
Public Property [Date]() As DateTime 85
Get 86
Return Util.ReturnEmptyStringIfNull(_date) 87
End Get 88
Set(ByVal value As DateTime) 89
_date = value 90
End Set 91
End Property 92
93
94
Public Property Content() As String 95
Get 96
Return Util.ReturnEmptyStringIfNull(_content) 97
End Get 98
Set(ByVal value As String) 99
If [String].IsNullOrEmpty(value) Then 100
Throw New InvalidOperationException(Messages.ContentIsNull) 101
End If 102
_content = value 103
End Set 104
End Property 105
106
107
Public Property Testifier() As String 108
Get 109
Return Util.ReturnEmptyStringIfNull(_testifier) 110
End Get 111
Set(ByVal value As String) 112
_testifier = value 113
End Set 114
End Property 115
116
Public Property TestifierCompany() As String 117
Get 118
Return Util.ReturnEmptyStringIfNull(_testifierCompany) 119
End Get 120
Set(ByVal value As String) 121
_testifierCompany = value 122
End Set 123
End Property 124
125
Public Property ImageUrl() As String 126
Get 127
Return Util.ReturnEmptyStringIfNull(_imageUrl) 128
End Get 129
Set(ByVal value As String) 130
_imageUrl = value 131
End Set 132
End Property 133
134
Public Property ImageAltText() As String 135
Get 136
Return Util.ReturnEmptyStringIfNull(_imageAltText) 137
End Get 138
Set(ByVal value As String) 139
_imageAltText = value 140
End Set 141
End Property 142
143
End Class 'Testimonial 144







