Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- 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; }
-
-
- }
- }
|