Ejemplo n.º 1
0
 public void InizializeTree()
 {
     try
     {
         string idAmm = UserManager.getInfoUtente().idAmministrazione;
         Amministrazione.Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();
         if (!string.IsNullOrEmpty(idAmm))
         {
             theManager.ListaUOLivelloZero(idAmm);
             if (theManager.getListaUO() != null && theManager.getListaUO().Count > 0)
             {
                 this.btn_find.Attributes.Add("onclick", js_function + "('" + idAmm + "');");
                 this.LoadTreeviewLivelloZero(theManager.getListaUO());
             }
         }
         else
         {
             this.lbl_avviso.Text = "Attenzione! l'amministrazione corrente non risulta essere presente nel database.<br><br>Effettuare il Chiudi e trasmetti.";
         }
     }
     catch
     {
         this.lbl_avviso.Text = "Attenzione! si è verificato un errore";
     }
 }
Ejemplo n.º 2
0
        public void RicercaNodo(string returnValue, string tipo)
        {
            try
            {
                //this.hd_returnValueModal.Value = "";
                string[] appo          = returnValue.Split('_');
                string   idCorrGlobale = appo[0];
                string   idParent      = appo[1];
                if (string.IsNullOrEmpty(tipo))
                {
                    tipo = this.ddl_ricTipo.SelectedValue;
                }
                string idAmm = UserManager.getInfoUtente().idAmministrazione;
                Amministrazione.Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();
                theManager.ListaUOLivelloZero(idAmm);
                this.LoadTreeviewLivelloZero(theManager.getListaUO());
                theManager.ListaIDParentRicerca(idParent, tipo);
                if (theManager.getListaIDParentRicerca() != null && theManager.getListaIDParentRicerca().Count > 0)
                {
                    ArrayList lista = new ArrayList();
                    theManager.getListaIDParentRicerca().Reverse();
                    lista = theManager.getListaIDParentRicerca();
                    lista.Add(Convert.ToInt32(idCorrGlobale));

                    for (int n = 1; n <= lista.Count - 1; n++)
                    {
                        OrganigrammaTreeNode TreeNodo;
                        TreeNodo = (OrganigrammaTreeNode)this.treeView.GetNodeFromIndex(treeView.SelectedNodeIndex);
                        foreach (OrganigrammaTreeNode nodo in TreeNodo.Nodes)
                        {
                            if (nodo.ID.Equals(lista[n].ToString()) && nodo.ID != idCorrGlobale)
                            {
                                if (nodo.getTipoNodo().Equals("U"))
                                {
                                    this.LoadTreeViewLivelloFigli(nodo.GetNodeIndex(), nodo.getTipoNodo());
                                }
                                else
                                {
                                    nodo.Expanded = true;
                                }
                                treeView.SelectedNodeIndex = nodo.GetNodeIndex();
                                break;
                            }
                            if (nodo.ID.Equals(lista[n].ToString()) && nodo.ID.Equals(idCorrGlobale))
                            {
                                treeView.SelectedNodeIndex = nodo.GetNodeIndex();
                                break;
                            }
                        }
                    }
                }
                this.hd_returnValueModal.Value = "";
            }
            catch
            {
                this.lbl_avviso.Text = "Attenzione! si è verificato un errore";
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Visualizza come nodo Root la UO di livello 0
        /// </summary>
        private void VisualizzaNodoRoot()
        {
            string idCorrGlob = string.Empty;

            Amministrazione.Manager.OrganigrammaManager manager = new Amministrazione.Manager.OrganigrammaManager();
            manager.ListaUOLivelloZero(this.hd_idAmm.Value);
            ArrayList lista = manager.getListaUO();

            if (lista != null && lista.Count > 0)
            {
                foreach (DocsPAWA.DocsPaWR.OrgUO uo in lista)
                {
                    idCorrGlob = uo.IDCorrGlobale;
                }

                this.VisualizzaNodoRicercato(idCorrGlob + "_0_U");
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Inizializzazione
        /// </summary>
        private void Inizialize()
        {
            try
            {
                Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();
                theManager.ListaUOLivelloZero(this.hd_idAmm.Value);

                if (theManager.getListaUO() != null && theManager.getListaUO().Count > 0)
                {
                    this.btn_find.Attributes.Add("onclick", "ApriRisultRic('" + this.hd_idAmm.Value + "');");
                    this.LoadTreeviewLivelloZero(theManager.getListaUO());
                    this.SetFocus(this.txt_ricDesc);
                }
                else
                {
                    this.executeJS("<SCRIPT>alert('Attenzione, nessun organigramma presente'); window.close();</SCRIPT>");
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Ricerca il nodo in Treeview
        /// </summary>
        /// <param name="returnValue"></param>
        private void RicercaNodo(string returnValue)
        {
            bool       finded         = false;
            myTreeNode TreeNodoFinded = new myTreeNode();

            try
            {
                this.hd_returnValueModal.Value = "";

                string[] appo = returnValue.Split('_');

                string idCorrGlobale = appo[0];
                string idParent      = appo[1];

                string tipo = this.ddl_ricTipo.SelectedValue;

                Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();
                theManager.ListaUOLivelloZero(this.hd_idAmm.Value);

                this.LoadTreeviewLivelloZero(theManager.getListaUO());

                this.SelezionaPrimo();

                theManager.ListaIDParentRicerca(idParent, tipo);

                if (theManager.getListaIDParentRicerca() != null && theManager.getListaIDParentRicerca().Count > 0)
                {
                    ArrayList lista = new ArrayList();
                    theManager.getListaIDParentRicerca().Reverse();
                    lista = theManager.getListaIDParentRicerca();

                    lista.Add(Convert.ToInt32(idCorrGlobale));

                    for (int n = 1; n <= lista.Count - 1; n++)
                    {
                        myTreeNode TreeNodo;
                        TreeNodo = (myTreeNode)treeViewUO.GetNodeFromIndex(treeViewUO.SelectedNodeIndex);

                        foreach (myTreeNode nodo in TreeNodo.Nodes)
                        {
                            if (nodo.ID.Equals(lista[n].ToString()) && nodo.ID != idCorrGlobale)
                            {
                                if (nodo.getTipoNodo().Equals("U"))
                                {
                                    this.LoadTreeViewLivelloFigli(nodo.GetNodeIndex(), nodo.getTipoNodo());
                                }
                                else
                                {
                                    nodo.Expanded = true;
                                }
                                treeViewUO.SelectedNodeIndex = nodo.GetNodeIndex();
                                break;
                            }
                            if (nodo.ID.Equals(lista[n].ToString()) && nodo.ID.Equals(idCorrGlobale))
                            {
                                treeViewUO.SelectedNodeIndex = nodo.GetNodeIndex();
                                finded         = true;
                                TreeNodoFinded = nodo;
                                break;
                            }
                        }
                    }

                    if (finded && !this.GetReadOnly())
                    {
                        this.TornaAllaWndChiamante(TreeNodoFinded);
                    }
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }