Solved

What would the best way to make a shopping cart in .Net 4 VB.net 2010 Be?

Posted on 2010-09-16
6
325 Views
Last Modified: 2013-11-08
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)

End Class

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
  else
   create a new line item for it
  end if
 End Sub 
End Class

Open in new window

0
Comment
Question by:rbgCODE
  • 4
6 Comments
 
LVL 4

Expert Comment

by:dansperber
ID: 33702233
Obviously I dont know any background about your company, but, have you thought about using a shopping cart service on the internet...I have used Paypal and it is great because they keep all the data and the integration works quite well.  The reason I mention this is because you may not want the legality or other issues behind having customer information on your servers...it may be better to keep the customer data/credit cards or whatever on a site like paypal because if there ever is an issue, or hacker, let those companies deal with the lawyer issues, etc.  I have bought a lot of stuff on the internet and noticed that a lot of people use Paypal and the Paypal shopping cart...I dont know the details of how it integrates with your system, but it may be something to think about..
0
 
LVL 6

Author Comment

by:rbgCODE
ID: 33746624
Credit card and payment information is not stored locally on the system, it is just a way to add up products and get a total with taxes.  So I just need a way to keep track of everything n the cart etc etc,
0
 
LVL 6

Author Comment

by:rbgCODE
ID: 33780913
Anyone have any ideas?  Maybe using a class that uses dictionary to store the information?  I am open to anything...
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 8

Accepted Solution

by:
johny_bravo1 earned 500 total points
ID: 34388957
HI rbgCODE,
Please check
http://www.asp.net/web-forms/tutorials/tailspin-spyworks-part-1
You can definitely get the idea.Thanks
0
 
LVL 6

Author Comment

by:rbgCODE
ID: 37143248
There have been no acceptable answers can this question be closed please.
0
 
LVL 6

Author Closing Comment

by:rbgCODE
ID: 37310566
Best answer that was suggested.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now