diff --git a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs index 9ac9304..a5fbc69 100644 --- a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs +++ b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs @@ -136,6 +136,14 @@ namespace DM_Weight.ViewModels SetProperty(ref _machineRecords, value); } } + + private MachineRecord _machineRecord=new(); + + public MachineRecord _MachineRecord + { + get=> _machineRecord; + set=>SetProperty(ref _machineRecord, value); + } private ChannelStock _channelStock; @@ -205,6 +213,32 @@ namespace DM_Weight.ViewModels .ToList(); MachineRecords = queryData; } + + + + public DelegateCommand RowSelected + { + get => new DelegateCommand(() => + { + + if (MachineRecords != null && MachineRecords.Count>0) + { + MachineRecords = MachineRecords.Select(x => + { + if (x.Id == _MachineRecord.Id) + { + x.IsSelected = !x.IsSelected; + } + return x; + }).ToList(); + //DialogParameters dialogParameters = new DialogParameters(); + //dialogParameters.Add("channel", Channel); + //DialogServiceExtensions.ShowDialogHost(_dialogService, "ReturnEmptyDialog", dialogParameters, DoDialogResult, "RootDialog"); + } + }); + } + + //选中药品将要返还的数量添加到文本框 private void CheckboxChecked() { diff --git a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml index 0a9349c..3ed4c2c 100644 --- a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml +++ b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml @@ -140,6 +140,7 @@ @@ -152,6 +153,11 @@ + + + + +