AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 Project online shopping
Posted by rutika shihoorkar on  11/10/2009 2:32:33 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
hi,
I am doin project on online shopping ...now in products available ...suppose available quantity is 100 and i purchase one product so now it must be 99 so...what i do for this

Post Your Reply Post New Question

 Viewer's Reply
Inventory System with Online Shopping Cart
Answered By Moderator1 on 11/10/2009 7:04:08 AM
Hi,

You have to maintain 3 fields for this. The fields are as below,

TotalQuantity
SoldQuantity
BalanceQuantity

While you creating the product from your inventory system, save TotalQuantity as 100 and BalanceQuantity as 100 and SoldQuantity as 0. Whenever the product is sold through online shopping, update the SoldQuantity and BalanceQuantity with below formula.
SoldQuantity = SoldQuantity + No. of Items Sold
BalanceQuantity = BalanceQuantity - No. of Items Sold

FIY, don't disturb the value in TotalQuantity as it will be useful for reporting purpose.

Hope this logic will help you.
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Programmers Heaven C# School Book - Free 338 Page eBook
Many .NET teams are underperforming, is yours?
Building a Web Application Security Program