private void botonBorrar_Click(object sender, System.Web.UI.ImageClickEventArgs e) { TreeNode Nodo = vistaPaginas.GetNodeFromIndex(vistaPaginas.SelectedNodeIndex); PaginasBD.Borrar(Int32.Parse(Nodo.NodeData)); Response.Redirect(Request.RawUrl, true); }
private void tvSection_Expand(object sender, TreeViewClickEventArgs e) { TreeNode node = tvSection.GetNodeFromIndex(e.Node); if (node.Nodes.Count == 0) { if (node.NodeData.IndexOf("Section") == 0) { AddSectionMembers(node); } else if (node.NodeData.IndexOf("USects") == 0) { AddUserSections(node); } else if (node.NodeData.IndexOf("UGrous") == 0) { AddUserGroups(node); } else if (node.NodeData.IndexOf("GrouAsst") == 0) { AddAsstGroups(node); } else if (node.NodeData.IndexOf("Group") == 0) { AddGroupMembers(node); } else if (node.NodeData.IndexOf("AsstG") == 0) { AddAllAsstGroups(node); } } }
/// <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>"); } }
public void UpdateRubric() { TreeNode node = tvRubric.GetNodeFromIndex(tvRubric.SelectedNodeIndex); Rubrics rubda = new Rubrics(Globals.CurrentIdentity); Rubric rub = rubda.GetInfo(GetRubricID(node)); node.Text = GetResultPoints(rub); TreeNode root = tvRubric.Nodes[0]; rub = rubda.GetInfo(GetRubricID(root)); root.Text = String.Format("Total - {0}/{1} Points", new Submissions(Globals.CurrentIdentity).GetPoints(GetSubID()), rub.Points); }
protected void Page_Load(object sender, EventArgs e) { // Response.Expires = -1; Response.Cache.SetCacheability(HttpCacheability.NoCache); getParameterUser(); string idFascicolo = Request.QueryString["idfascicolo"]; string desc = Request.QueryString["desc"]; if (this.Page.Session["azione"] != null && this.Page.Session["azione"].ToString() == "ricerca") { string idFolderSel = Request.QueryString["idFolder"]; if (string.IsNullOrEmpty(idFolderSel) && Folders != null) { idFolderSel = Folders.GetNodeFromIndex(Folders.SelectedNodeIndex).ID; } CaricaDati(idFascicolo); foreach (Microsoft.Web.UI.WebControls.TreeNode node in this.Folders.Nodes) { cerca(idFolderSel, node); } Session.Remove("azione"); //CaricaDatiRicerca(idFascicolo, idFolderSel); //Session.Remove("azione"); } else { if (!IsPostBack) { CaricaDati(idFascicolo); if (!string.IsNullOrEmpty(desc)) { cerca(desc); } } } }
private Microsoft.Web.UI.WebControls.TreeNode getSelectedNodeFolder() { Microsoft.Web.UI.WebControls.TreeNode nodeToSelect; if (this.Page.Session["fascDettagliFasc.nodoSelezionato"] != null) { nodeToSelect = (Microsoft.Web.UI.WebControls.TreeNode) this.Page.Session["fascDettagliFasc.nodoSelezionato"]; } else { if (Folders.Nodes.Count > 0) { nodeToSelect = Folders.GetNodeFromIndex(Folders.SelectedNodeIndex); } else { nodeToSelect = null; } this.Page.Session["fascDettagliFasc.nodoSelezionato"] = nodeToSelect; } return(nodeToSelect); }
public void LoadFormatView(DataSet zonefiles, string imgPrefix) { tvFormat.Nodes.Clear(); DataTable inodes = zonefiles.Tables["File"]; Hashtable dirHash = new Hashtable(); foreach (DataRow row in inodes.Rows) { string type = (string)row["type"]; string fullPath = (string)row["name"]; string dirName = Path.GetDirectoryName(fullPath); string itemName = Path.GetFileName(fullPath); if (itemName == ".") { TreeNode root = AddFolderNode(tvFormat.Nodes, ".", imgPrefix); dirHash["."] = root; } else { if (type == "dir") { dirHash[fullPath] = AddFolderNode(((TreeNode)dirHash[dirName]).Nodes, itemName, imgPrefix); } else { AddFileNode(((TreeNode)dirHash[dirName]).Nodes, itemName, imgPrefix); } } } TreeNode curnode = tvFormat.GetNodeFromIndex(tvFormat.SelectedNodeIndex); SyncToolbar(curnode); txtFileName.Text = curnode.Text; }
/// <summary> /// chiude nodo /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TreeView1_Collapse_1(object sender, Microsoft.Web.UI.WebControls.TreeViewClickEventArgs e) { try { Microsoft.Web.UI.WebControls.TreeNode nodoFiglio; Microsoft.Web.UI.WebControls.TreeNode TreeNodo; TreeNodo = TreeView1.GetNodeFromIndex(e.Node); if (e.Node != "0") { if (TreeNodo.Nodes.Count > 0) { TreeNodo.Nodes.Clear(); } nodoFiglio = new Microsoft.Web.UI.WebControls.TreeNode(); nodoFiglio.Text = "<font color='#ff0000'> loading...</font>"; TreeNodo.Nodes.Add(nodoFiglio); } } catch { lbl_msg.Text = "Attenzione! si è verificato un errore di caricamento della pagina."; } }
protected bool cmdPaste_ButtonClick(object sender, EventArgs ea) { TreeNode destnode; ClipBoard cb; FileSystem fs; cb = (ClipBoard)ViewState["clipboard"]; if (cb == null) { DisplayMessage("Clipboard empty. You must cut/copy files before pasting has an effect"); return(true); } fs = new FileSystem(Globals.CurrentIdentity); destnode = tvFiles.GetNodeFromIndex(tvFiles.SelectedNodeIndex); CFile dest = fs.GetFile((string)ViewState["gridpath"]); try { if (cb.Move) { fs.MoveFiles(dest, cb.Files, false); } else { fs.CopyFiles(dest, cb.Files, false); } } catch (FileOperationException e) { DisplayMessage(e.Message); return(false); } UpdateTreeNode(destnode, true); BindFileGrid(); ViewState["clipboard"] = null; BindClipBoard(); return(true); }
private int getIndexTitolarioSelezionato() { int idClass = 0; Microsoft.Web.UI.WebControls.TreeNode nodoSel = Titolario.GetNodeFromIndex(Titolario.SelectedNodeIndex); //verifico l'esistenza di un nodo dell'albero dei titolari selezionato if (nodoSel != null) { idClass = Int32.Parse(nodoSel.ID); } else { idClass = 0; } return(idClass); }
/// <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'> 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>"); } }
private void TestTreeView_SelectedIndexChange(object sender, Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs e) { // Set the currently selected node... Session["SelectedNode"] = e.NewNode; // Expand the tree nodes before performing a selection... this.ExpandTreeNodes( ); TreeNode selectedNode = TestTreeView.GetNodeFromIndex(e.NewNode); // Need to make sure that the currently selected node really is the // selected node... this.SetSelectedNode( ); if (selectedNode.Type == "Area") { this.ShowSelectedAreaInformation(selectedNode); } else { this.ShowSelectedTestInformation(selectedNode.ID); } // Clear out any visible error messages... ErrorMessage.Text = ""; }
public static string GetSelectedPath(Microsoft.Web.UI.WebControls.TreeView tv, string index) { Microsoft.Web.UI.WebControls.TreeNode node; node = tv.GetNodeFromIndex(index); return(node.ID); }