Click or drag to resize
Merge and divide Documents

This examples show how you can merge and divide documents.

Merge Documents

In order to merge documents specify the documents and the file cabinet or basket where the documents reside. The merge operation creates a new document and removed the merged documents.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DocuWare.Platform.ServerClient;

namespace DocuWare.PlatformClientExamples
{
    static partial class Examples
    {
        static public Document MergeDocuments(FileCabinet cabinet, List<int> docIds)
        {
            Document mergedDocument = cabinet.PutToContentMergeOperationRelationForDocument
                (
                    new ContentMergeOperationInfo()
                    {
                        Documents = docIds,
                        Operation = ContentMergeOperation.Staple,
                        Force = true
                    }
                );
            return mergedDocument;
        }
    }
}
Divide a Document

When a document id divided then new documents are created in the specified basket or file cabinet. The list of new documents is the result of the divide operation.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DocuWare.Platform.ServerClient;

namespace DocuWare.PlatformClientExamples
{
    static partial class Examples
    {
        static public DocumentsQueryResult DivideDocument(FileCabinet cabinet, Document doc)
        {
            DocumentsQueryResult result = 
                doc.PutToContentDivideOperationRelationForDocumentsQueryResult
                (
                    new ContentDivideOperationInfo()
                    {
                        Force = true,
                        Operation = ContentDivideOperation.Unstaple
                    }
                );
            return result;
        }

    }
}
See Also