コード例 #1
0
        /// <summary>
        /// treeViewUO_Collapse
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewUO_Collapse(object sender, Microsoft.Web.UI.WebControls.TreeViewClickEventArgs e)
        {
            try
            {
                if (e.Node != "0")
                {
                    myTreeNode TreeNodo;
                    TreeNodo = (myTreeNode)treeViewUO.GetNodeFromIndex(e.Node);

                    Microsoft.Web.UI.WebControls.TreeNode nodoFiglio;

                    if (TreeNodo.getTipoNodo().Equals("U"))
                    {
                        if (TreeNodo.Nodes.Count > 0)
                        {
                            TreeNodo.Nodes.Clear();
                        }

                        nodoFiglio      = new Microsoft.Web.UI.WebControls.TreeNode();
                        nodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                        TreeNodo.Nodes.Add(nodoFiglio);
                    }

                    if (this.GetReadOnly())
                    {
                        treeViewUO.SelectedNodeIndex = e.Node;
                    }
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }
コード例 #2
0
        /// <summary>
        /// treeViewUO_Expand
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewUO_Expand(object sender, Microsoft.Web.UI.WebControls.TreeViewClickEventArgs e)
        {
            try
            {
                if (e.Node != "0")
                {
                    myTreeNode TreeNodo;
                    TreeNodo = (myTreeNode)treeViewUO.GetNodeFromIndex(e.Node);

                    if (TreeNodo.getTipoNodo().Equals("U"))
                    {
                        if (TreeNodo.Nodes.Count > 0)
                        {
                            TreeNodo.Nodes.Clear();
                        }

                        this.LoadTreeViewLivelloFigli(e.Node, TreeNodo.getTipoNodo());
                    }

                    if (this.GetReadOnly())
                    {
                        treeViewUO.SelectedNodeIndex = e.Node;
                    }
                }
                else
                {
                    this.Inizialize();
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }
コード例 #3
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>");
            }
        }
コード例 #4
0
        private void treeViewUO_Collapse(object sender, Microsoft.Web.UI.WebControls.TreeViewClickEventArgs e)
        {
            try
            {
                if (e.Node != "0")
                {
                    OrganigrammaTreeNode TreeNodo;
                    TreeNodo = (OrganigrammaTreeNode)treeView.GetNodeFromIndex(e.Node);

                    Microsoft.Web.UI.WebControls.TreeNode nodoFiglio;

                    if (TreeNodo.getTipoNodo().Equals("U"))
                    {
                        if (TreeNodo.Nodes.Count > 0)
                        {
                            TreeNodo.Nodes.Clear();
                        }

                        nodoFiglio      = new Microsoft.Web.UI.WebControls.TreeNode();
                        nodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                        TreeNodo.Nodes.Add(nodoFiglio);
                    }
                    treeView.SelectedNodeIndex = e.Node;
                }
            }
            catch
            {
                this.lbl_avviso.Text = "Attenzione! si è verificato un errore";
            }
        }
コード例 #5
0
        private void treeViewUO_Expand(object sender, Microsoft.Web.UI.WebControls.TreeViewClickEventArgs e)
        {
            try
            {
                if (e.Node != "0")
                {
                    OrganigrammaTreeNode TreeNodo;
                    TreeNodo = (OrganigrammaTreeNode)treeView.GetNodeFromIndex(e.Node);

                    if (TreeNodo.getTipoNodo().Equals("U"))
                    {
                        if (TreeNodo.Nodes.Count > 0)
                        {
                            TreeNodo.Nodes.Clear();
                        }

                        this.LoadTreeViewLivelloFigli(e.Node, TreeNodo.getTipoNodo());
                    }
                    treeView.SelectedNodeIndex = e.Node;
                }
                else
                {
                    this.InizializeTree();
                }
            }
            catch
            {
                this.lbl_avviso.Text = "Attenzione! si è verificato un errore";
            }
        }
コード例 #6
0
        protected void treeViewSelezioni_SelectedIndexChange(object sender, Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs e)
        {
            myTreeNode TreeNodo;

            TreeNodo = (myTreeNode)treeViewSelezioni.GetNodeFromIndex(e.NewNode);
            string tipoNodo = TreeNodo.getTipoNodo();

            if (tipoNodo == "U")
            {
                Response.Write("<script>window.returnValue='" + TreeNodo.ID + "'; window.close();</script>");
            }
        }
コード例 #7
0
        /// <summary>
        /// Caricamento dati UO livelli figli
        /// </summary>
        /// <param name="indice"></param>
        /// <param name="tipoNodo"></param>
        private void LoadTreeViewLivelloFigli(string indice, string tipoNodo)
        {
            try
            {
                string myPath = DocsPAWA.Utils.getHttpFullPath(this);

                if (this.GetReadOnly())
                {
                    treeViewUO.SelectedNodeIndex = indice;
                }

                ArrayList lista = new ArrayList();

                myTreeNode TreeNodo;
                TreeNodo          = (myTreeNode)treeViewUO.GetNodeFromIndex(indice);
                TreeNodo.Expanded = true;

                if (TreeNodo.Nodes.Count > 0)
                {
                    TreeNodo.Nodes.RemoveAt(0);
                }

                myTreeNode nodoRuoli;
                myTreeNode nodoUtenti;
                myTreeNode nodoUO;
                myTreeNode nodoFiglio;

                Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();

                theManager.ListaRuoliUO(TreeNodo.getIDCorrGlobale());

                if (this.GetTipoNavigazione() > 1)
                {
                    lista = theManager.getListaRuoliUO();

                    // ... ruoli
                    if (lista != null && lista.Count > 0)
                    {
                        foreach (DocsPAWA.DocsPaWR.OrgRuolo ruolo in lista)
                        {
                            nodoRuoli = new myTreeNode();

                            nodoRuoli.ID       = ruolo.IDCorrGlobale;
                            nodoRuoli.Text     = ruolo.CodiceRubrica + " - " + ruolo.Descrizione;
                            nodoRuoli.ImageUrl = myPath + "/AdminTool/Images/ruolo.gif";

                            TreeNodo.Nodes.Add(nodoRuoli);

                            nodoRuoli.setTipoNodo("R");
                            nodoRuoli.setIDCorrGlobale(ruolo.IDCorrGlobale);
                            nodoRuoli.setIDTipoRuolo(ruolo.IDTipoRuolo);
                            nodoRuoli.setIDGruppo(ruolo.IDGruppo);
                            nodoRuoli.setCodice(ruolo.Codice);
                            nodoRuoli.setCodiceRubrica(ruolo.CodiceRubrica);
                            nodoRuoli.setDescrizione(ruolo.Descrizione);
                            nodoRuoli.setIDAmministrazione(ruolo.IDAmministrazione);

                            // ... utenti
                            if (ruolo.Utenti.Length > 0)
                            {
                                if (this.GetTipoNavigazione() > 2)
                                {
                                    foreach (DocsPAWA.DocsPaWR.OrgUtente utente in ruolo.Utenti)
                                    {
                                        nodoUtenti = new myTreeNode();

                                        nodoUtenti.ID       = utente.IDCorrGlobale;
                                        nodoUtenti.Text     = utente.CodiceRubrica + " - " + utente.Cognome + " " + utente.Nome;
                                        nodoUtenti.ImageUrl = myPath + "/AdminTool/Images/utente.gif";

                                        nodoRuoli.Nodes.Add(nodoUtenti);

                                        nodoUtenti.setTipoNodo("P");
                                        nodoUtenti.setIDCorrGlobale(utente.IDCorrGlobale);
                                        nodoUtenti.setIDPeople(utente.IDPeople);
                                        nodoUtenti.setCodice(utente.Codice);
                                        nodoUtenti.setCodiceRubrica(utente.CodiceRubrica);
                                        nodoUtenti.setIDAmministrazione(utente.IDAmministrazione);
                                    }
                                }
                            }                             // fine inserimento utenti
                            else
                            {
                                nodoRuoli.Text = ruolo.CodiceRubrica + " - " + ruolo.Descrizione;
                            }
                        }                         // fine inserimento ruoli
                    }
                }


                // ... uo sottostanti
                int livello = Convert.ToInt32(TreeNodo.getLivello()) + 1;

                theManager.ListaUO(TreeNodo.getIDCorrGlobale(), livello.ToString(), TreeNodo.getIDAmministrazione());
                lista = theManager.getListaUO();

                if (lista != null && lista.Count > 0)
                {
                    foreach (DocsPAWA.DocsPaWR.OrgUO sub_uo in lista)
                    {
                        nodoUO = new myTreeNode();

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

                        TreeNodo.Nodes.Add(nodoUO);

                        nodoUO.setTipoNodo("U");
                        nodoUO.setIDCorrGlobale(sub_uo.IDCorrGlobale);
                        nodoUO.setCodice(sub_uo.Codice);
                        nodoUO.setCodiceRubrica(sub_uo.CodiceRubrica);
                        nodoUO.setDescrizione(sub_uo.Descrizione);
                        nodoUO.setLivello(sub_uo.Livello);
                        nodoUO.setIDAmministrazione(sub_uo.IDAmministrazione);

                        if ((!sub_uo.Ruoli.Equals("0")) || (!sub_uo.SottoUo.Equals("0")))
                        {
                            nodoFiglio      = new myTreeNode();
                            nodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                            nodoUO.Nodes.Add(nodoFiglio);
                        }
                        else
                        {
                            nodoUO.Text = sub_uo.CodiceRubrica + " - " + sub_uo.Descrizione;
                        }
                    }                     // fine inserimento uo sottostanti
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }
コード例 #8
0
        private void LoadTreeViewLivelloFigli(string indice, string tipoNodo)
        {
            try
            {
                treeView.SelectedNodeIndex = indice;
                OrganigrammaTreeNode TreeNodo;
                TreeNodo          = (OrganigrammaTreeNode)treeView.GetNodeFromIndex(indice);
                TreeNodo.Expanded = true;
                if (TreeNodo.Nodes.Count > 0)
                {
                    TreeNodo.Nodes.RemoveAt(0);
                }
                OrganigrammaTreeNode nodoRuoli;
                OrganigrammaTreeNode nodoUtenti;
                OrganigrammaTreeNode nodoUO;
                OrganigrammaTreeNode nodoFiglio;
                Amministrazione.Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();
                theManager.ListaRuoliUO(TreeNodo.getIDCorrGlobale());
                ArrayList lista = new ArrayList();
                lista = theManager.getListaRuoliUO();
                // ... ruoli
                if (lista != null && lista.Count > 0)
                {
                    foreach (DocsPAWA.DocsPaWR.OrgRuolo ruolo in lista)
                    {
                        nodoRuoli          = new OrganigrammaTreeNode();
                        nodoRuoli.ID       = ruolo.IDCorrGlobale;
                        nodoRuoli.Text     = ruolo.CodiceRubrica + " - " + ruolo.Descrizione;
                        nodoRuoli.ImageUrl = httpFullPath + "/AdminTool/Images/ruolo.gif";

                        TreeNodo.Nodes.Add(nodoRuoli);

                        nodoRuoli.setTipoNodo("R");
                        nodoRuoli.setIDCorrGlobale(ruolo.IDCorrGlobale);
                        nodoRuoli.setIDTipoRuolo(ruolo.IDTipoRuolo);
                        nodoRuoli.setIDGruppo(ruolo.IDGruppo);
                        nodoRuoli.setCodice(ruolo.Codice);
                        nodoRuoli.setCodiceRubrica(ruolo.CodiceRubrica);
                        nodoRuoli.setDescrizione(ruolo.Descrizione);
                        nodoRuoli.setDiRiferimento(ruolo.DiRiferimento);
                        nodoRuoli.setIDAmministrazione(ruolo.IDAmministrazione);
                        nodoRuoli.setPercorso(TreeNodo.getPercorso() + ruolo.Descrizione + " &gt; ");
                        nodoRuoli.setResponsabile(ruolo.Responsabile);
                        // ... utenti
                        if (ruolo.Utenti.Length > 0)
                        {
                            foreach (DocsPAWA.DocsPaWR.OrgUtente utente in ruolo.Utenti)
                            {
                                nodoUtenti          = new OrganigrammaTreeNode();
                                nodoUtenti.ID       = utente.IDCorrGlobale;
                                nodoUtenti.Text     = utente.CodiceRubrica + " - " + utente.Cognome + " " + utente.Nome;
                                nodoUtenti.ImageUrl = httpFullPath + "/AdminTool/Images/utente.gif";
                                nodoRuoli.Nodes.Add(nodoUtenti);
                                nodoUtenti.setTipoNodo("P");
                                nodoUtenti.setIDCorrGlobale(utente.IDCorrGlobale);
                                nodoUtenti.setIDPeople(utente.IDPeople);
                                nodoUtenti.setCodice(utente.Codice);
                                nodoUtenti.setCodiceRubrica(utente.CodiceRubrica);
                                nodoUtenti.setIDAmministrazione(utente.IDAmministrazione);
                            }
                        } // fine inserimento utenti
                        else
                        {
                            nodoRuoli.Text = ruolo.CodiceRubrica + " - " + ruolo.Descrizione;
                        }
                    } // fine inserimento ruoli
                }

                // ... uo sottostanti
                int livello = Convert.ToInt32(TreeNodo.getLivello()) + 1;

                theManager.ListaUO(TreeNodo.getIDCorrGlobale(), livello.ToString(), TreeNodo.getIDAmministrazione());
                lista = theManager.getListaUO();

                if (lista != null && lista.Count > 0)
                {
                    foreach (DocsPAWA.DocsPaWR.OrgUO sub_uo in lista)
                    {
                        nodoUO          = new OrganigrammaTreeNode();
                        nodoUO.ID       = sub_uo.IDCorrGlobale;
                        nodoUO.Text     = sub_uo.CodiceRubrica + " - " + sub_uo.Descrizione;
                        nodoUO.ImageUrl = httpFullPath + "/AdminTool/Images/uo.gif";
                        TreeNodo.Nodes.Add(nodoUO);
                        nodoUO.setTipoNodo("U");
                        nodoUO.setIDCorrGlobale(sub_uo.IDCorrGlobale);
                        nodoUO.setCodice(sub_uo.Codice);
                        nodoUO.setCodiceRubrica(sub_uo.CodiceRubrica);
                        nodoUO.setDescrizione(sub_uo.Descrizione);
                        nodoUO.setLivello(sub_uo.Livello);
                        nodoUO.setIDAmministrazione(sub_uo.IDAmministrazione);
                        nodoUO.setCodRegInterop(sub_uo.CodiceRegistroInterop);
                        nodoUO.setPercorso(TreeNodo.getPercorso() + sub_uo.Descrizione + " &gt; ");

                        if ((!sub_uo.Ruoli.Equals("0")) || (!sub_uo.SottoUo.Equals("0")))
                        {
                            nodoFiglio      = new OrganigrammaTreeNode();
                            nodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                            nodoUO.Nodes.Add(nodoFiglio);
                        }
                        else
                        {
                            nodoUO.Text = sub_uo.CodiceRubrica + " - " + sub_uo.Descrizione;
                        }
                    } // fine inserimento uo sottostanti
                }
            }
            catch
            {
                lbl_messaggio.Text = "Attenzione! si è verificato un errore";
            }
        }
コード例 #9
0
        /// <summary>
        /// carica nodi figli della treeview
        /// </summary>
        /// <param name="indice"></param>
        private void LoadTreeViewChild(string indice)
        {
            try
            {
                TreeView1.SelectedNodeIndex = indice;

                myTreeNode TreeNodo;
                TreeNodo          = (myTreeNode)TreeView1.GetNodeFromIndex(indice);
                TreeNodo.Expanded = true;

                if (TreeNodo.Nodes.Count > 0)
                {
                    TreeNodo.Nodes.RemoveAt(0);
                }

                myTreeNode nodoT;
                myTreeNode nodoFiglio;

                string idParent = TreeNodo.getIDRECORD();

                DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                string xmlStream;

                DocsPaWR.Registro rg = UserManager.getRegistroSelezionato(this.Page);
                DocsPaWR.Ruolo    ru = UserManager.getRuolo(this.Page);

                string idAmm      = ru.idAmministrazione;
                string idGruppo   = ru.idGruppo;
                string idRegistro = rg.systemId;

                xmlStream = ws.NodoTitolarioSecurity(idAmm, idParent, idGruppo, idRegistro, idTitolario);


                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xmlStream);

                XmlNode lista = doc.SelectSingleNode("NewDataSet");
                if (lista.ChildNodes.Count > 0)
                {
                    foreach (XmlNode nodo in lista.ChildNodes)
                    {
                        nodoT      = new myTreeNode();
                        nodoT.ID   = nodo.SelectSingleNode("CODICE").InnerText;
                        nodoT.Text = nodo.SelectSingleNode("CODICE").InnerText + " - " + nodo.SelectSingleNode("DESCRIZIONE").InnerText;

                        TreeNodo.Nodes.Add(nodoT);

                        nodoT.setIDRECORD(nodo.SelectSingleNode("IDRECORD").InnerText);
                        nodoT.setPARENT(nodo.SelectSingleNode("IDPARENT").InnerText);
                        nodoT.setCODLIV(nodo.SelectSingleNode("CODLIV").InnerText);
                        nodoT.setCODICE(nodo.SelectSingleNode("CODICE").InnerText);
                        nodoT.setDESCRIZIONE(nodo.SelectSingleNode("DESCRIZIONE").InnerText);
                        nodoT.setLIVELLO(nodo.SelectSingleNode("LIVELLO").InnerText);
                        nodoT.setNUMMESICONSERVAZIONE(nodo.SelectSingleNode("NUMMESICONSERVAZIONE").InnerText);
                        XmlNode nodoReg = nodo.SelectSingleNode("REGISTRO");
                        if (nodoReg != null)
                        {
                            nodoT.setREGISTRO(nodo.SelectSingleNode("REGISTRO").InnerText);
                        }

                        if (Convert.ToInt32(nodo.SelectSingleNode("FIGLIO").InnerText) > 0)
                        {
                            nodoFiglio      = new myTreeNode();
                            nodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                            nodoT.Nodes.Add(nodoFiglio);
                        }
                    }
                }
            }
            catch
            {
                lbl_msg.Text = "Attenzione! si è verificato un errore di caricamento della pagina.";
            }
        }