Exemple #1
0
 private void ucProduct_ProductSelected(object sender, Basic.Components.UserControls.ProductPicker.ProductSelectedEventArgs e)
 {
     if (null != e.SelectedProduct)
     {
         int selectProductID = e.SelectedProduct.SysNo.Value;
         //获取默认的采购价格(商品的当前价格,当前成本)
         //TODO:这里是采购价格,不是正常价格
         if (e.SelectedProduct.VFItem == "Y" && (e.SelectedProduct.VFItem == "U" || e.SelectedProduct.VFItem == "L"))
         {
             newVM.OrderPrice = e.SelectedProduct.PurchasePrice.HasValue ? e.SelectedProduct.PurchasePrice.Value.ToString("f2") : "0.00";
         }
         else
         {
             newVM.OrderPrice = e.SelectedProduct.VirtualPrice.HasValue ? e.SelectedProduct.VirtualPrice.Value.ToString("f2") : "0.00";
         }
         newVM.BriefName = e.SelectedProduct.ProductName;
         //型号:
         newVM.ProductMode = e.SelectedProduct.ProductID;
         newVM.ProductName = e.SelectedProduct.ProductName;
         newVM.ReturnCost  = 0m;
         //当前成本 :
         newVM.CurrentUnitCost = e.SelectedProduct.UnitCost;
         newVM.AvailableQty    = e.SelectedProduct.AvailableQty;
     }
 }
Exemple #2
0
        void ucProduct_ProductSelected(object sender, Basic.Components.UserControls.ProductPicker.ProductSelectedEventArgs e)
        {
            //查询商品的最后一次PO入库的价格:
            string getProductSysNo = e.SelectedProduct.SysNo.HasValue ? e.SelectedProduct.SysNo.Value.ToString() : "";

            if (!string.IsNullOrEmpty(getProductSysNo))
            {
                poFacade.QueryPurchaseOrderLastPrice(getProductSysNo, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    if (null != args.Result && null != args.Result.Rows)
                    {
                        decimal getLastPrice  = (args.Result.Rows[0]["LastPrice"] == null ? 0m : Convert.ToDecimal(args.Result.Rows[0]["LastPrice"].ToString()));
                        editVM.OldSettlePrice = getLastPrice.ToString("f2");
                    }
                    else
                    {
                        CurrentWindow.Alert(string.Format(ResSettledProductsRuleQuery.InfoMsg_SettleRule_LastPurchasePriceNotFound, getProductSysNo));
                        editVM.OldSettlePrice = null;
                        return;
                    }
                });
            }
        }
        private void ucProductPicker_ProductSelected(object sender, Basic.Components.UserControls.ProductPicker.ProductSelectedEventArgs e)
        {
            ProductVM vm = e.SelectedProduct as ProductVM;

            if (vm != null)
            {
                model.ProductTitle = vm.ProductName;
                model.ProductPrice = vm.CurrentPrice;
                model.ProductID    = vm.ProductID;
                model.ProductSysNo = vm.SysNo.Value;
            }
        }
Exemple #4
0
 void ucProductPicker_ProductSelected(object sender, Basic.Components.UserControls.ProductPicker.ProductSelectedEventArgs e)
 {
     this.DataGrid.Bind();
 }