Ejemplo n.º 1
0
        public static void GetInventoryInfoToWrite(int ProductSysNo, string CurrentStatus)
        {
            int             AffectedVirtualQty = 0;
            InventoryEntity inventory          = SecKillDA.GetInventoryByProductSysNo(ProductSysNo);

            if (inventory != null)
            {
                AffectedVirtualQty = inventory.VirtualQty;
            }

            //获取当前的分仓的虚库数量
            List <InventoryStockEntity> Invstocklist = SecKillDA.GetInventoryStock(ProductSysNo);
            StringBuilder stockvirtualqty            = new StringBuilder();

            foreach (InventoryStockEntity itemStock in Invstocklist)
            {
                stockvirtualqty.Append(string.Format("{0}:{1};", itemStock.StockSysNo, itemStock.VirtualQty));
            }

            string msg = DateTime.Now.ToString() + "  商品:" + ProductSysNo.ToString() + "   " + CurrentStatus + " \r\n\t Inventory--VirtualQty: " + AffectedVirtualQty + "\r\n InventoryStock--VirtualQty: " + stockvirtualqty;

            WriteLog(msg);

            bool sendmailflag = Convert.ToBoolean(ConfigurationManager.AppSettings["SendMailFlag"]);

            if (sendmailflag == true)
            {
                SecKillDA.SendMailAboutInventoryInfo(msg, ProductSysNo, CurrentStatus);
            }
        }