Esempio n. 1
0
        public ActionResult ClickTransferCargo(int id, int newNum, int newWarehouseID)
        {
            //添加验证判断库存是否够调用
            var inventoryData = _inventoryDataService.GetById(id);

            if (inventoryData.InventoryQuantity >= newNum)
            {
                if (_inventoryDataService.ClickTransferCargo(id, newNum, newWarehouseID))
                {
                    SuccessNotification("调用成功");
                    return(RedirectToAction("Index"));
                }
                ErrorNotification("调用失败");
                return(RedirectToAction("Index"));
            }
            ErrorNotification("调用数量大于库存剩余,请重新选择");
            return(RedirectToAction("Index"));
        }