|
- using BPA.Helper;
- using BPASmartClient.DosingSystem.View;
- using System.Collections.ObjectModel;
- using System.Linq;
-
-
- namespace BPASmartClient.DosingSystem.ViewModel
- {
- public class OutletManagementViewModel : ViewModelBase
- {
- public OutletManagementViewModel()
- {
- AddCommand = new BPARelayCommand(() =>
- {
- NewOutletView newOutletView = new NewOutletView();
- newOutletView.ShowDialog();
- });
- SaveCommand = new BPARelayCommand(() => { Json<DevicePar>.Save(); });
- OutletInfoModels = Json<DevicePar>.Data.OutletInfoModels;
- RemoveCommand = new BPARelayCommand<object>((o) =>
- {
- if (!string.IsNullOrEmpty(o?.ToString()))
- {
- var res = Json<DevicePar>.Data.OutletInfoModels.FirstOrDefault(p => p.OutletName == o.ToString());
- if (res != null)
- {
- Json<DevicePar>.Data.OutletInfoModels.Remove(res);
- //Control.GetInstance.OperationLog($"{res.OutletName} 删除成功");
- }
- }
- });
-
- DetailsCommand = new BPARelayCommand<object>((o) =>
- {
- if (!string.IsNullOrEmpty(o?.ToString()))
- {
- var res = Json<DevicePar>.Data.OutletInfoModels.FirstOrDefault(p => p.OutletName == o.ToString());
- if (res != null)
- {
- NewOutletView newOutletView = new NewOutletView();
- ActionManage.GetInstance.Send("OpenNewOutlet", res);
- newOutletView.ShowDialog();
- }
- }
- });
- }
-
- public ObservableCollection<OutletInfoModel> OutletInfoModels { get; set; }
-
-
- }
- }
|