Solved

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

Posted on 2010-09-16
6
322 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

13 Experts available now in Live!

Get 1:1 Help Now