TellmePdmsPluging/Commands/CloseProjectCommand.cs

41 lines
941 B
C#

using System;
using TellmePdmsPluging.Core;
using TellmePdmsPluging.Models;
namespace TellmePdmsPluging.Commands
{
public class CloseProjectCommand : ICommand
{
public CloseProjectCommand(CloseProjectRequest request)
{
Request = request ?? new CloseProjectRequest();
CommandId = Guid.NewGuid().ToString("N");
}
public string CommandId { get; }
public string CommandType
{
get { return "CloseProject"; }
}
public bool CanCancel
{
get { return false; }
}
public CloseProjectRequest Request { get; }
public object Execute()
{
Request.ApplyDefaults();
return PdmsManager.Instance.CloseProject(Request);
}
public void Cancel()
{
throw new NotSupportedException("CloseProjectCommand 不支持取消");
}
}
}