Exemple #1
0
        // Remove document from selected list
        //
        private void RemoveDocument()
        {
            TreeNode tn = new TreeNode();

            tn = tvLinkedDocuments.SelectedNode;

            var nodeType = tn.Tag.GetType().Name;

            if (nodeType == "Document")
            {
                Document doc = new Document();
                doc = (Document)tn.Tag;

                DocumentSetDocumentLink dl = new DocumentSetDocumentLink();

                // Logically delete the record if the record is commited.
                if (dl.Read(documentSetUID, SelectedParentDocumentUID, doc.UID, cbxLinkType.Text))
                {
                    dl.Delete(dl.UID);
                }

                tn.Remove();
            }

            if (nodeType == "DocumentSetDocumentLink")
            {
                var doc = new DocumentSetDocumentLink();
                doc = (DocumentSetDocumentLink)tn.Tag;

                DocumentSetDocumentLink dl = new DocumentSetDocumentLink();

                // Logically delete the record if the record is commited.
                if (dl.Read(documentSetUID, SelectedParentDocumentUID, doc.FKChildDocumentUID, cbxLinkType.Text))
                {
                    dl.Delete(dl.UID);
                }

                tn.Remove();
            }
        }