|
@@ -111,6 +111,13 @@ namespace MySystem
|
|
if (pro != null)
|
|
if (pro != null)
|
|
{
|
|
{
|
|
order.ProductId = pro.ProductId;
|
|
order.ProductId = pro.ProductId;
|
|
|
|
+ //扣减对应商品的库存
|
|
|
|
+ Products product = db.Products.FirstOrDefault(m => m.Id == pro.ProductId);
|
|
|
|
+ if(product != null)
|
|
|
|
+ {
|
|
|
|
+ product.Stock -= pro.ProductCount;
|
|
|
|
+ product.BuyCount += pro.ProductCount;
|
|
|
|
+ }
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
if(order.ErpMode > 0)
|
|
if(order.ErpMode > 0)
|
|
{
|
|
{
|