25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using BPA.Helper;
- using BPASmartClient.DosingSystem.View;
-
-
- 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; }
-
-
- }
- }
|