Example #1
0
        /// <summary>
        /// 设置商品价格标签
        /// </summary>
        /// <param name="productItem"></param>
        private void SetPriceAreaText(AsileModel productItem)
        {
            string strContent       = string.Empty;
            bool   blnIsShowContent = true;
            string strAsileCode     = productItem.PaCode;
            string strAsilePrice    = PubHelper.p_BusinOper.MoneyIntToString(productItem.SellPrice);
            string strAsileName     = productItem.McdName;

            switch (PubHelper.p_BusinOper.ConfigInfo.GoodsShowContent)
            {
            case "0":    // 不显示任何内容
                blnIsShowContent = false;
                break;

            case "1":    // 只显示商品价格
                strAsileCode = string.Empty;
                break;

            case "2":    // 只显示商品所在货道编号
                strAsilePrice = string.Empty;
                break;

            case "3":    // 显示商品价格及所在货道编号
                strAsileCode = strAsileCode + "  ";
                break;

            case "4":    // 只显示商品名称
                strAsileCode  = string.Empty;
                strAsilePrice = strAsileName;
                break;

            case "5":    // 显示商品名称和价格
                strAsileCode = strAsileName + "  ";
                break;

            default:    // 只显示商品价格
                strAsileCode = string.Empty;
                break;
            }
            if (!blnIsShowContent)
            {
                gdPriceArea.Visibility = System.Windows.Visibility.Hidden;
            }
            else
            {
                tbSellOut.Text         = string.Empty;
                gdPriceArea.Visibility = System.Windows.Visibility.Visible;
                tbAsileCode.Text       = strAsileCode;
                tbAsilePrice.Text      = strAsilePrice;
            }
        }
Example #2
0
        /// <summary>
        /// 设置库存
        /// </summary>
        /// <param name="productItem"></param>
        private void SetStock(AsileModel productItem)
        {
            bool blnIsEnoughStock = false;// 是否库存充足 False:无库存 True:有库存

            if (PubHelper.p_BusinOper.ConfigInfo.IsRunStock == BusinessEnum.ControlSwitch.Stop)
            {
                // 不启用库存
                blnIsEnoughStock = true;// 认为库存充足
            }
            else
            {
                // 启用库存
                if (productItem.SurNum <= 0)
                {
                    // 库存不足
                    blnIsEnoughStock = false;// 库存不足
                }
                else
                {
                    blnIsEnoughStock = true;// 库存充足
                }
            }
            gdPriceArea.Opacity = 1;
            if (blnIsEnoughStock)
            {
                // 库存充足
                imgProduct.Opacity = 1;
                //imgProduct.IsEnabled = true;
                //gdPriceArea.IsEnabled = true;
                panelSellEnd.Visibility = System.Windows.Visibility.Hidden;
            }
            else
            {
                // 库存不足
                double dblGoodsOpacity = Convert.ToDouble(PubHelper.p_BusinOper.ConfigInfo.GoodsOpacity) / 10;
                imgProduct.Opacity = dblGoodsOpacity;
                //gdPriceArea.Opacity = 1;
                tbSellOut.Text    = PubHelper.p_LangOper.GetStringBundle("Pub_SellOut");
                tbAsilePrice.Text = tbAsileCode.Text = string.Empty;
                //imgProduct.IsEnabled = false;
                //gdPriceArea.IsEnabled = false;
                panelSellEnd.Visibility = System.Windows.Visibility.Hidden;
            }
        }
Example #3
0
        public void SetSource(AsileModel productItem)
        {
            this.Name = "productItem" + productItem.PaCode;

            ////this.SetValue(Grid.RowProperty, productItem.TrayIndex);
            int intRowIndex = productItem.RowIndex;

            if (intRowIndex < 0)
            {
                intRowIndex = 0;
            }
            int intColumnIndex = productItem.ColumnIndex;

            if (intColumnIndex < 0)
            {
                intColumnIndex = 0;
            }

            this.SetValue(Grid.RowProperty, intRowIndex);
            this.SetValue(Grid.ColumnProperty, intColumnIndex);

            //this.SetValue(Grid.ColumnSpanProperty, productItem.ColumnSpan + 1);

            imagePrice.Source = new BitmapImage(new Uri(SkinHelper.p_SkinName + "ProductPage/ProductList/main_price_bottom.png"));
            imgProduct.Source = new BitmapImage(new Uri(PubHelper.GetMcdPic(productItem.McdPicName)));

            double fds = imgProduct.Width;

            ////imagePrice.Width = imgProduct.Width;// 200;// this.ActualWidth / 3;//2014-8-5

            SetPriceAreaText(productItem);

            this.currentProductItem = productItem;

            if (this.currentProductItem.IsNew)
            {
                panelNew.Visibility = System.Windows.Visibility.Visible;
            }

            SetStock(productItem);
        }
Example #4
0
 public void RefreshAsileInfo(AsileModel productItem)
 {
     SetPriceAreaText(productItem);
     imgProduct.Source = new BitmapImage(new Uri(PubHelper.GetMcdPic(productItem.McdPicName)));
     SetStock(productItem);
 }
Example #5
0
 /// <summary>
 /// 设置当前的货道中容纳的产品
 /// </summary>
 /// <param name="mcdInfo"></param>
 internal void SetCurrentGoodsWayProduct(AsileModel asileInfo)
 {
     currentGoodsWayProduct = asileInfo;
 }