Public Class Product
Private _name As String
Private _price As Decimal
Private _imageUrl As String
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property Price() As Decimal
Get
Return _price
End Get
Set(ByVal value As Decimal)
_price = 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
Public Sub New(ByVal name As String, ByVal price As Decimal)
_name = name
_price = price
End Sub
Public Function GetHtml() As String
Dim htmlString As String
htmlString = "
" & Name & "
"
htmlString &= "
Costs: " & Price.ToString() & "
"
htmlString &= ""
Return htmlString
End Function
End Class
No comments:
Post a Comment