Exemple #1
0
 private static bool InventoryStockUpdateVirtualQty(int productSysNo, int StockSysNo, int affectedVirtualQty
                                                    , string snapShotOnlineQty, int stockqty)
 {
     string[] stockOnlineQty = snapShotOnlineQty.Split(';');
     for (int i = 0; i < stockOnlineQty.Length; i++)
     {
         string _stock     = "";
         int    _Onlineqty = 0;
         if (stockOnlineQty[i] != "")
         {
             _stock = stockOnlineQty[i].Split(':')[0];
             int.TryParse(stockOnlineQty[i].Split(':')[1], out _Onlineqty);
             if (_stock == StockSysNo.ToString())
             {
                 if (_Onlineqty >= 0 && stockqty >= 0)
                 {
                     int n = SecKillDA.InventoryStockUpdateVirtualQty(productSysNo, StockSysNo, affectedVirtualQty);
                     return(n > 0 ? true : false);
                 }
                 else
                 {
                     WriteLog("OnlineQty<0------------->productSysNo, StockSysNo, affectedVirtualQty:" + productSysNo + "-" + StockSysNo + "-" + affectedVirtualQty);
                     return(false);
                 }
             }
         }
     }
     return(false);
 }