Пример #1
0
        // ------------------------------------------
        //            List Documents
        // ------------------------------------------
        public void loadDocumentList()
        {
            // Image list
            //
            ImageList imageList = ControllerUtils.GetImageList();

            // Binding
            tvProjectPlanDoco.ImageList = imageList;

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

            var docoList = new DocumentList();

            docoList.List();

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

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

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

            // Using Business Layer

            root = BUSDocument.GetRootDocument();

            DocumentList.ListInTree(tvProjectPlanDoco, docoList, root);
            tvProjectPlanDoco.ExpandAll();
        }
Пример #2
0
        public void loadDocumentList(int documentSetUID = 0)
        {
            // Image list
            //
            ImageList imageList = ControllerUtils.GetImageList();

            // Binding
            tvFileList.ImageList = imageList;

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

            var docoList = new DocumentList();

            docoList.ListDocSet(documentSetUID);

            // Load document in the treeview
            //
            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(tvFileList, docoList, root);
            tvFileList.Nodes[0].Expand();
        }
Пример #3
0
        // ------------------------------------------
        //            List Documents
        // ------------------------------------------
        public void loadDocumentList(HeaderInfo headerInfo)
        {
            // Image list
            //
            imageList16           = ControllerUtils.GetImageList();
            imageList16.ImageSize = new Size(16, 16);

            imageList32           = ControllerUtils.GetImageList();
            imageList32.ImageSize = new Size(32, 32);

            // Binding
            tvFileList.ImageList = imageList16;

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

            var docoList = new DocumentList();

            if (cbxType.Text == "FCM")
            {
                docoList.List();
            }
            else
            {
                docoList.ListClient(Utils.ClientID);
            }

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

            // root.GetRoot(headerInfo);

            //root = RepDocument.GetRoot(HeaderInfo.Instance);

            root = BUSDocument.GetRootDocument();

            DocumentList.ListInTree(tvFileList, docoList, root);
            tvFileList.Nodes[0].Expand();

            GetValuesFromCache();

            tvFileList.Refresh();
        }
Пример #4
0
        /// <summary>
        /// Associate documents from selected document set to selected client
        /// </summary>
        /// <param name="clientUID"></param>
        /// <param name="clientDocumentSetUID"></param>
        /// <param name="documentSetUID"></param>
        public static void AssociateDocumentsToClient(
            ClientDocumentSet clientDocumentSet,
            int documentSetUID,
            HeaderInfo headerInfo)
        {
            // It is a new client document set
            // It maybe a new client, the client document set MUST be new or empty
            // 1) Instantiate a TREE for the Client Document Set document
            // 2) Instantiate a second tree for the documents related to that document set
            // 3) Now the old copy all starts, all the nodes from the second tree are moved to the new tree
            //    following current process
            // 4) Save happens as per usual
            //

            TreeView tvFileList           = new TreeView();               // This is the list of documents for a client, it should be EMPTY
            TreeView tvDocumentsAvailable = new TreeView();               // This is the list of documents for a client, it should be EMPTY
            string   folderOnly           = clientDocumentSet.FolderOnly; // Contains the folder location of the file

            // Add root folder
            //
            ClientDocument clientDocument = new ClientDocument();

            clientDocument.AddRootFolder(clientDocumentSet.FKClientUID, clientDocumentSet.ClientSetID, clientDocumentSet.FolderOnly);

            // List client document list !!!!!!! Important because the ROOT folder is loaded ;-)

            var documentSetList = new ClientDocument();

            documentSetList.List(clientDocumentSet.FKClientUID, clientDocumentSet.ClientSetID);

            tvFileList.Nodes.Clear();
            documentSetList.ListInTree(tvFileList, "CLIENT");
            if (tvFileList.Nodes.Count > 0)
            {
                tvFileList.Nodes[0].Expand();
            }

            // Load available documents
            //
            tvDocumentsAvailable.Nodes.Clear();

            // Get document list for a given document set
            //
            DocumentSet documentSet = new DocumentSet();

            documentSet.UID = documentSetUID;
            documentSet.Read(IncludeDocuments: 'Y');

            // Load document in the treeview
            //
            Document.Document root = new Document.Document();
            root.GetRoot(headerInfo);

            DocumentList.ListInTree(tvDocumentsAvailable, documentSet.documentList, root);

            while (tvDocumentsAvailable.Nodes[0].Nodes.Count > 0)
            {
                TreeNode tn = tvDocumentsAvailable.Nodes[0].Nodes[0];
                tn.Remove();

                tvFileList.Nodes[0].Nodes.Add(tn);
            }

            tvFileList.SelectedNode = tvFileList.Nodes[0];

            // -------------------------------------------------------------------
            // The documents have been moved from the available to client's tree
            // Now it is time to save the documents
            // -------------------------------------------------------------------
            Save(clientDocumentSet, documentSetUID, tvFileList);

            ClientDocumentLink cloneLinks = new ClientDocumentLink();

            cloneLinks.ReplicateDocSetDocLinkToClient(clientDocumentSet.FKClientUID, clientDocumentSet.ClientSetID, documentSetUID);
        }