Exemplo n.º 1
0
        /// <summary>
        /// Imposta la Root nella Treeview
        /// </summary>
        /// <param name="currentUO"></param>
        /// <returns></returns>
        private myTreeNode SetRootTreeview(DocsPAWA.DocsPaWR.OrgUO currentUO)
        {
            this.PulisceTuttaTreeView();

            myTreeNode treenode = new myTreeNode();

            treenode.ID   = currentUO.IDCorrGlobale;
            treenode.Text = currentUO.Codice + " - " + currentUO.Descrizione;

            treeViewUO.Nodes.Add(treenode);

            treenode.setTipoNodo("U");
            treenode.setRuoliUO(currentUO.Ruoli);
            treenode.setSottoUO(currentUO.SottoUo);
            treenode.setLivello(currentUO.Livello);

            return(treenode);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Visualizza le sotto UO
        /// </summary>
        /// <param name="currentUO"></param>
        /// <param name="indice"></param>
        /// <returns></returns>
        private bool SottoUO(DocsPAWA.DocsPaWR.OrgUO currentUO, string indice)
        {
            bool retValue = true;

            myTreeNode TreeNodo;
            myTreeNode TreeNodoFiglio;

            if (indice != null)
            {
                TreeNodo = (myTreeNode)treeViewUO.GetNodeFromIndex(indice);
            }
            else
            {
                TreeNodo = (myTreeNode)treeViewUO.GetNodeFromIndex(treeViewUO.SelectedNodeIndex);
            }

            myTreeNode nodoUO;

            ArrayList lista = new ArrayList();

            int livello = Convert.ToInt32(currentUO.Livello) + 1;

            Amministrazione.Manager.OrganigrammaManager manager = new Amministrazione.Manager.OrganigrammaManager();
            manager.ListaUO(currentUO.IDCorrGlobale, Convert.ToString(livello), currentUO.IDAmministrazione);
            lista = manager.getListaUO();

            if (lista != null && lista.Count > 0)
            {
                if (!this.isOrdinamentoAbilitato())
                {
                    lista.Sort(new UOSort());
                }

                foreach (DocsPAWA.DocsPaWR.OrgUO sottoUO in lista)
                {
                    nodoUO = new myTreeNode();

                    nodoUO.ID       = sottoUO.IDCorrGlobale;
                    nodoUO.Text     = sottoUO.CodiceRubrica + " - " + sottoUO.Descrizione;
                    nodoUO.ImageUrl = HttpFullPath + "/AdminTool/Images/uo.gif";

                    TreeNodo.Nodes.Add(nodoUO);

                    nodoUO.setTipoNodo("U");
                    nodoUO.setRuoliUO(sottoUO.Ruoli);
                    nodoUO.setSottoUO(sottoUO.SottoUo);
                    nodoUO.setLivello(sottoUO.Livello);

                    if ((this.GetTipoNavigazione() > 1 && Convert.ToInt32(sottoUO.Ruoli) > 0) || Convert.ToInt32(sottoUO.SottoUo) > 0)
                    {
                        TreeNodoFiglio      = new myTreeNode();
                        TreeNodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                        nodoUO.Nodes.Add(TreeNodoFiglio);
                    }
                }
            }
            else
            {
                retValue = false;
            }

            return(retValue);
        }