From 3681a50da2a100fe60746c448b6fd7b2cd56f679 Mon Sep 17 00:00:00 2001 From: shanji <18996038927@163.com> Date: Fri, 11 Mar 2022 17:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E9=87=87=E8=B4=AD=E5=95=86?= =?UTF-8?q?=20=E9=AA=8C=E8=AF=81=E9=87=87=E8=B4=AD=E5=95=86=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Client/Views/Purchase/1688Purchase.xaml.cs | 4 ++-- .../PurchaseScheme/PurchaseSchemeBusiness.cs | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs b/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs index 28b1e5b3..03b81284 100644 --- a/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs +++ b/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs @@ -14,7 +14,7 @@ namespace BBWY.Client.Views.Purchase { InitializeComponent(); (this.DataContext as _1688PreviewPurchaseViewModel).SetData(orderId, skuItemCount, purchaseScheme, purchaseAccount, consignee); - this.Loaded += _1688Purchase_Loaded; + this.Loaded += _1688Purchase_Loaded; this.Unloaded += _1688Purchase_Unloaded; } @@ -25,7 +25,7 @@ namespace BBWY.Client.Views.Purchase private void _1688Purchase_Loaded(object sender, System.Windows.RoutedEventArgs e) { - Messenger.Default.Register(this, "OnlinePurchase_Close", (x) => this.Close()); + Messenger.Default.Register(this, "OnlinePurchase_Close", (x) => this.Dispatcher.Invoke(() => this.Close())); } } } diff --git a/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs b/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs index b4e83dbf..595eb4ba 100644 --- a/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs +++ b/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs @@ -29,6 +29,15 @@ namespace BBWY.Server.Business { if (batchCURDSchemeRequest.EditPurchaseSchemeList.Count == 0 && batchCURDSchemeRequest.AddPurchaseSchemeList.Count == 0) throw new BusinessException("非法参数"); + if (batchCURDSchemeRequest.AddPurchaseSchemeList.Any(p => string.IsNullOrEmpty(p.PurchaserId) || + string.IsNullOrEmpty(p.PurchaserName) || + string.IsNullOrEmpty(p.PurchaserLocation))) + throw new BusinessException("新增方案中有采购商Id/Name/Location为空"); + + if (batchCURDSchemeRequest.AddPurchaseSchemeList.Any(p => string.IsNullOrEmpty(p.PurchaserId) || + string.IsNullOrEmpty(p.PurchaserName) || + string.IsNullOrEmpty(p.PurchaserLocation))) + throw new BusinessException("编辑方案中有采购商Id/Name/Location为空"); List addPurchaseSchemeList = null; List addPurchaseSchemeProductList = new List();