創建稱為Items的特性
Public Property Items() As List(Of CartItem)
Get
Return _items
End Get
Set(ByVal value As List(Of CartItem))
_items = value
End Set
然後開始
Public Sub Insert(ByVal ProductID As Integer
Dim ItemIndex As Integer = ItemIndexOfID(ProductID)
If ItemIndex =
Dim NewItem As New CartItem()
NewItem
NewItem
NewItem
NewItem
NewItem
_items
Else
_items(ItemIndex)
End If
_lastUpdate = DateTime
End Sub
向購物車中添加新的商品(Insert方法)時
[
From:http://tw.wingwit.com/Article/program/net/201311/15593.html