Exemplo n.º 1
0
        // ------------------------------------------
        //            List Documents
        // ------------------------------------------
        public void loadDocumentList()
        {
            // Image list
            //
            ImageList imageList = ControllerUtils.GetImageList();

            // Binding
            tvListOfDocuments.ImageList = imageList;

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

            var docoList = new DocumentList();

            docoList.List();

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

            root.CUID       = "ROOT";
            root.RecordType = FCMConstant.RecordType.FOLDER;
            root.UID        = 0;
            // root.Read();

            //root = RepDocument.Read(false, 0, "ROOT");

            root = BUSDocument.GetRootDocument();

            DocumentList.ListInTree(tvListOfDocuments, docoList, root);
            tvListOfDocuments.ExpandAll();
        }
Exemplo n.º 2
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 = DocumentSetDocumentLinkList.ListRelatedDocuments(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, document.CUID);

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

            documentReadRequest.UID  = document.UID;
            documentReadRequest.CUID = document.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;
            //


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