Exemple #1
0
        /// <summary>
        /// 创建货道
        /// </summary>
        private void CreateAsile(List <AsileModel> products)
        {
            panelAsile.Children.Clear();

            int index = 0;

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    GoodsWayProduct productControl = new GoodsWayProduct()
                    {
                        HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
                        VerticalAlignment   = System.Windows.VerticalAlignment.Stretch,
                        Margin = new Thickness(5)
                    };

                    Grid.SetRow(productControl, i);
                    Grid.SetColumn(productControl, j);
                    panelAsile.Children.Add(productControl);

                    productControl.MouseLeftButtonUp += (GoodsWayChecked);

                    if (index < products.Count)
                    {
                        productControl.SetCurrentGoodsWayProduct(products[index]);
                        productControl.SetOneText(products[index].PaCode +
                                                  "【" + m_Title_SpringNum + products[index].SpringNum + "】");
                        productControl.SetSecondText(m_Title_StockNum.Replace("{N}", products[index].SurNum.ToString()));
                        if (index == 0)
                        {
                            productControl.IsDefaultCheck(true);
                            GoodsWayChecked(productControl, null);
                        }
                    }
                    else
                    {
                        productControl.SetNoGoods(m_Title_NoGoodsTitle);
                    }
                    index++;
                }
            }

            if (products.Count == 0)
            {
                btnTrayFull.IsEnabled = false;
            }
            else
            {
                btnTrayFull.IsEnabled = true;
            }
        }
        /// <summary>
        /// 创建货道
        /// </summary>
        private void CreateAsile(List <AsileModel> products)
        {
            panelAsile.Children.Clear();

            int    index      = 0;
            string strOneText = string.Empty;

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    GoodsWayProduct productControl = new GoodsWayProduct()
                    {
                        HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
                        VerticalAlignment   = System.Windows.VerticalAlignment.Stretch,
                        Margin = new Thickness(5)
                    };

                    Grid.SetRow(productControl, i);
                    Grid.SetColumn(productControl, j);
                    panelAsile.Children.Add(productControl);

                    productControl.MouseLeftButtonUp += (AsileButtonChecked);

                    if (index < products.Count)
                    {
                        productControl.SetCurrentGoodsWayProduct(products[index]);
                        SetAsileInfo(productControl);
                        ////if (string.IsNullOrEmpty(products[index].McdName))
                        ////{
                        ////    strOneText = products[index].PaCode;
                        ////}
                        ////else
                        ////{
                        ////    strOneText = products[index].PaCode + "【" + products[index].McdName + "】";
                        ////}
                        ////productControl.SetOneText(strOneText);
                        ////productControl.SetSecondText(PubHelper.p_BusinOper.MoneyIntToString(products[index].SellPrice));
                        if (index == 0)
                        {
                            productControl.IsDefaultCheck(true);
                            AsileButtonChecked(productControl, null);
                        }
                    }
                    else
                    {
                        productControl.SetNoGoods(m_Title_NoGoodsTitle);
                    }
                    index++;
                }
            }

            if (products.Count == 0)
            {
                ControlAsile(false);
            }
            else
            {
                ControlAsile(true);
            }
        }