79 lines
2.3 KiB
C#
79 lines
2.3 KiB
C#
![]() |
using System.Collections.ObjectModel;
|
|||
|
using System.IO;
|
|||
|
using System.Windows.Forms;
|
|||
|
using Prism.Dialogs;
|
|||
|
using SWS.CAD.Models;
|
|||
|
using SWS.CAD.Services;
|
|||
|
using SWS.CAD.ViewModels.myViewModelBase;
|
|||
|
using Unity;
|
|||
|
using DialogResult = System.Windows.Forms.DialogResult;
|
|||
|
using MessageBox = System.Windows.Forms.MessageBox;
|
|||
|
|
|||
|
namespace SWS.CAD.ViewModels
|
|||
|
{
|
|||
|
public class DialogOperateRecordViewModel : DialogBase, IDialogAware
|
|||
|
{
|
|||
|
DrawingServce _drawingService { get; set; }
|
|||
|
public DialogOperateRecordViewModel()
|
|||
|
{
|
|||
|
_drawingService = GlobalObject.container.Resolve<DrawingServce>();
|
|||
|
}
|
|||
|
|
|||
|
public DialogCloseListener RequestClose { get; }
|
|||
|
|
|||
|
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")
|
|||
|
{
|
|||
|
RequestClose.Invoke(ButtonResult.No);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
RequestClose.Invoke(ButtonResult.Cancel);
|
|||
|
}
|
|||
|
this.Dispose();
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|