/// <summary> /// Delete WorkflowType by Id /// </summary> /// <param name="workflowTypeId"></param> private void DeleteWorkflowType(IWorkflowsQueryService client) { if (this.SelectedWorkflowType == null) return; if (this.SelectedWorkflowType.WorkflowsCount > 0) { MessageBoxService.ShowError(string.Format( "The {0} can't be deleted, because there are workflows using it.",this.SelectedWorkflowType.Name)); return; } WorkFlowTypeCreateOrUpdateRequestDC request = new WorkFlowTypeCreateOrUpdateRequestDC(); request.SetIncaller(); request.InId = this.SelectedWorkflowType.Id; request.IsDeleted = true; request.InAuthGroupId = this.SelectedWorkflowType.AuthGroupId; request.InPublishingWorkflowId = this.SelectedWorkflowType.PublishingWorkflowId; request.InWorkflowTemplateId = this.SelectedWorkflowType.WorkflowTemplateId; WorkFlowTypeCreateOrUpdateReplyDC reply = client.WorkflowTypeCreateOrUpdate(request); if (reply != null && reply.StatusReply != null) reply.StatusReply.CheckErrors(); this.GetWorkflowTypes(client); }
/// <summary> /// Upload workflowtype to server /// </summary> public void UploadWorkflowType(IWorkflowsQueryService client) { WorkFlowTypeCreateOrUpdateRequestDC request = new WorkFlowTypeCreateOrUpdateRequestDC(); request.SetIncaller(); request.InGuid = this.workflowType.Guid; request.InId = this.workflowType.Id; request.InName = this.Name; request.InPublishingWorkflowId = this.PublishingWorkflowId; request.InWorkflowTemplateId = this.TemplateId; request.InAuthGroupId = this.SelectedAuthGroup != null ? this.SelectedAuthGroup.AuthGroupId : 0; request.IsDeleted = false; this.ValidWorkflowType(request); WorkFlowTypeCreateOrUpdateReplyDC reply = client.WorkflowTypeCreateOrUpdate(request); if (reply != null && reply.StatusReply != null) { try { StatusReplyDC error = reply.StatusReply.CheckErrors(); } catch (Exception ex) { throw new UserFacingException(ex.Message); } } }