Solved

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

Posted on 2010-09-16
6
342 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb.net dbnull syntax 1 49
Select coumns form Data table? 3 25
Error in Visual Project 10 45
How does this modal gets closed? 6 40
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

737 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