Пример #1
0
        public virtual void UpdateProductBasicInfo(ProductInfo productInfo, ref ProductManagerInfo productManager)
        {
            #region PreCheck

            if (!productInfo.ProductBasicInfo.ProductCategoryInfo.SysNo.HasValue)
            {
                throw new BizException("请指定该商品三级类别");
            }

            if (productInfo.ProductBasicInfo.ProductManager.SysNo == 0)
            {
                throw new BizException("请指定该商品PM");
            }

            if (StringUtility.CheckHtml(productInfo.ProductBasicInfo.ProductTitle.Content) || StringUtility.CheckInputType(productInfo.ProductBasicInfo.ProductTitle.Content))
            {
                throw new BizException("商品标题不能含有HTML标签/不能含有全角字符");
            }

            if (StringUtility.CheckHtml(productInfo.ProductBasicInfo.ProductBriefTitle.Content) || StringUtility.CheckInputType(productInfo.ProductBasicInfo.ProductBriefTitle.Content))
            {
                throw new BizException("商品简名不能含有HTML标签/不能含有全角字符");
            }

            if (StringUtility.CheckHtml(productInfo.ProductBasicInfo.ProductBriefAddition.Content) || StringUtility.CheckInputType(productInfo.ProductBasicInfo.ProductBriefAddition.Content))
            {
                throw new BizException("商品简名附加不能含有HTML标签/不能含有全角字符");
            }

            if (String.IsNullOrEmpty(productInfo.ProductBasicInfo.ProductBriefTitle.Content) && String.IsNullOrEmpty(productInfo.ProductBasicInfo.ProductBriefAddition.Content))
            {
                throw new BizException("商品简名和商品简名附加不能同时为空");
            }

            #endregion

            using (var tran = new TransactionScope())
            {
                _productProcessor.UpdateProductBasicInfo(productInfo, ref productManager);
                tran.Complete();
            }
        }