コード例 #1
0
 protected override bool CheckStocks(InventoryEntity inventory, int buyNum)
 {
     if (inventory.Amount < buyNum)
     {
         return false;
     }
     inventory.Amount -= buyNum;//支付状态订单扣减库存
     return true;
 }
コード例 #2
0
 /// <summary>
 /// 扣减库存
 /// </summary>
 /// <param name="inventory">库存ID</param>
 /// <param name="buyNum">库存数量</param>
 protected abstract bool CheckStocks(InventoryEntity inventory, int buyNum);
コード例 #3
0
 protected override bool CheckStocks(InventoryEntity inventory, int buyNum)
 {
     return inventory.Amount >= buyNum;
     //未支付订单不扣减库存
 }