Exemplo n.º 1
0
        /// <summary>
        /// 添加诊疗项目
        /// </summary>
        /// <param name="shopId">诊所id</param>
        /// <param name="product">诊疗项目信息</param>
        /// <param name="pics">需要转移的诊疗项目图片地址</param>
        /// <param name="skus">skus,至少要有一项</param>
        /// <param name="description">描述</param>
        /// <param name="attributes">诊疗项目属性</param>
        /// <param name="goodsCategory">诊所分类</param>
        /// <param name="sellerSpecifications">诊所自定义规格</param>
        public static Product AddProduct(long shopId, Product product, string[] pics, SKU[] skus, ProductDescription description, ProductAttribute[] attributes, long[] goodsCategory, SellerSpecificationValue[] sellerSpecifications)
        {
            var productInfo              = product.Map <ProductInfo>();
            var skuInofs                 = skus.Map <SKUInfo[]>();
            var descriptionInfo          = description.Map <ProductDescriptionInfo>();
            var attributeInfos           = attributes.Map <ProductAttributeInfo[]>();
            var sellerSpecificationInfos = sellerSpecifications.Map <SellerSpecificationValueInfo[]>();

            _productService.AddProduct(shopId, productInfo, pics, skuInofs, descriptionInfo, attributeInfos, goodsCategory, sellerSpecificationInfos);
            CreateHtml(productInfo.Id);
            //  DTO.Product.Product p = new Product();
            return(AutoMapper.Mapper.Map <Product>(productInfo));
        }