Exemplo n.º 1
0
        public IActionResult AddPurchasingOrderProducts(PurchasingProducts purchasingProducts)
        {
            //权限
            if (!_permissionService.Authorize("AddPurchasingOrderProducts"))
            {
                return(Error("没有此权限!"));
            }

            if (!_purchasingService.ConfirmPurchasingOrderProductIsExist(purchasingProducts))
            {
                _purchasingService.AddPurchasingOrderProduct(purchasingProducts);


                //日志
                #region 新增商品
                var data        = _purchasingService.GetPurchasingById(purchasingProducts.PurchasingId);
                var productData = _productService.GetProductById(purchasingProducts.ProductId);
                var mark        = "新增商品:【" + productData.Name + "】 数量:【" + purchasingProducts.Quantity + "】 单价:【" + purchasingProducts.Price + "】";
                _logService.InsertOrderTableLog("PurchasingProducts", purchasingProducts.PurchasingId, "添加商品", Convert.ToInt32(data.State), mark);
                #endregion

                return(Success());
            }
            else
            {
                return(Error("添加失败,查看是否已添加!"));
            }
        }