Example #1
0
        private static void TransferFromFileCabinetToFileCabinet(Organization organization)
        {
            Console.WriteLine("TransferFromFileCabinetToFileCabinet");

            string     fileCabinetId = "00000000-0000-0000-0000-000000000000";
            List <int> documentIds   = new List <int>()
            {
                8
            };
            string sourceFileCabinetId = "00000000-0000-0000-0000-000000000000";

            FileCabinet fileCabinet = organization.GetFileCabinetsFromFilecabinetsRelation().FileCabinet
                                      .FirstOrDefault(fc => fc.Id == fileCabinetId);

            if (fileCabinet == null)
            {
                Console.WriteLine("FileCabinet is null!");
            }
            else
            {
                FileCabinetTransferInfo fileCabinetTransferInfo = new FileCabinetTransferInfo()
                {
                    KeepSource          = true,
                    SourceDocId         = documentIds,
                    SourceFileCabinetId = sourceFileCabinetId
                };

                DocumentsQueryResult documentsQueryResult =
                    fileCabinet.PostToTransferRelationForDocumentsQueryResult(fileCabinetTransferInfo);
            }
        }
Example #2
0
        /// <summary> Moves the document from file cabinet to document tray. </summary>
        /// <remarks>
        /// This implementation preserves index values when moving the document.
        ///
        /// The instance of the document that you have used when calling this method doesn't contain valid data anymore.
        /// Use the document that is returned as part of DocumentQueryResult in order to get valid data.
        /// </remarks>
        /// <param name="document"> Document to be moved. </param>
        /// <param name="fileCabinet"> File cabinet where document is currently located. </param>
        /// <param name="documentTray"> Document tray document has to be moved into. </param>
        /// <returns>
        /// DocumentQueryResult that allows you access to the document you have just moved.
        /// </returns>
        public DocumentsQueryResult MoveDocumentFromFileCabinetToBasket(Document document, FileCabinet fileCabinet, FileCabinet documentTray)
        {
            var transferInfo = new FileCabinetTransferInfo()
            {
                KeepSource  = false,  // the document will be moved, NOT copied
                SourceDocId = new List <int> {
                    document.Id
                },
                SourceFileCabinetId = fileCabinet.Id
            };

            return(documentTray.PostToTransferRelationForDocumentsQueryResult(transferInfo));
        }
Example #3
0
        /// <remarks>
        /// The instance of the document that you have used when calling this method doesn't contain valid data anymore.
        /// Use the document that is returned as part of DocumentQueryResult in order to get valid data.
        /// </remarks>
        /// <param name="document"> Id of the document to be stored. </param>
        /// <param name="documentTray"> Id of the document tray (basket) document is currently stored in. </param>
        /// <param name="fileCabinet"> File cabinet to store document into. </param>
        /// <returns>
        /// DocumentQueryResult that allows you access to the document you have just moved.
        /// </returns>
        public DocumentsQueryResult StoreDocumentFromBasketToFileCabinetUsingIntellixHints(Document document, FileCabinet documentTray, FileCabinet fileCabinet)
        {
            var transferInfo = new FileCabinetTransferInfo()
            {
                KeepSource  = false,
                SourceDocId = new List <int> {
                    document.Id
                },
                SourceFileCabinetId = documentTray.Id,
                FillIntellix        = true
            };

            return(fileCabinet.PostToTransferRelationForDocumentsQueryResult(transferInfo));
        }
        /// <remarks>
        /// The instance of the document that you have used when calling this method doesn't contain valid data anymore.
        /// Use the document that is returned as part of DocumentQueryResult in order to get valid data.
        /// </remarks>
        /// <param name="document"> Id of the document to be stored. </param>
        /// <param name="documentTray"> Id of the document tray (basket) document is currently stored in. </param>
        /// <param name="fileCabinet"> File cabinet to store document into. </param>
        /// <returns>
        /// DocumentQueryResult that allows you access to the document you have just moved.
        /// </returns>
        public DocumentsQueryResult StoreDocumentFromBasketToFileCabinetUsingIntellixHints(Document document, FileCabinet documentTray, FileCabinet fileCabinet)
        {
            var transferInfo = new FileCabinetTransferInfo()
            {
                KeepSource = false,
                SourceDocId = new List<int> { document.Id },
                SourceFileCabinetId = documentTray.Id,
                FillIntellix = true
            };

            return fileCabinet.PostToTransferRelationForDocumentsQueryResult(transferInfo);
        }
        /// <summary> Moves the document from file cabinet to document tray. </summary>
        /// <remarks>
        /// This implementation preserves index values when moving the document.
        /// 
        /// The instance of the document that you have used when calling this method doesn't contain valid data anymore.
        /// Use the document that is returned as part of DocumentQueryResult in order to get valid data.
        /// </remarks>
        /// <param name="document"> Document to be moved. </param>
        /// <param name="fileCabinet"> File cabinet where document is currently located. </param>
        /// <param name="documentTray"> Document tray document has to be moved into. </param>
        /// <returns>
        /// DocumentQueryResult that allows you access to the document you have just moved.
        /// </returns>
        public DocumentsQueryResult MoveDocumentFromFileCabinetToBasket(Document document, FileCabinet fileCabinet, FileCabinet documentTray)
        {
            var transferInfo = new FileCabinetTransferInfo()
            {
                KeepSource = false,   // the document will be moved, NOT copied
                SourceDocId = new List<int> { document.Id},
                SourceFileCabinetId = fileCabinet.Id
            };

            return documentTray.PostToTransferRelationForDocumentsQueryResult(transferInfo);
        }