Exemple #1
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;
                    }
                });
            }
        }