From 2c293f8ba1fcc2487157370675bbc3cbfbf2e338 Mon Sep 17 00:00:00 2001 From: liuwf Date: Thu, 12 Sep 2024 15:28:11 +0800 Subject: [PATCH] . --- src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs | 62 +------------- .../WindowPage/InventoryMaterialWindow.xaml | 11 ++- .../InventoryMaterialWindow.xaml.cs | 80 +++++++++++++++++++ 3 files changed, 89 insertions(+), 64 deletions(-) diff --git a/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs b/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs index bd589f4..e4c1225 100644 --- a/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs +++ b/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs @@ -4295,67 +4295,7 @@ namespace Khd.Core.Wpf.Form { InventoryMaterialWindow window = new InventoryMaterialWindow(_host); window.ShowDialog(); - return; - try - { - using var scope = _host.Services.CreateScope(); - using var dbContext = scope.ServiceProvider.GetRequiredService(); - var Orders = dbContext.WmsInventoryCheck.Where(t => t.CheckStatus == "0" || t.CheckStatus == "1").ToList(); - if (Orders != null && Orders.Count > 0) - { - MessageBoxResult messageBoxResult = HandyControl.Controls.MessageBox.Show("已经有盘库任务是否继续创建新盘库任务?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question); - if (messageBoxResult == MessageBoxResult.OK) - { - Orders.ForEach(t => - { - t.CheckStatus = "2"; - }); - dbContext.UpdateRange(Orders); - int locationCount = dbContext.WmsBaseLocation.Where(t => t.warehouseId == 512).Count(); - dbContext.Add(new WmsInventoryCheck() - { - CreateTime = DateTime.Now, - CheckStatus = "0", - LocationAmount = locationCount, - InventoriedAmount = 0, - InventoryingAmount = 0, - WarehouseId = 512, - CreateBy = "WCS" - }); - dbContext.SaveChanges(); - HandyControl.Controls.Growl.Info("创建盘库任务成功!"); - } - else - { - return; - } - } - else - { - MessageBoxResult messageBoxResult = HandyControl.Controls.MessageBox.Show("是否创建一个盘库任务?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question); - if (messageBoxResult == MessageBoxResult.OK) - { - int locationCount = dbContext.WmsBaseLocation.Where(t => t.warehouseId == 512).Count(); - dbContext.Add(new WmsInventoryCheck() - { - CreateTime = DateTime.Now, - CheckStatus = "0", - LocationAmount = locationCount, - InventoriedAmount = 0, - InventoryingAmount = 0, - WarehouseId = 512, - CreateBy = "WCS" - }); - dbContext.SaveChanges(); - HandyControl.Controls.Growl.Info("创建盘库任务成功!"); - } - } - } - catch - { - - } - GetInvertoryData(); + } private void GetInvertoryData() diff --git a/src/Khd.Core.Wpf/WindowPage/InventoryMaterialWindow.xaml b/src/Khd.Core.Wpf/WindowPage/InventoryMaterialWindow.xaml index 954501e..56f6e89 100644 --- a/src/Khd.Core.Wpf/WindowPage/InventoryMaterialWindow.xaml +++ b/src/Khd.Core.Wpf/WindowPage/InventoryMaterialWindow.xaml @@ -39,9 +39,14 @@