Esempio n. 1
0
        private void LoadProductInfo(ProductInfo productDetails, string brandName)
        {
            if (this.common_Location != null && !string.IsNullOrEmpty(productDetails.MainCategoryPath))
            {
                this.common_Location.CateGoryPath = productDetails.MainCategoryPath.Remove(productDetails.MainCategoryPath.Length - 1);
                this.common_Location.ProductName  = productDetails.ProductName;
            }
            this.litProductName.Text = productDetails.ProductName;
            this.lblProductCode.Text = productDetails.ProductCode;
            this.lblSku.Text         = productDetails.SKU;
            this.lblSku.Value        = productDetails.SkuId;
            this.hiddeSkuId.Value    = productDetails.SkuId;

            this.lblStock.Stock = productDetails.Stock;

            string unit = productDetails.Unit;

            if (!string.IsNullOrEmpty(unit))
            {
                this.litUnit.Text = productDetails.Unit;
            }
            else
            {
                this.litUnit.Text = "件";
            }


            if (productDetails.BuyCardinality > 1)
            {
                this.litBuyCardinality.Text = "起购数:" + productDetails.BuyCardinality;
            }
            else
            {
                this.litBuyCardinality.Visible = false;
            }
            buyCardinality.Value = productDetails.BuyCardinality.ToString();

            if (productDetails.Weight > 0m)
            {
                this.litWeight.Text = string.Format("{0:F2} g", productDetails.Weight);
            }
            else
            {
                this.litWeight.Text = "无";
            }
            this.litBrosedNum.Text = productDetails.VistiCounts.ToString();
            this.litBrand.Text     = brandName;
            if (this.litSaleCounts != null)
            {
                this.litSaleCounts.Text = productDetails.ShowSaleCounts.ToString();
            }
            if (productDetails.MinSalePrice == productDetails.MaxSalePrice)
            {
                this.lblBuyPrice.Text    = productDetails.MinSalePrice.ToString("F2");
                this.lblTotalPrice.Value = new decimal?(productDetails.MinSalePrice);
            }
            else
            {
                this.lblBuyPrice.Text = productDetails.MinSalePrice.ToString("F2") + " - " + productDetails.MaxSalePrice.ToString("F2");
            }
            this.hiddensupplierid.Value = productDetails.SupplierId.ToString();
            this.lblMarkerPrice.Money   = productDetails.MarketPrice;
            if (productDetails.MarketPrice.HasValue && productDetails.MarketPrice > 0)
            {
                this.litMarkPrice.Text = string.Format("市场价:<span id='sp_MarketPrice'>¥{0}</span>", Globals.FormatMoney((decimal)productDetails.MarketPrice));
            }
            this.litDescription.Text = productDetails.Description;
            if (this.litShortDescription != null)
            {
                this.litShortDescription.Text = productDetails.ShortDescription;
            }

            if (this.litTaxRate != null)
            {
                // 组合商品

                this.litTaxRate.Text = productDetails.GetExtendTaxRate();
            }

            ImportSourceTypeInfo imSourceType = ProductBrowser.GetProductImportSourceType(this.productId);

            if (this.litCnArea != null && imSourceType != null)
            {
                this.litCnArea.Text = imSourceType.CnArea;
            }

            if (this.imgIcon != null && imSourceType != null)
            {
                this.imgIcon.ImageUrl = imSourceType.Icon;
            }

            if (this.litShipping != null)
            {
                this.litShipping.Text = productDetails.TemplateName;
            }


            this.lblsmalltitle.Text = productDetails.ProductTitle;
            //if (this.lblStock.Stock ==0)
            //{
            //    //if (productImg != null)
            //    //{
            //    //    productImg.Visible = false;
            //    //}

            //    //if (btnaddgouwu != null)
            //    //{
            //    //    btnaddgouwu.Visible = false;
            //    //}

            //    //if (nowBuyBtn != null)
            //    //{
            //    //    nowBuyBtn.Visible = false;
            //    //}
            //}
        }