Solved

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

Posted on 2010-09-16
6
346 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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