[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2010-09-16
6
Medium Priority
?
359 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Accepted Solution

by:
johny_bravo1 earned 1500 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

649 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