75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.ObjectModel;
|
|
using Prism.Services.Dialogs;
|
|
using SWS.CAD.ViewModels.myViewModelBase;
|
|
using SWS.Commons;
|
|
using SWS.Model;
|
|
using SWS.Service;
|
|
using Unity;
|
|
using MessageBox = System.Windows.Forms.MessageBox;
|
|
|
|
namespace SWS.CAD.ViewModels
|
|
{
|
|
public class DialogPropertyHistoryViewModel : DialogBase, IDialogAware
|
|
{
|
|
ObjectTypeService _objectTypeService { get; set; }
|
|
public DialogPropertyHistoryViewModel()
|
|
{
|
|
_objectTypeService = GlobalObject.container.Resolve<ObjectTypeService>();
|
|
}
|
|
|
|
public string Title => "";
|
|
|
|
public event Action<IDialogResult> RequestClose;
|
|
|
|
public bool CanCloseDialog()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public void OnDialogClosed()
|
|
{
|
|
|
|
}
|
|
private ObservableCollection<ec_enginedata_propertyhis> _listData;
|
|
public ObservableCollection<ec_enginedata_propertyhis> listData
|
|
{
|
|
get { return _listData; }
|
|
set { _listData = value; RaisePropertyChanged(nameof(listData)); }
|
|
}
|
|
|
|
public async void OnDialogOpened(IDialogParameters parameters)
|
|
{
|
|
var tagNumber = parameters.GetValue<string>(GlobalObject.dialogPar.para1.ToString());
|
|
var propertyName = parameters.GetValue<string>(GlobalObject.dialogPar.para2.ToString());
|
|
title = $"【{propertyName}】的属性修改历史记录";
|
|
var list = await _objectTypeService.GetHistoryData(tagNumber, propertyName);
|
|
if (list != null)
|
|
{
|
|
listData=new ObservableCollection<ec_enginedata_propertyhis>(list);
|
|
}
|
|
}
|
|
public override void ExecuteOKCommandAsync(object para)
|
|
{
|
|
|
|
|
|
}
|
|
public override void ExecuteCloseCommand(object parameter)
|
|
{
|
|
if (parameter as string == "ClickNo")
|
|
{
|
|
DialogResult res = new DialogResult(ButtonResult.No);
|
|
RequestClose.Invoke(res);
|
|
}
|
|
else
|
|
{
|
|
RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
|
|
}
|
|
this.Dispose();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|