diff --git a/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs b/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs index 2b909c6..00db46a 100644 --- a/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs +++ b/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs @@ -632,9 +632,9 @@ namespace DM_Weight.ViewModels List singleChannelsBoxSmart = record.FindAll(it => it.BoardType == 35); if ((singleChannelsBoxSmart.Count > 0 ? singleChannelsBoxSmart[0].BoardType : 1) == 35) { - singleChannelsBoxSmart.ForEach(it => + singleChannelsBoxSmart.ForEach(async it => { - _portUtil.WriteQuantityMethod((it.Quantity - it.TakeQuantity), it.DrawerNo, it.ColNo); + await _portUtil.WriteQuantityMethod((it.Quantity - it.TakeQuantity), it.DrawerNo, it.ColNo); Thread.Sleep(200); }); } diff --git a/DM_Weight/ViewModels/AddToJiaoJieWindowViewModel.cs b/DM_Weight/ViewModels/AddToJiaoJieWindowViewModel.cs index 22de0bf..aeeb3ab 100644 --- a/DM_Weight/ViewModels/AddToJiaoJieWindowViewModel.cs +++ b/DM_Weight/ViewModels/AddToJiaoJieWindowViewModel.cs @@ -166,7 +166,8 @@ namespace DM_Weight.ViewModels } else { - _ChannelLists.Clear(); + _ChannelLists?.Clear(); + _ChannelLists = new List(); } }