Yes, I am creating a Checkout screen for an application, I am using VB.net 2010 and the .NET 4 framework. I have reviewed a bunch of different samples but I am just not sure, what would be the best way to store information on a checkout screen.
Should I use hashtables, lists, a dictionary?? If you add the same product twice I would like it to just change the qty to 2, so it would have to support checking to see if an item already exists in the data, so the class would have to support basic information about the transaction then also a list of items that are in the cart,
Essentially what would be the best way to store all this information and some sample code to check if a product is already in the cart and to just add 1 to the qty?
Public Class Transaction
Public Property tDate as Date
Public Property tCustomerID as Integer
Public Property tProducts as List(of ItemsInCart)
Public Class ItemsInCart
Public Property productID as Integer
Public Property itemPrice as Double
Public Property itemQty as Integer
Public Sub addItem(ByVal product_id as Integer)
if product id already exists here
modify the qty to +1
create a new line item for it