Exemple #1
0
        public static int checkExsistNode(Page page, ref DocsPaWR.Folder folderRoot, string descFolder, string key = null, string componentType = null)
        {
            bool   dacreare      = true;
            string idFolderAdded = string.Empty;
            int    result        = 0;

            for (int i = 0; i < folderRoot.childs.Length; i++)
            {
                if (descFolder == folderRoot.childs[i].descrizione)
                {
                    folderRoot = folderRoot.childs[i];
                    result     = 4;
                    dacreare   = false;
                }
            }
            if (dacreare)
            {
                ResultCreazioneFolder resultFold = new ResultCreazioneFolder();
                //crea folder
                DocsPaWR.Folder cartella = new Folder();
                cartella.descrizione = descFolder;
                cartella.idFascicolo = folderRoot.idFascicolo;
                cartella.idParent    = folderRoot.systemID;
                UIManager.ProjectManager.newFolder(page, ref cartella, UIManager.UserManager.GetInfoUser(), UIManager.UserManager.GetSelectedRole(), out resultFold);

                folderRoot = cartella;

                if (resultFold.ToString() == "OK")
                {
                    result = 3;
                }
                if (resultFold.ToString() == "FOLDER_EXIST")
                {
                    result = 4;
                }

                if (!String.IsNullOrEmpty(componentType) && componentType.Equals(Constans.TYPE_SOCKET))
                {
                    setSessionMapIdFolders(key, cartella.systemID);
                }
                else
                {
                    HttpContext.Current.Session["idFolderAdded"] = idFolderAdded;
                }
            }
            return(result);
        }
Exemple #2
0
        public static int checkExsistNode(Page page, ref DocsPaWR.Folder folderRoot, string descFolder)
        {
            bool dacreare = true;

            int result = 0;

            for (int i = 0; i < folderRoot.childs.Length; i++)
            {
                if (descFolder == folderRoot.childs[i].descrizione)
                {
                    folderRoot = folderRoot.childs[i];
                    result     = 4;
                    dacreare   = false;
                }
            }
            if (dacreare)
            {
                ResultCreazioneFolder resultFold = new ResultCreazioneFolder();
                //crea folder
                DocsPaWR.Folder cartella = new Folder();
                cartella.descrizione = descFolder;
                cartella.idFascicolo = folderRoot.idFascicolo;
                cartella.idParent    = folderRoot.systemID;
                FascicoliManager.newFolder(page, ref cartella, UserManager.getInfoUtente(page), UserManager.getRuolo(page), out resultFold);

                folderRoot = cartella;

                if (resultFold.ToString() == "OK")
                {
                    result = 3;
                }
                if (resultFold.ToString() == "FOLDER_EXIST")
                {
                    result = 4;
                }
            }
            return(result);
        }