示例#1
0
        // ------------------------------------------
        //            List Documents
        // ------------------------------------------
        public void loadLinkedDocuments(Document document)
        {
            // Image list
            //
            ImageList imageList = ControllerUtils.GetImageList();

            // Binding
            tvLinkedDocuments.ImageList = imageList;

            // Clear nodes
            tvLinkedDocuments.Nodes.Clear();

            var docoList = ClientDocumentLinkList.ListRelatedDocuments(
                selectedClient.UID,
                documentSetUID,
                document.UID,
                cbxLinkType.Text);

            // Load document in the treeview
            //
            // docoList.ListInTree(tvLinkedDocuments);
            Document root = new Document();

            root.CUID       = document.CUID;
            root.RecordType = FCMConstant.RecordType.FOLDER;
            root.UID        = document.UID;
            // root.Read();

            // root = RepDocument.Read(false, document.UID);

            // Using Business Layer
            var documentReadRequest = new DocumentReadRequest();

            documentReadRequest.UID  = document.UID;
            documentReadRequest.CUID = "";
            documentReadRequest.retrieveVoidedDocuments = false;

            var docreadresp = BUSDocument.DocumentRead(documentReadRequest);

            if (docreadresp.response.ReturnCode == 0001)
            {
                // all good
            }
            else
            {
                MessageBox.Show(docreadresp.response.Message);
                return;
            }

            root = docreadresp.document;
            //



            ControllerUtils.ListInTree(tvLinkedDocuments, docoList, root);
            tvLinkedDocuments.ExpandAll();
        }