首次提交:添加src文件夹代码
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
//using GalaSoft.MvvmLight.Command;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Unity;
|
||||
using Cowain.Bake.Model;
|
||||
using System.Collections.ObjectModel;
|
||||
using Cowain.Bake.BLL;
|
||||
using Prism.Commands;
|
||||
|
||||
namespace Cowain.Bake.UI.ProductManagement.ViewModels
|
||||
{
|
||||
public class DisableStoveViewModel
|
||||
{
|
||||
private IUnityContainer _unityContainer;
|
||||
//public RelayCommand SaveCommand { get; set; }
|
||||
public DisableStoveViewModel(IUnityContainer unityContainer)
|
||||
{
|
||||
_unityContainer = unityContainer;
|
||||
DisplayInfo();
|
||||
}
|
||||
public ObservableCollection<TStation> MachineList { get; set; } = new ObservableCollection<TStation>();
|
||||
public DelegateCommand<object> SaveCommand => new DelegateCommand<object>((x) =>
|
||||
{
|
||||
foreach (var item in MachineList)
|
||||
{
|
||||
_unityContainer.Resolve<StationService>().UpdateEnableStatus(item);
|
||||
}
|
||||
Common.Core.CommonCoreHelper.Instance.MainViewAutoEvent.Set();
|
||||
HandyControl.Controls.Growl.Success("保存成功!");
|
||||
});
|
||||
private void DisplayInfo()
|
||||
{
|
||||
_unityContainer.Resolve<StationService>().GetAll().ForEach(item => MachineList.Add(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user