Ejemplo n.º 1
0
        // populate the folders as tree nodes
        private CustomTreeNode createNodes(Folder folder) {

            // first create the root node
            CustomTreeNode node = new CustomTreeNode();
            node.Name = folder.name;
            node.Text = folder.name;
            node.fieldType = folder.type;
            node.fieldId = folder.id;

            // check for the child folders and call this method again
            // it will be a self loop method
            FolderDao folderDao = new FolderDao();
            List<Folder> childFolders = folderDao.getChildFolders(node.fieldId);
            if (childFolders.Count > 0)
            {
                foreach (var childFolder in childFolders)
                {
                    CustomTreeNode childNode = createNodes(childFolder);
                    node.Nodes.Add(childNode);
                }
            }
            return node;
        }       
Ejemplo n.º 2
0
        // Fetch all the wits of the folder
        private void getFolderWitsThread(Folder folder)
        {
            RestClientWits restWits = new RestClientWits();
            WitsDao witsDao = new WitsDao();


            List<Wits> wits = restWits.getFolderWits(folder.id);
            if (wits != null && wits.Count > 0)
            {
                witsDao.saveAllWits(wits);
            }

        }