Exemplo n.º 1
0
		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;
		}
Exemplo n.º 2
0
        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);
        }