Exemplo n.º 1
0
        /// <summary>
        /// treeDepData点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeDepData_NodeSelected(object sender, TreeViewClickEventArgs e)
        {
            // string ID = treeDepData.SelectedNode.Value;
            string ID = e.Value;

            switch (Convert.ToInt32(ID.Split(',')[0]))
            {
            case (int)TreeMode.dep:
                frmDepartmentDetail frm = new frmDepartmentDetail();
                frm.D_ID = ID.Split(',')[1];
                Show(frm, (MobileForm form, object args) =>
                {
                    if (frm.ShowResult == ShowResult.Yes)
                    {
                        Mode = DepartmentMode.层级;
                        Bind();
                    }
                });
                break;

            case (int)TreeMode.user:
                frmUserDetail frmUserDetail = new frmUserDetail();
                frmUserDetail.U_ID = ID.Split(',')[1];
                Show(frmUserDetail);
                break;
            }
        }
Exemplo n.º 2
0
    private void TVResource_Expand(object sender, TreeViewClickEventArgs e)
    {
        TreeNode nodeFromIndex = this.TVResource.GetNodeFromIndex(e.Node.ToString());

        nodeFromIndex.Nodes.Clear();
        this.TVResource_AppendNode(nodeFromIndex.Nodes, nodeFromIndex.ID);
    }
Exemplo n.º 3
0
        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);
                }
            }
        }
Exemplo n.º 4
0
        private void treeAssetType_NodePress(object sender, TreeViewClickEventArgs e)
        {
            try
            {
                ID       = e.Value;  //所选资产分类编号
                TypeName = e.Text;   //所选资产分类名称
                foreach (TreeViewNode node1 in treeAssetType.Nodes)
                {
                    node1.TextColor = Color.Black;
                    if (node1.Nodes.Count > 0)
                    {
                        foreach (TreeViewNode node2 in node1.Nodes)
                        {
                            node2.TextColor = Color.Black;
                            if (node2.Nodes.Count > 0)
                            {
                                foreach (TreeViewNode node3 in node2.Nodes)
                                {
                                    node3.TextColor = Color.Black;
                                }
                            }
                        }
                    }
                }

                //把当前项颜色变化下
                TreeViewNode node = e.Nodes;
                node.TextColor = Color.DodgerBlue;
                Close();
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Exemplo n.º 5
0
        protected void Folders_Expand(object sender, TreeViewClickEventArgs e)
        {
            try
            {
                if (e.Node != "0")
                {
                    Microsoft.Web.UI.WebControls.TreeNode TreeNodo;
                    TreeNodo = (Microsoft.Web.UI.WebControls.TreeNode)Folders.GetNodeFromIndex(e.Node);

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

                    this.LoadTreeViewLivelloFigli(e.Node, TreeNodo.ID);

                    Folders.SelectedNodeIndex = e.Node;
                }
                else
                {
                    Microsoft.Web.UI.WebControls.TreeNode TreeNodo;
                    TreeNodo = (Microsoft.Web.UI.WebControls.TreeNode)Folders.GetNodeFromIndex(e.Node);
                    CaricaDati(TreeNodo.ID);
                }
            }
            catch
            {
            }
        }
Exemplo n.º 6
0
    private void TVDept_Expand(object sender, TreeViewClickEventArgs e)
    {
        TreeNode nodeFromIndex = this.TVDept.GetNodeFromIndex(e.Node.ToString());

        nodeFromIndex.NodeData = "1";
        if (nodeFromIndex.Nodes.Count == 1)
        {
            nodeFromIndex.Nodes.Remove(nodeFromIndex.Nodes[0]);
            this.TVDept_AppendNode(nodeFromIndex.Nodes, System.Convert.ToInt32(nodeFromIndex.ID));
        }
    }
Exemplo n.º 7
0
 private void treeAssetsType_NodePress(object sender, TreeViewClickEventArgs e)
 {
     if (IsCreate)
     {
         ((frmAssetsCreate)Form).btnType.Tag  = e.Value;   //所选资产分类编号
         ((frmAssetsCreate)Form).btnType.Text = e.Text;    //所选资产分类名称
     }
     else
     {
         ((frmAssetsDetailEdit)Form).btnType.Tag  = e.Value;  //所选资产分类编号
         ((frmAssetsDetailEdit)Form).btnType.Text = e.Text;   //所选资产分类名称
     }
     this.Close();
 }
Exemplo n.º 8
0
        protected void trvNodiTitolario_Expand1(object sender, TreeViewClickEventArgs e)
        {
            try
            {
                if (e.Node != "0")
                {
                    TreeNodeTitolario selectedNode = this.GetNodeFromIndex(e.Node);

                    this.FillTreeNodes(selectedNode, this.getRegistroSelezionato());

                    this.trvNodiTitolario.SelectedNodeIndex = selectedNode.GetNodeIndex();

                    this.abilitazioneTasti();

                    selectedNode = null;
                }
            }
            catch
            {
                this.ShowErrorMessage("Si è verificato un errore durante l'esecuzione di questa operazione.");
            }
        }
Exemplo n.º 9
0
        private void tvSection_Check(object sender, TreeViewClickEventArgs e)
        {
            TreeNode node     = tvSection.GetNodeFromIndex(e.Node);
            Users    users    = new Users(Globals.CurrentIdentity);
            int      courseID = Convert.ToInt32(HttpContext.Current.Request.Params["CourseID"]);

            string[] tokens;

            if (node.NodeData.IndexOf("Uname") == 0)
            {
                tokens = node.NodeData.Split(" ".ToCharArray());
                int       pid   = users.GetInfo(tokens[1], null).PrincipalID;
                ArrayList prins = Principals;
                if (node.Checked)
                {
                    prins.Add(pid);
                }
                else
                {
                    prins.Remove(pid);
                }

                Principals = prins;
            }
            else if (node.NodeData.IndexOf("Group") == 0)
            {
                tokens = node.NodeData.Split(" ".ToCharArray());
                int       pid   = Convert.ToInt32(tokens[1]);
                ArrayList prins = Principals;
                if (node.Checked)
                {
                    prins.Add(pid);
                }
                else
                {
                    prins.Remove(pid);
                }

                Principals = prins;
            }
            else if (node.NodeData.IndexOf("Uallusers") == 0)
            {
                User.UserList mems  = new Courses(Globals.CurrentIdentity).GetMembers(courseID, null);
                ArrayList     prins = Principals;

                foreach (TreeNode cnode in node.Nodes)
                {
                    cnode.Checked = node.Checked;
                }

                foreach (User mem in mems)
                {
                    if (node.Checked)
                    {
                        prins.Add(mem.PrincipalID);
                    }
                    else
                    {
                        prins.Remove(mem.PrincipalID);
                    }
                }

                node.Expanded = true;
                Principals    = prins;
            }
            else if (node.NodeData.IndexOf("Section") == 0)
            {
                tokens = node.NodeData.Split(" ".ToCharArray());
                User.UserList susers = (new Sections(Globals.CurrentIdentity)).GetMembers(
                    Convert.ToInt32(tokens[1]));

                if (node.Nodes.Count == 0)
                {
                    AddSectionMembers(node);
                }

                foreach (TreeNode cnode in node.Nodes)
                {
                    cnode.Checked = node.Checked;
                }

                ArrayList prins = Principals;
                foreach (User user in susers)
                {
                    if (node.Checked)
                    {
                        prins.Add(user.PrincipalID);
                    }
                    else
                    {
                        prins.Remove(user.PrincipalID);
                    }
                }

                node.Expanded = true;
                Principals    = prins;
            }
        }
Exemplo n.º 10
0
 private void treeAssetsType_NodePress(object sender, TreeViewClickEventArgs e)
 {
     typeId   = e.Value;     //所选资产分类编号
     typeName = e.Text;      //所选资产分类名称
 }
Exemplo n.º 11
0
        /// <summary>
        /// Espande i figli del nodo Root
        /// </summary>
        private void SetRootTreeviewExpanded()
        {
            TreeViewClickEventArgs e = new TreeViewClickEventArgs("0");

            this.treeViewUO_Expand(null, e);
        }
Exemplo n.º 12
0
 /// <summary>
 /// 选择资产
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void treeAssetsType_NodePress(object sender, TreeViewClickEventArgs e)
 {
     ID           = e.Value; //所选资产分类编号
     lblName.Text = e.Text;  //所选资产分类名称
 }
Exemplo n.º 13
0
        protected void tvFiles_Expand(object sender, TreeViewClickEventArgs e)
        {
            TreeNode selnode = tvFiles.GetNodeFromIndex(e.Node);

            UpdateTreeNode(selnode, false);
        }