0

我们在 asp.net-mssql 上开发了一个在线私人购物网站。*我们只销售一种产品。当我只有一种产品库存时,我希望同时进行第 2 块订单。*但我不知道该怎么做。我该怎么做?

私家店是怎么做的?锁东西?或其他方式?

4

1 回答 1

0

This is a design question.

Where the actually sell is happens ? after the payment, or before the payment.

After the payment you just remove from stock the product, and you also check for stock just before the payment. You keep the stock on the database. Here there is a small lag, you can also remove at some point the stock and give some minutes for the payment -if the payment not made bring it back to stock, but there you probably loss a payment.

If you won to lock it before the payment you also need to specify in witch point, at the enter of user data ? of the press of a button ?

The trick here is to keep the stock on the database, and check the available of the product before the step that you wish to final give it.

于 2012-02-09T12:15:45.960 回答