예제 #1
0
        void UCProductBatch_Loaded(object sender, RoutedEventArgs e)
        {
            this.Loaded -= new RoutedEventHandler(UCProductBatch_Loaded);

            batchExp.Visibility = this.IsBatch ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;

            filterVM = new ProductBatchRequestVM();
            query    = new ProductBatchQueryFilter();
            batches  = new List <ProductBatchInfoVM>();
            facade   = new ProductBatchQueryFacade(CPApplication.Current.CurrentPage);

            filterVM.HasBatch     = false;
            filterVM.IsCreateMode = this.IsCreateMode;
            filterVM.IsNotReturn  = this.IsNotLend_Return;
            //this.txtReturn.Visibility = System.Windows.Visibility.Collapsed;
            //this.lblReturn.Visibility = System.Windows.Visibility.Collapsed;
            //this.txtLendNum.Visibility = System.Windows.Visibility.Visible;
            //this.lblLendNum.Visibility = System.Windows.Visibility.Visible;


            if (StockSysNo.HasValue)
            {
                filterVM.StockSysNo = StockSysNo.Value;
            }
            if (ReturnDate.HasValue)
            {
                filterVM.ReturnDate = ReturnDate.Value;
            }
            if (this.ConverterCost.HasValue)
            {
                filterVM.ConvertCost = this.ConverterCost;
            }
            filterVM.IsCreateMode = IsCreateMode;
            filterVM.PType        = this.PType;

            if (!this.IsNotLend_Return)
            {
                this.batchdg.Columns[10].Visibility = System.Windows.Visibility.Visible;
                this.batchdg.Columns[9].IsReadOnly  = true;
                //this.txtReturn.Visibility = System.Windows.Visibility.Visible;
                //this.lblReturn.Visibility = System.Windows.Visibility.Visible;

                //this.txtLendNum.Visibility = System.Windows.Visibility.Collapsed;
                //this.lblLendNum.Visibility = System.Windows.Visibility.Collapsed;
            }

            if (this.PType == PageType.Lend)
            {
                this.batchdg.Columns[9].Header = "借出数量";
            }
            else
            {
                this.batchdg.Columns[9].Header = "数量";
            }

            // 修改Model
            if (!IsCreateMode)
            {
                if (!this.IsBatch)
                {
                    switch (this.PType)
                    {
                    case PageType.Lend:
                        this.filterVM.LendNum = this.OperationQuantity.ToString();
                        break;

                    case PageType.Adjust:
                        this.filterVM.AdjustNum = this.OperationQuantity.ToString();
                        break;

                    case PageType.Convert:
                        this.filterVM.ConvertNum = this.OperationQuantity.ToString();
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    this.filterVM.HasBatch = true;
                }

                filterVM.ProductSysNo = this.ProductSysNo;
                filterVM.ProductID    = this.ProductID;
                this.batchdg.Bind();
            }

            // Convert
            if (this.PType == PageType.Convert)
            {
                if (this.ConvertType == ConvertProductType.Source)
                {
                    this.filterVM.ConvertType = "源商品";
                }
                else if (this.ConvertType == ConvertProductType.Target)
                {
                    this.filterVM.ConvertType = "目标商品";
                }
            }

            this.basicInfo.DataContext = filterVM;
        }
예제 #2
0
 public UCProductBatch(ProductBatchRequestVM requestVM, List <ProductBatchInfoVM> batchVM)
     : this(requestVM.ProductSysNo, requestVM.ProductID, false, batchVM)
 {
 }