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();