80 lines
2.2 KiB
C#
80 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;
|
|
|
|
namespace SWS.CAD.ViewModels
|
|
{
|
|
public class DialogOperateRecordViewModel : DialogBase, IDialogAware
|
|
{
|
|
DrawingServce _drawingService { get; set; }
|
|
public DialogOperateRecordViewModel()
|
|
{
|
|
_drawingService = GlobalObject.container.Resolve<DrawingServce>();
|
|
}
|
|
|
|
public string Title => "";
|
|
|
|
public event Action<IDialogResult> RequestClose;
|
|
|
|
public bool CanCloseDialog()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public void OnDialogClosed()
|
|
{
|
|
|
|
}
|
|
private ObservableCollection<ec_operate_log> _listData;
|
|
public ObservableCollection<ec_operate_log> listData
|
|
{
|
|
get { return _listData; }
|
|
set { _listData = value; RaisePropertyChanged(nameof(listData)); }
|
|
}
|
|
private ec_operate_log _selectData;
|
|
public ec_operate_log selectData
|
|
{
|
|
get { return _selectData; }
|
|
set { _selectData = value; RaisePropertyChanged(nameof(selectData)); }
|
|
}
|
|
|
|
private ec_drawing_file dwgFile;
|
|
public async void OnDialogOpened(IDialogParameters parameters)
|
|
{
|
|
dwgFile = parameters.GetValue<ec_drawing_file>(GlobalObject.dialogPar.info.ToString());
|
|
title = $"【{dwgFile.DrawingFileName}】的操作记录";
|
|
var list = await _drawingService.GetOperateLog(dwgFile.DrawingFileID);
|
|
if (list != null)
|
|
{
|
|
listData=new ObservableCollection<ec_operate_log>(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();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|