diff --git a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs index b96984f..65e6475 100644 --- a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs +++ b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs @@ -736,7 +736,7 @@ namespace DM_Weight.ViewModels { // 更新屏显库存 //List singleChannels = record.FindAll(it => it.BoardType != 1); - List singleChannels = record.Where(it => it.BoardType.ToString().Contains("5")) + List singleChannels = record.Where(it => it.BoardType == 5) .GroupBy(it => new { it.DrawerNo, it.ColNo }) .Select(it => { diff --git a/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs b/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs index ad0cbc3..6f06729 100644 --- a/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs +++ b/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs @@ -228,7 +228,7 @@ namespace DM_Weight.ViewModels SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId, it.PosNo }).ExecuteCommand(); GetChannelsByDrawerNo(); - if (item.BoardType.ToString().Contains("5")) + if (item.BoardType == 5) { _portUtil.WindowName = "BindingChannelDialog"; // 向显示屏写入库位信息 @@ -283,7 +283,7 @@ namespace DM_Weight.ViewModels item.EffDate = String.Format("{0:yyyy-MM-dd}", DrugManuNo.EffDate); SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId, it.ManuNo, it.EffDate, it.PosNo }).ExecuteCommand(); - if (item.BoardType.ToString().Contains("5")) + if (item.BoardType == 5) { _portUtil.WindowName = "BindingChannelDialog"; // 向显示屏写入库位信息 @@ -333,7 +333,7 @@ namespace DM_Weight.ViewModels item.EffDate = null; item.DrugInfo = null; SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId, it.ManuNo, it.EffDate }).ExecuteCommand(); - if (item.BoardType.ToString().Contains("5")) + if (item.BoardType == 5) { // 清除显示屏库位信息 _portUtil.ClearContent(item.DrawerNo, item.ColNo); diff --git a/DM_Weight/ViewModels/BindingChannelNewDialogViewModel.cs b/DM_Weight/ViewModels/BindingChannelNewDialogViewModel.cs index cbf36b1..98ede1d 100644 --- a/DM_Weight/ViewModels/BindingChannelNewDialogViewModel.cs +++ b/DM_Weight/ViewModels/BindingChannelNewDialogViewModel.cs @@ -274,7 +274,7 @@ namespace DM_Weight.ViewModels SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId, it.PosNo,it.DrugSpec }).ExecuteCommand(); GetChannelsByDrawerNo(); - if (item.BoardType.ToString().Contains("5")) + if (item.BoardType == 5) { _portUtil.WindowName = "BindingChannelDialog"; // 向显示屏写入库位信息 @@ -344,7 +344,7 @@ namespace DM_Weight.ViewModels //item.EffDate = String.Format("{0:yyyy-MM-dd}", DrugManuNo.EffDate); SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId, it.PosNo,it.DrugSpec }).ExecuteCommand(); - if (item.BoardType.ToString().Contains("5")) + if (item.BoardType == 5) { _portUtil.WindowName = "BindingChannelDialog"; // 向显示屏写入库位信息 @@ -411,7 +411,7 @@ namespace DM_Weight.ViewModels item.Drug = null; item.DrugSpec = null; SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId,it.DrugSpec }).ExecuteCommand(); - if (item.BoardType.ToString().Contains("5")) + if (item.BoardType == 5) { // 清除显示屏库位信息 _portUtil.ClearContent(item.DrawerNo, item.ColNo); diff --git a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs index ed4b4e1..90263bd 100644 --- a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs @@ -296,15 +296,6 @@ namespace DM_Weight.ViewModels }); if (f.Data) { - // 更新屏显库存 - List singleChannels = record.FindAll(it => it.BoardType != 1); - if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5")) - { - singleChannels.ForEach(it => - { - _portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity); - }); - } RequestData(); AlertMsg alertMsg = new AlertMsg { diff --git a/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs b/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs index 4d3f779..50b9dee 100644 --- a/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs @@ -301,15 +301,6 @@ namespace DM_Weight.ViewModels }); if (f.Data) { - // 更新屏显库存 - List singleChannels = record.FindAll(it => it.BoardType != 1); - if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5")) - { - singleChannels.ForEach(it => - { - _portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity); - }); - } RequestData(); AlertMsg alertMsg = new AlertMsg { diff --git a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs index f1f8004..37e6a99 100644 --- a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs @@ -371,7 +371,7 @@ namespace DM_Weight.ViewModels { // 更新屏显库存 List singleChannels = record.FindAll(it => it.BoardType != 1); - if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5")) + if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5) { singleChannels.ForEach(it => { diff --git a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs index ae62283..cb0a1be 100644 --- a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs @@ -435,7 +435,7 @@ namespace DM_Weight.ViewModels { // 更新屏显库存 List singleChannels = record.FindAll(it => it.BoardType != 1); - if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5")) + if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5) { singleChannels.ForEach(it => { diff --git a/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs b/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs index ddee228..21e37f0 100644 --- a/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs +++ b/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs @@ -429,7 +429,7 @@ namespace DM_Weight.ViewModels { // 更新屏显库存 List singleChannels = record.FindAll(it => it.BoardType != 1); - if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5")) + if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5) { singleChannels.ForEach(it => { diff --git a/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs b/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs index dbe12b0..de3da3e 100644 --- a/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs +++ b/DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs @@ -360,7 +360,7 @@ namespace DM_Weight.ViewModels if (f.Data) { // 更新屏显库存 - if (ChannelStock.BoardType.ToString().Contains("5")) + if (ChannelStock.BoardType == 5) { _portUtil.WriteQuantity(ChannelStock.DrawerNo, ChannelStock.ColNo, ChannelStock.Quantity + ReturnQuantity); } diff --git a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs index ce01839..f1164ae 100644 --- a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs +++ b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs @@ -311,7 +311,7 @@ namespace DM_Weight.ViewModels if (f.Data) { // 更新屏显库存 - if (ChannelStock.BoardType.ToString().Contains("5")) + if (ChannelStock.BoardType == 5) { _portUtil.WriteQuantity(ChannelStock.DrawerNo, ChannelStock.ColNo, ChannelStock.Quantity + ReturnQuantity); } diff --git a/DM_Weight/ViewModels/SelfAddDialogViewModel.cs b/DM_Weight/ViewModels/SelfAddDialogViewModel.cs index 95e7c43..7a4770a 100644 --- a/DM_Weight/ViewModels/SelfAddDialogViewModel.cs +++ b/DM_Weight/ViewModels/SelfAddDialogViewModel.cs @@ -363,7 +363,7 @@ namespace DM_Weight.ViewModels { // 更新屏显库存 List singleChannels = record.FindAll(it => it.BoardType != 1); - if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5")) + if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5) { singleChannels.ForEach(it => { diff --git a/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs b/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs index 59df223..dce4974 100644 --- a/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs @@ -337,8 +337,7 @@ namespace DM_Weight.ViewModels { // 更新屏显库存 List singleChannels = record.FindAll(it => it.BoardType != 1); - //if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5) - if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5")) + if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5) { singleChannels.ForEach(it => {