Wrox Programmer Forums
|
BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5
This is the forum to discuss the Wrox book Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit by David Sussman, Alex Homer; ISBN: 9780764588075
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2006, 04:30 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to support Inventory?

I just bought this book and it's great! :D

I worked through the sample website PizzaPrettyQuick(PPQ) and now I want to extend the database to include inventory so I added an Inventory column to the SizeAndPrice table (I know its not practical for this business scenario but it's more for learning purposes really).

In the example, no modifications are made to the database until the checkout is completed as the shopping cart is held in session memory (this is where all the action takes place).

Would I need to take a similar approach to implementing Inventory tracking? By this I mean would I need to store the menu in session memory (kinda like a detached virtual menu) and then every time the shopping cart item quantities are updated I update the quantity available in the virtual menu. Then upon checkout after I add the shopping cart stuff to Orders/OrderDetails I would proceed with updating the SizeAndPrice table with the new inventory values?

Any help in pointing me in the right direction would be much appreciated :)

TIA

 
Old March 1st, 2006, 08:01 PM
Authorized User
 
Join Date: Jan 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could do it that way. One possible problem is that if you have two concurrent users, the session-based datasets will become out of sync and you'll end up with errors in the database. A solution to this is to run some custom ADO.NET code to execute an UPDATE against the database to remove the item from stock before (or as part of the process of) accepting the order. However, if the user abandons a shopping cart, you'll then have to put the item back in stock. So there are issues to consider both ways.

Once you go beyond simple updates to a single table, you probably need to look at using ADO.NET code and a transaction to perform updates to multiple tables in the database rather than depending on the data source controls to do the updates. This is outside the scope of the book, but it a well-documented process. I suggest looking on the Net for tutorials and examples of using ADO.NET 2.0, or pick up a book that focuses on this topic.
 
Old March 2nd, 2006, 05:47 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Alex I am looking into using ADO.NET transactions as per your advice






Similar Threads
Thread Thread Starter Forum Replies Last Post
Error-Object does not support doesn't support this bootsy Classic ASP Basics 1 May 25th, 2008 07:14 PM
Inventory Control Application rth BOOK: Access 2003 VBA Programmer's Reference 0 January 26th, 2007 11:55 PM
Inventory dmoffice BOOK: Expert One-on-One Access Application Development 2 May 27th, 2005 05:36 PM
Code for inventory mgmt system in J2EE ritesh_sinha J2EE 1 March 20th, 2004 11:21 AM
Need help with inventory control structure watrout Access 1 March 17th, 2004 10:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.