Example #1
0
        private void ParentHasChanged()
        {
            var x = cbxDocument.Text;

            if (string.IsNullOrEmpty(x))
            {
                return;
            }

            string[] doco = x.Split(';');
            parentDocument.UID = Convert.ToInt32(doco[0]);
            // parentDocument.Read();

            //parentDocument = RepDocument.Read(false, parentDocument.UID);

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

            documentReadRequest.UID  = parentDocument.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;
            }

            parentDocument = docreadresp.document;
            //

            // Get document set
            if (string.IsNullOrEmpty(cbxDocumentSet.Text))
            {
                documentSetUID = 1;
            }
            else
            {
                var docSetUID = cbxDocumentSet.Text;

                string[] docoSet = docSetUID.Split(';');
                // The first is the client id, the second is the document set id
                //
                documentSetUID = Convert.ToInt32(docoSet[1]);
            }

            ClientDocumentLinkList list = ClientDocumentLinkList.ListRelatedDocuments(
                selectedClient.UID,
                documentSetUID,
                parentDocument.UID,
                cbxLinkType.Text);

            loadLinkedDocuments(parentDocument);
        }
Example #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 = 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();
        }