protected override bool Execute(ReportingWorklistItem item) { // check if the document is already open if (ActivateIfAlreadyOpen(item)) return true; ReportingWorklistItem replacementStep = null; Platform.GetService<IProtocollingWorkflowService>( delegate(IProtocollingWorkflowService service) { ReviseSubmittedProtocolResponse response = service.ReviseSubmittedProtocol(new ReviseSubmittedProtocolRequest(item.OrderRef)); replacementStep = response.ReplacementStep; }); if (replacementStep == null) return false; // open the report editor ProtocollingComponentDocument protocollingComponentDocument = new ProtocollingComponentDocument( replacementStep, ProtocollingComponentMode.Edit, this.Context); protocollingComponentDocument.Open(); Type selectedFolderType = this.Context.SelectedFolder.GetType(); protocollingComponentDocument.Closed += delegate { DocumentManager.InvalidateFolder(selectedFolderType); }; return true; }
protected override bool Execute(ReportingWorklistItem item) { // check if the document is already open if (ActivateIfAlreadyOpen(item)) { return(true); } ReportingWorklistItem replacementStep = null; Platform.GetService <IProtocollingWorkflowService>( delegate(IProtocollingWorkflowService service) { ReviseSubmittedProtocolResponse response = service.ReviseSubmittedProtocol(new ReviseSubmittedProtocolRequest(item.OrderRef)); replacementStep = response.ReplacementStep; }); if (replacementStep == null) { return(false); } // open the report editor ProtocollingComponentDocument protocollingComponentDocument = new ProtocollingComponentDocument( replacementStep, ProtocollingComponentMode.Edit, this.Context); protocollingComponentDocument.Open(); Type selectedFolderType = this.Context.SelectedFolder.GetType(); protocollingComponentDocument.Closed += delegate { DocumentManager.InvalidateFolder(selectedFolderType); }; return(true); }