Exemplo n.º 1
0
        //private SaleDiscountRulePromotionEngine _promotionEngine = ObjectFactory<SaleDiscountRulePromotionEngine>.Instance;

        public virtual SaleDiscountRule Load(int sysNo)
        {
            var result = _daSaleDiscountRule.Load(sysNo);

            if (result == null)
            {
                //throw new BizException(string.Format("系统编号为{0}的销售立减规则不存在。", sysNo));
                throw new BizException(string.Format(ResouceManager.GetMessageString("MKT.SaleDiscountRule", "SaleDiscountRule_NotExistSaleDiscountRule"), sysNo));
            }
            if (result.BrandSysNo > 0)
            {
                var brand = ExternalDomainBroker.GetBrandInfoBySysNo(result.BrandSysNo.Value);
                if (brand != null && brand.BrandNameLocal != null)
                {
                    result.UIBrandName = brand.BrandNameLocal.Content;
                }
            }
            if (result.ProductSysNo > 0)
            {
                var productInfo = ExternalDomainBroker.GetProductInfo(result.ProductSysNo.Value);
                if (productInfo != null)
                {
                    result.UIProductID = productInfo.ProductID;
                }
            }

            return(result);
        }