(
Imports Microsoft
Imports System
Imports System
Imports System
Namespace Wrox
<Serializable()> _
Public Class CartItem
Private _productID As Integer
Private _productName As String
Private _productImageUrl As String
Private _quantity As Integer
Private _price As Double
Private _lineTotal As Double
Public Sub New()
End Sub
Public Sub New(ByVal ProductID As Integer
_productID = ProductID
_productName = ProductName
_productImageUrl = ProductImageUrl
_quantity = Quantity
_price = Price
_lineTotal = Quantity * Price
End Sub
Public Property ProductID() As Integer
Get
Return _productID
End Get
Set(ByVal value As Integer)
_productID = value
End Set
End Property
Public Property ProductName() As String
Get
Return _productName
End Get
Set(ByVal value As String)
_productName = value
End Set
End Property
Public Property ProductImageUrl() As String
Get
Return _productImageUrl
End Get
Set(ByVal value As String)
_productImageUrl = value
End Set
End Property
Public Property Quantity() As Integer
Get
Return _quantity
End Get
Set(ByVal value As Integer)
_quantity = value
End Set
End Property
Public Property Price() As Double
Get
Return _price
End Get
Set(ByVal value As Double)
_price = value
End Set
End Property
Public ReadOnly Property LineTotal() As Double
Get
Return _quantity * _price
End Get
End Property
[
From:http://tw.wingwit.com/Article/program/net/201311/15597.html