예제 #1
0
        /// <summary>
        /// Visualizza partendo dalla UO selezionata in Treeview
        /// </summary>
        private void VisualizzaUOSelezionata()
        {
            try
            {
                if (this.treeViewUO.SelectedNode != null)
                {
                    myTreeNode2 TreeNodo;
                    TreeNodo = (myTreeNode2)this.treeViewUO.SelectedNode;

                    if (TreeNodo.TipoNodo.Equals("U")) // solo se è una UO
                    {
                        DocsPaWR.OrgUO currentUO = this.GetDatiUOCorrente(TreeNodo.ID);
                        if (currentUO != null)
                        {
                            // diventa la ROOT della treeview
                            myTreeNode2 treenode = new myTreeNode2();
                            treenode = this.SetRootTreeview(currentUO);

                            this.SetRootTreeviewExpanded();

                            this.hd_lastReturnValueModal.Value = currentUO.IDCorrGlobale + "_" + currentUO.IDParent + "_U";
                        }
                    }
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('ErrorOrganizationChartSystemError', 'error', '');", true);
            }
        }
예제 #2
0
        /// <summary>
        /// Visualizza partendo dalla UO selezionata in Treeview
        /// </summary>
        private void VisualizzaUOSelezionata()
        {
            try
            {
                if (this.treeViewUO.SelectedNodeIndex != string.Empty || this.treeViewUO.SelectedNodeIndex != "")
                {
                    myTreeNode TreeNodo;
                    TreeNodo = (myTreeNode)treeViewUO.GetNodeFromIndex(treeViewUO.SelectedNodeIndex);

                    if (TreeNodo.getTipoNodo().Equals("U"))                    // solo se è una UO
                    {
                        DocsPaWR.OrgUO currentUO = this.GetDatiUOCorrente(TreeNodo.ID);
                        if (currentUO != null)
                        {
                            // diventa la ROOT della treeview
                            myTreeNode treenode = new myTreeNode();
                            treenode = this.SetRootTreeview(currentUO);

                            this.SetRootTreeviewExpanded();

                            this.ImpostaValoreDiRicercaNascosto(currentUO.IDCorrGlobale + "_" + currentUO.IDParent + "_U");
                        }
                    }
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }
예제 #3
0
        /// <summary>
        /// Esegue l'espansione del nodo
        /// </summary>
        /// <param name="indice"></param>
        private void executeExpand(myTreeNode2 TreeNodo)
        {
            DocsPaWR.OrgUO currentUO;

            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;
            }
        }
예제 #4
0
        /// <summary>
        /// Visualizza nella Treeview il dato ricercato
        /// </summary>
        /// <param name="returnValue"></param>
        private void VisualizzaNodoRicercato(string returnValue)
        {
            try
            {
                myTreeNode treenode;

                this.hd_returnValueModal.Value     = "";
                this.hd_lastReturnValueModal.Value = returnValue;

                /*
                 *      possibili valori di ritorno:
                 *
                 *              idCorrGlobUO_idParentUO_U					=	ricerca traUO
                 *              idCorrGlobRuolo_idCorrGlobUO_R				=	ricerca tra ruoli
                 *              idCorrGlobPersona_idCorrGlobRuolo_<PN>/<PC>	=	ricerca tra utenti
                 */

                string[] appo          = returnValue.Split('_');
                string   idCorrGlobale = appo[0];
                string   idParent      = appo[1];
                string   tipo          = appo[2];

                switch (tipo)
                {
                case "R":
                    idCorrGlobale = idParent;
                    break;

                case "PN":
                case "PC":
                    idCorrGlobale = this.GetUOPadre(idParent, tipo);
                    break;
                }

                DocsPaWR.OrgUO currentUO = this.GetDatiUOCorrente(idCorrGlobale);
                if (currentUO != null)
                {
                    // diventa la ROOT della treeview
                    treenode = new myTreeNode();
                    treenode = this.SetRootTreeview(currentUO);

                    this.SetRootTreeviewExpanded();
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }
예제 #5
0
        /// <summary>
        /// Visualizza nella Treeview il dato ricercato
        /// </summary>
        /// <param name="returnValue"></param>
        private void VisualizzaNodoRicercato(string returnValue)
        {
            try
            {
                myTreeNode2 treenode;

                this.hd_returnValueModal.Value     = "";
                this.hd_lastReturnValueModal.Value = returnValue;

                /*
                 *  possibili valori di ritorno:
                 *
                 *      idCorrGlobUO_idParentUO_U					=	ricerca traUO
                 *      idCorrGlobRuolo_idCorrGlobUO_R				=	ricerca tra ruoli
                 *      idCorrGlobPersona_idCorrGlobRuolo_<PN>/<PC>	=	ricerca tra utenti
                 */

                string[] appo          = returnValue.Split('_');
                string   idCorrGlobale = appo[0];
                string   idParent      = appo[1];
                string   tipo          = appo[2];

                switch (tipo)
                {
                case "R":
                    idCorrGlobale = idParent;
                    break;

                case "PN":
                case "PC":
                    idCorrGlobale = this.GetUOPadre(idParent, tipo);
                    break;
                }

                DocsPaWR.OrgUO currentUO = this.GetDatiUOCorrente(idCorrGlobale);
                if (currentUO != null)
                {
                    // diventa la ROOT della treeview
                    treenode = new myTreeNode2();
                    treenode = this.SetRootTreeview(currentUO);

                    this.SetRootTreeviewExpanded();
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('ErrorOrganizationChartSystemError', 'error', '');", true);
            }
        }
예제 #6
0
        /// <summary>
        /// Imposta la Root nella Treeview
        /// </summary>
        /// <param name="currentUO"></param>
        /// <returns></returns>
        private myTreeNode2 SetRootTreeview(DocsPaWR.OrgUO currentUO)
        {
            this.treeViewUO.Nodes.Clear();

            myTreeNode2 treenode = new myTreeNode2();

            treenode.ID       = currentUO.IDCorrGlobale;
            treenode.Text     = currentUO.Codice + " - " + currentUO.Descrizione;
            treenode.TipoNodo = "U";
            treenode.RuoliUO  = currentUO.Ruoli;
            treenode.SottoUO  = currentUO.SottoUo;
            treenode.Livello  = currentUO.Livello;
            treenode.ImageUrl = this.getElementType(treenode.TipoNodo);

            treeViewUO.Nodes.Add(treenode);

            return(treenode);
        }
예제 #7
0
        private void TornaAllaUOPadre()
        {
            if (this.treeViewUO.Nodes.Count > 0)
            {
                myTreeNode     nodoRoot  = (myTreeNode)this.treeViewUO.GetNodeFromIndex("0");
                DocsPaWR.OrgUO currentUO = this.GetDatiUOCorrente(nodoRoot.ID);
                if (currentUO != null && !currentUO.IDParent.Equals("0"))
                {
                    DocsPaWR.OrgUO UOpadre = this.GetDatiUOCorrente(currentUO.IDParent);
                    if (UOpadre != null)
                    {
                        // diventa la ROOT della treeview
                        myTreeNode treenode = new myTreeNode();
                        treenode = this.SetRootTreeview(UOpadre);

                        this.SetRootTreeviewExpanded();

                        this.ImpostaValoreDiRicercaNascosto(UOpadre.IDCorrGlobale + "_" + UOpadre.IDParent + "_U");
                    }
                }
            }
        }
예제 #8
0
 int IComparer.Compare(object x, object y)
 {
     DocsPaWR.OrgUO UoX = (DocsPAWA.DocsPaWR.OrgUO)x;
     DocsPaWR.OrgUO UoY = (DocsPAWA.DocsPaWR.OrgUO)y;
     return(UoX.Descrizione.CompareTo(UoY.Descrizione));
 }
예제 #9
0
        /// <summary>
        /// Visualizza le sotto UO
        /// </summary>
        /// <param name="currentUO"></param>
        /// <param name="indice"></param>
        /// <returns></returns>
        private bool SottoUO(DocsPaWR.OrgUO currentUO, myTreeNode2 TreeNodo)
        {
            bool retValue = true;

            myTreeNode2 TreeNodoFiglio;
            myTreeNode2 nodoUO;

            ArrayList lista = new ArrayList();

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

            OrganigrammaManager manager = new 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());
                }
                if (UIManager.UserManager.IsAuthorizedFunctions("DO_VIS_LIV_ORG"))
                {
                    foreach (DocsPaWR.OrgUO sottoUO in lista)
                    {
                        nodoUO = new myTreeNode2();

                        nodoUO.ID       = sottoUO.IDCorrGlobale;
                        nodoUO.TipoNodo = "U";
                        nodoUO.Text     = sottoUO.CodiceRubrica + " - [" + sottoUO.Livello + "] - " + sottoUO.Descrizione;
                        nodoUO.ImageUrl = this.getElementType(nodoUO.TipoNodo);
                        nodoUO.Expanded = false;

                        TreeNodo.ChildNodes.Add(nodoUO);

                        nodoUO.RuoliUO = sottoUO.Ruoli;
                        nodoUO.SottoUO = sottoUO.SottoUo;
                        nodoUO.Livello = sottoUO.Livello;

                        if ((int.Parse(this.ddlView.SelectedValue) > 1 && Convert.ToInt32(sottoUO.Ruoli) > 0) || Convert.ToInt32(sottoUO.SottoUo) > 0)
                        {
                            TreeNodoFiglio      = new myTreeNode2();
                            TreeNodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                            nodoUO.ChildNodes.Add(TreeNodoFiglio);
                        }
                    }
                }
                else
                {
                    foreach (DocsPaWR.OrgUO sottoUO in lista)
                    {
                        nodoUO = new myTreeNode2();

                        nodoUO.ID       = sottoUO.IDCorrGlobale;
                        nodoUO.TipoNodo = "U";
                        nodoUO.Text     = sottoUO.CodiceRubrica + " - " + sottoUO.Descrizione;
                        nodoUO.ImageUrl = this.getElementType(nodoUO.TipoNodo);
                        nodoUO.Expanded = false;

                        TreeNodo.ChildNodes.Add(nodoUO);

                        nodoUO.RuoliUO = sottoUO.Ruoli;
                        nodoUO.SottoUO = sottoUO.SottoUo;
                        nodoUO.Livello = sottoUO.Livello;

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

            return(retValue);
        }
예제 #10
0
        /// <summary>
        /// Visualizza i ruoli di una UO
        /// </summary>
        /// <param name="currentUO"></param>
        /// <param name="indice"></param>
        private void RuoliUO(DocsPaWR.OrgUO currentUO, myTreeNode2 TreeNodo)
        {
            myTreeNode2 nodoRuoli;

            OrganigrammaManager manager = new OrganigrammaManager();

            manager.ListaRuoliUO(currentUO.IDCorrGlobale);
            if (manager.getListaRuoliUO() != null && manager.getListaRuoliUO().Count > 0)
            {
                TreeNodo.Expanded = true;
                if (UIManager.UserManager.IsAuthorizedFunctions("DO_VIS_LIV_ORG"))
                {
                    OrgTipoRuolo[] lista = manager.getListaTipiRuolo();
                    foreach (DocsPaWR.OrgRuolo ruolo in manager.getListaRuoliUO())
                    {
                        // filtro per nuova gestione RF
                        if (this.visualizzaRuolo_filtroRF(ruolo.IDCorrGlobale))
                        {
                            //Modifica per visualizzare il codice del tipo ruolo
                            manager.ListaTipiRuolo(ruolo.IDAmministrazione);
                            OrgTipoRuolo[] elencoTipiRuolo = (OrgTipoRuolo[])manager.getListaTipiRuolo();
                            OrgTipoRuolo   tipoRuolo       = elencoTipiRuolo.Where(oggetto => oggetto.IDTipoRuolo.ToUpper().Equals(ruolo.IDTipoRuolo.ToUpper())).FirstOrDefault();


                            nodoRuoli          = new myTreeNode2();
                            nodoRuoli.ID       = ruolo.IDCorrGlobale;
                            nodoRuoli.Text     = ruolo.CodiceRubrica + " - [" + tipoRuolo.Livello + "] - " + ruolo.Descrizione;
                            nodoRuoli.TipoNodo = "R";
                            nodoRuoli.ImageUrl = this.getElementType(nodoRuoli.TipoNodo);
                            nodoRuoli.Expanded = true;

                            TreeNodo.ChildNodes.Add(nodoRuoli);

                            if (this.ddlView.SelectedValue == "3" && ruolo.Utenti.Length > 0)
                            {
                                this.UtentiRuolo(nodoRuoli, ruolo);
                            }
                        }
                    }
                }
                else
                {
                    foreach (DocsPaWR.OrgRuolo ruolo in manager.getListaRuoliUO())
                    {
                        // filtro per nuova gestione RF
                        if (this.visualizzaRuolo_filtroRF(ruolo.IDCorrGlobale))
                        {
                            nodoRuoli          = new myTreeNode2();
                            nodoRuoli.ID       = ruolo.IDCorrGlobale;
                            nodoRuoli.Text     = ruolo.CodiceRubrica + " - " + ruolo.Descrizione;
                            nodoRuoli.TipoNodo = "R";
                            nodoRuoli.ImageUrl = this.getElementType(nodoRuoli.TipoNodo);
                            nodoRuoli.Expanded = true;

                            TreeNodo.ChildNodes.Add(nodoRuoli);

                            if (this.ddlView.SelectedValue == "3" && ruolo.Utenti.Length > 0)
                            {
                                this.UtentiRuolo(nodoRuoli, ruolo);
                            }
                        }
                    }
                }
            }
        }
예제 #11
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;
            }
        }