Пример #1
0
        /// <summary>
        /// Visualizza gli utenti di un ruolo
        /// </summary>
        /// <param name="nodoRuoli"></param>
        /// <param name="ruolo"></param>
        private void UtentiRuolo(myTreeNode2 nodoRuoli, DocsPaWR.OrgRuolo ruolo)
        {
            myTreeNode2 nodoUtenti;

            nodoRuoli.Expanded = true;

            foreach (DocsPaWR.OrgUtente utente in ruolo.Utenti)
            {
                nodoUtenti = new myTreeNode2();

                nodoUtenti.ID       = utente.IDCorrGlobale;
                nodoUtenti.TipoNodo = "P";
                nodoUtenti.Text     = utente.CodiceRubrica + " - " + utente.Cognome + " " + utente.Nome;
                nodoUtenti.ImageUrl = this.getElementType(nodoUtenti.TipoNodo);
                nodoUtenti.Expanded = true;

                nodoRuoli.ChildNodes.Add(nodoUtenti);
            }
        }
Пример #2
0
        protected void treeViewUO_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
        {
            DocsPaWR.OrgUO    currentUO;
            DocsPaWR.OrgRuolo currentRole;

            myTreeNode2 TreeNodo = (myTreeNode2)e.Node;

            TreeNodo.Expanded = true;

            if (TreeNodo.ChildNodes.Count > 0)
            {
                TreeNodo.ChildNodes.Clear();
            }

            switch (TreeNodo.TipoNodo)
            {
            case "U":

                currentUO = new DocsPaWR.OrgUO();
                currentUO.IDCorrGlobale     = TreeNodo.ID;
                currentUO.IDAmministrazione = this.idAmm;
                currentUO.Ruoli             = TreeNodo.RuoliUO;
                currentUO.SottoUo           = TreeNodo.SottoUO;
                currentUO.Livello           = TreeNodo.Livello;

                if (this.ddlView.SelectedIndex >= 1 && Convert.ToInt32(currentUO.Ruoli) > 0)
                {
                    this.RuoliUO(currentUO, TreeNodo);
                }

                if (Convert.ToInt32(currentUO.SottoUo) > 0)
                {
                    this.SottoUO(currentUO, TreeNodo);
                }

                break;

            // Gabriele Melini
            // bug gestione ruoli organigramma
            case "R":

                currentRole = new DocsPaWR.OrgRuolo();

                OrganigrammaManager manager = new OrganigrammaManager();
                currentRole = manager.GetRole(TreeNodo.ID);
                manager.ListaUtenti(currentRole.IDGruppo);

                if (manager.getListaUtenti() != null && manager.getListaUtenti().Count > 0)
                {
                    DocsPaWR.OrgUtente[] utenti = (DocsPaWR.OrgUtente[])manager.getListaUtenti().ToArray(typeof(DocsPaWR.OrgUtente));
                    currentRole.Utenti = utenti;

                    if (this.ddlView.SelectedValue == "3" && currentRole.Utenti.Length > 0)
                    {
                        this.UtentiRuolo(TreeNodo, currentRole);
                    }
                }

                break;
            }
        }