Esempio n. 1
0
        protected void InitDictionary(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode, Window x)
        {
            ds = mDict.GetList("");
            System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]);
            //过滤ParentID,得到当前的所有子节点
            dvTree.RowFilter = "[ParentID]   =   '" + ParentID + "'";

            foreach (DataRowView Row in dvTree)
            {
                FineUI.TreeNode Node = new FineUI.TreeNode();
                Node.Text             = Row["DictionaryName"].ToString();
                Node.NodeID           = Row["id"].ToString();
                Node.Target           = Row["DictionaryValue"].ToString();
                Node.EnableCheckEvent = true;
                if (Node.NodeID != "2abe5d4e-3c71-43c0-83b0-a4e2b560aeb0")
                {
                    //Node.OnClientClick = x.GetShowReference("modify.aspx?id=" + Node.NodeID, "修改菜单",550,450);
                    Node.EnableClickEvent = true;
                }
                Node.Expanded = false;
                if (pNode == null)
                {
                    Node.Expanded         = true;
                    Node.EnableClickEvent = true;
                    treelist.Nodes.Add(Node);
                }
                else
                {
                    pNode.Nodes.Add(Node);
                }
                InitDictionary(Row["id"].ToString(), treelist, Node, x);//再次递归
            }
        }
Esempio n. 2
0
    /// <summary>
    /// 查询职员信息
    /// </summary>
    protected void btnFind_Click(object sender, EventArgs e)
    {
        ChangeTrackingList <EntitySearcher> changeTrackingList = new ChangeTrackingList <EntitySearcher>();
        EntitySearcher search = new EntitySearcher();

        search.Field    = "FlowName";
        search.Relation = "AND";
        search.Operator = "Like";
        search.Content  = txtFlowName.Text;
        changeTrackingList.Add(search);

        search          = new EntitySearcher();
        search.Field    = "FlowDesc";
        search.Relation = "AND";
        search.Operator = "Like";
        search.Content  = txtFlowDesc.Text;
        changeTrackingList.Add(search);

        FineUI.TreeNode node = tvwSort.SelectedNode;
        if (node != null && node.NodeID != "0")
        {
            search          = new EntitySearcher();
            search.Field    = "SortID";
            search.Relation = "AND";
            search.Operator = "=";
            search.Content  = tvwSort.SelectedNodeID;
            changeTrackingList.Add(search);
        }

        ViewState["sql"] = changeTrackingList;
        GridColumn column = flowGrid.FindColumn(flowGrid.SortColumn);

        flowGrid_Bind(changeTrackingList, column.SortField, flowGrid.SortDirection);
    }
Esempio n. 3
0
        private void InitSystem()
        {
            ds = GetMainListByAccountID(Session["AccountID"].ToString(), "00000000-0000-0000-0000-000000000000");
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    Tree t = new Tree();
                    t.EnableLines = true;
                    t.CssClass    = "treeCursor";
                    t.ShowHeader  = false;
                    t.Title       = ds.Tables[0].Rows[i]["MainName"].ToString();
                    t.Icon        = GetIcon(ds.Tables[0].Rows[i]["MainIcon"].ToString()).Icon;
                    t.AutoScroll  = true;
                    FineUI.TreeNode root = new FineUI.TreeNode();
                    root.Text     = ds.Tables[0].Rows[i]["MainName"].ToString();
                    root.Expanded = true;

                    t.Nodes.Add(root);
                    AddTree(t, ds.Tables[0].Rows[i]["id"].ToString(), root);

                    leftPanel.Items.Add(t);
                    //Region1.Items.Add(a);
                }
            }
        }
Esempio n. 4
0
        protected void InitAccountMain(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode)
        {
            ds = mm.GetList("");
            System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]);
            //过滤ParentID,得到当前的所有子节点
            dvTree.RowFilter = "[ParentID]   =   '" + ParentID + "'";

            foreach (DataRowView Row in dvTree)
            {
                FineUI.TreeNode Node = new FineUI.TreeNode();
                Node.Text     = Row["MainName"].ToString();
                Node.NodeID   = Row["id"].ToString();
                Node.Expanded = true;

                if (pNode == null)
                {
                    Node.Expanded = true;
                    treelist.Nodes.Add(Node);
                }
                else
                {
                    pNode.Nodes.Add(Node);
                }
                InitAccountMain(Row["id"].ToString(), treelist, Node);//再次递归
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 绑定菜单
        /// </summary>
        private void LoadData()
        {
            List <SeatManage.ClassModel.SysMenuInfo> listSysMenu = SeatManage.Bll.SysMenu.GetMenusList();

            if (listSysMenu != null)
            {
                foreach (SeatManage.ClassModel.SysMenuInfo list in listSysMenu)
                {
                    FineUI.TreeNode node = new FineUI.TreeNode();
                    node.NodeID         = list.MenuID.ToString();
                    node.Target         = list.MainNum;
                    node.Text           = list.MenuName;
                    node.Expanded       = true;
                    node.EnableCheckBox = true;
                    node.AutoPostBack   = true;
                    treeMenu.Nodes.Add(node);
                    foreach (SeatManage.ClassModel.SysMenuInfo listChild in list.ChildMenu)
                    {
                        FineUI.TreeNode nodeChild = new FineUI.TreeNode();
                        nodeChild.NodeID         = listChild.MenuID.ToString();
                        nodeChild.Text           = listChild.MenuName;
                        nodeChild.Target         = list.MainNum;
                        nodeChild.Expanded       = true;
                        nodeChild.EnableCheckBox = true;
                        nodeChild.AutoPostBack   = true;
                        node.Nodes.Add(nodeChild);
                    }
                }
            }
        }
Esempio n. 6
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            FineUI.TreeNode Node   = tvList.Nodes[0];
            string          ListID = SetTreeValue(Node);

            if (ListID.Contains(","))
            {
                ListID = ListID.Remove(ListID.LastIndexOf(","));
            }
            if (ListID == "")
            {
                Alert.ShowInParent("请选择要删除的项");
                return;
            }
            bool rs = manage.DeleteList(ListID);

            if (rs != false)
            {
                Alert.ShowInParent("保存成功。", string.Empty, ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                Alert.ShowInParent("提交失败");
            }
        }
Esempio n. 7
0
        protected void InitWebsite(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode, Window x)
        {
            ds = mWebSite.GetList("");
            System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]);
            //过滤ParentID,得到当前的所有子节点
            dvTree.RowFilter = "[ParentID]   =   '" + ParentID + "'";

            foreach (DataRowView Row in dvTree)
            {
                FineUI.TreeNode Node = new FineUI.TreeNode();
                Node.Text             = Row["WEBNAME"].ToString();
                Node.NodeID           = Row["id"].ToString();
                Node.EnableCheckEvent = true;
                Node.Expanded         = true;
                if (Node.NodeID != "A8C9876A-7ECB-495C-836A-EC69143A63DE")
                {
                    //Node.OnClientClick = x.GetShowReference("modify.aspx?id=" + Node.NodeID, "修改菜单",550,450);
                    Node.EnableClickEvent = true;
                    Node.Expanded         = true;
                }
                Node.Expanded = false;
                if (pNode == null)
                {
                    Node.Expanded         = true;
                    Node.EnableClickEvent = true;
                    treelist.Nodes.Add(Node);
                }
                else
                {
                    Node.Expanded = true;
                    pNode.Nodes.Add(Node);
                }
                InitWebsite(Row["id"].ToString(), treelist, Node, x);//再次递归
            }
        }
        /// <summary>读取数据</summary>
        public override void LoadData()
        {
            if (MenuTree.Nodes.Count == 0)
            {
                //创建树节点
                var tnode = new FineUI.TreeNode();
                //设置节点名称
                tnode.Text = "菜单";
                //设置节点ID
                tnode.NodeID = "0";
                //设置当前节点是否为最终节点
                tnode.Leaf = false;
                //是否自动扩大
                tnode.Expanded = true;

                //根据指定的父ID去查询相关的子集ID
                var dt = MenuInfoBll.GetInstence().GetDataTable();
                //从一级菜单开始添加
                AddNode(dt, tnode, "0");

                MenuTree.Nodes.Add(tnode);
            }

            BindGrid();
        }
Esempio n. 9
0
        public static void loadTreeSubMenuAuthorized(ref FineUI.TreeNode parentNode, int parentId, List <AutorizationList> applicationHierarchys)
        {
            var childs = applicationHierarchys.FindAll(p => p.I_ParentId == parentId);

            foreach (var item in childs)
            {
                FineUI.TreeNode child = new FineUI.TreeNode();
                child.Text    = item.V_Description;
                child.NodeID  = item.I_ApplicationHierarchyId.ToString();
                child.ToolTip = item.V_Description;
                if (child.NodeID == "2")
                {
                }
                else
                {
                    child.NavigateUrl = string.IsNullOrEmpty(item.V_Form) ? "" : item.V_Form;
                }

                child.Target = "main";

                parentNode.Nodes.Add(child);

                // Llamada recursiva
                loadTreeSubMenuAuthorized(ref child, item.I_ApplicationHierarchyId, applicationHierarchys);
            }
        }
Esempio n. 10
0
        protected void InitMainWithCheckBoxValue(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode)
        {
            ds = mm.GetList("");
            System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]);
            //过滤ParentID,得到当前的所有子节点
            dvTree.RowFilter = "[ParentID]   =   '" + ParentID + "'";

            foreach (DataRowView Row in dvTree)
            {
                FineUI.TreeNode Node = new FineUI.TreeNode();
                Node.Text             = Row["MainName"].ToString();
                Node.NodeID           = Row["id"].ToString();
                Node.Icon             = GetIcon(Row["MainIcon"].ToString()).Icon;
                Node.EnableCheckBox   = true;
                Node.Expanded         = false;
                Node.EnableCheckEvent = true;

                DataSet dt = new DataSet();
                dt = manage.GetList(" ROLEID= '" + Request["ID"].ToString() + "' AND  MAINID ='" + Node.NodeID + "'");
                if (dt.Tables[0].Rows.Count == 1)
                {
                    Node.Checked = true;
                }
                if (pNode == null)
                {
                    Node.Expanded = true;
                    treelist.Nodes.Add(Node);
                }
                else
                {
                    pNode.Nodes.Add(Node);
                }
                InitMainWithCheckBoxValue(Row["id"].ToString(), treelist, Node);//再次递归
            }
        }
Esempio n. 11
0
        private Tree InitTreeMenu()
        {
            Tree treeMenu = new Tree();

            treeMenu.ID           = "treeMenu";
            treeMenu.EnableArrows = true;
            treeMenu.ShowBorder   = false;
            treeMenu.ShowHeader   = false;
            treeMenu.EnableIcons  = false;
            treeMenu.AutoScroll   = true;
            Region2.Items.Add(treeMenu);

            int user_id = int.Parse(Session["UserID"].ToString());

            Web_Node node1 = new Web_Node();

            node1.NAME       = "Web";
            node1.INDEX_     = 2;
            node1.PINDEX     = 1;
            node1.SPECIES    = 8;
            node1.SPECIES_ID = 1;
            node1.CS         = 1;
            FineUI.TreeNode tnode = new FineUI.TreeNode();
            tnode.Text        = node1.NAME;
            tnode.NodeID      = node1.INDEX_.ToString();
            tnode.NavigateUrl = "javascript:void(0)";
            TreeHelper_Web.BuildUserWebTree(user_id, tnode, treeMenu);

            return(treeMenu);
        }
Esempio n. 12
0
 protected void btnSaveRefresh_Click(object sender, EventArgs e)
 {
     FineUI.TreeNode Node = MainList.Nodes[0];
     SetTreeValue(Node);
     //Alert.Show(ViewState["HTML"].ToString());
     Alert.ShowInParent("生成完毕。", string.Empty, ActiveWindow.GetHidePostBackReference());
 }
Esempio n. 13
0
        private void UpdateGlobal(FineUI.TreeNode treeNode, int pSystemUserId)
        {
            if (treeNode.Checked == true)
            {
                if (treeNode.CommandName != "1")
                {
                    var _applicationHierarchyId = Convert.ToInt32(treeNode.NodeID);
                    var _optionText             = treeNode.Text;

                    systemusergobalprofileDto _systemUserGlobalProfileDTO = new systemusergobalprofileDto();

                    _systemUserGlobalProfileDTO.i_ApplicationHierarchyId = _applicationHierarchyId;
                    _systemUserGlobalProfileDTO.i_SystemUserId           = pSystemUserId;
                    _systemUserGlobalProfileDTO.i_InsertUserId           = ((ClientSession)Session["objClientSession"]).i_SystemUserId;
                    _systemUserGlobalProfileDTO.d_InsertDate             = DateTime.Now;

                    // Cargar lista de permisos a actualizar
                    _listSystemUserGlobalProfileDtoUpdate.Add(_systemUserGlobalProfileDTO);
                }
            }

            foreach (FineUI.TreeNode tn in treeNode.Nodes)
            {
                UpdateGlobal(tn, pSystemUserId);
            }

            Session["objlistSystemUserGlobalProfileDtoUpdate"] = _listSystemUserGlobalProfileDtoUpdate;
        }
Esempio n. 14
0
        protected void InitWebsite(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode)
        {
            ds = mWebSite.GetList("");
            System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]);
            //过滤ParentID,得到当前的所有子节点
            dvTree.RowFilter = "[ParentID]   =   '" + ParentID + "'";

            foreach (DataRowView Row in dvTree)
            {
                FineUI.TreeNode Node = new FineUI.TreeNode();
                Node.Text             = Row["WEBNAME"].ToString();
                Node.NodeID           = Row["id"].ToString();
                Node.Expanded         = false;
                Node.EnableCheckEvent = true;
                if (pNode == null)
                {
                    Node.Expanded         = true;
                    Node.EnableCheckEvent = true;
                    treelist.Nodes.Add(Node);
                }
                else
                {
                    pNode.Nodes.Add(Node);
                }
                InitWebsite(Row["id"].ToString(), treelist, Node);//再次递归
            }
        }
Esempio n. 15
0
 /// <summary>
 /// ���캯��
 /// </summary>
 /// <param name="node">���ڵ�</param>
 /// <param name="commandName">��������</param>
 /// <param name="commandArgument">�������</param>
 public TreeCommandEventArgs(TreeNode node, string commandName, string commandArgument)
 {
     _node = node;
     _nodeID = node.NodeID;
     _commandName = commandName;
     _commandArgument = commandArgument;
 }
Esempio n. 16
0
        /// <summary>读取数据</summary>
        public override void LoadData()
        {
            if (BranchTree.Nodes.Count == 0)
            {
                //创建树节点
                var tnode = new FineUI.TreeNode();
                //设置节点名称
                tnode.Text = "部门";
                //设置节点ID
                tnode.NodeID = "0";
                //设置当前节点是否为最终节点
                tnode.Leaf = false;
                //是否自动扩大
                tnode.Expanded = true;

                //根据指定的父ID去查询相关的子集ID
                var dt = BranchBll.GetInstence().GetDataTable();
                //从一级菜单开始添加
                BranchBll.GetInstence().AddNode(dt, tnode, "0");

                BranchTree.Nodes.Add(tnode);
            }

            BindGrid();
        }
Esempio n. 17
0
        private void UpdateGlobal(FineUI.TreeNode treeNode)
        {
            if (treeNode.Checked == true)
            {
                if (treeNode.CommandName != "1")
                {
                    var applicationHierarchyId = Convert.ToInt32(treeNode.NodeID);

                    rolenodeprofileDto objRoleNodeProfileDto = new rolenodeprofileDto();

                    objRoleNodeProfileDto.i_NodeId = NodeId;
                    objRoleNodeProfileDto.i_RoleId = RoleId;
                    objRoleNodeProfileDto.i_ApplicationHierarchyId = applicationHierarchyId;
                    objRoleNodeProfileDto.i_InsertUserId           = ((ClientSession)Session["objClientSession"]).i_SystemUserId;

                    // Cargar lista de permisos a actualizar
                    _listRoleNodeProfileDtoUpdate.Add(objRoleNodeProfileDto);
                }
            }

            foreach (FineUI.TreeNode tn in treeNode.Nodes)
            {
                UpdateGlobal(tn);
            }

            Session["sobjRoleNodeProfileDtoUpdate"] = _listRoleNodeProfileDtoUpdate.Count == 0 ? null : _listRoleNodeProfileDtoUpdate;
        }
Esempio n. 18
0
        private void DeleteGlobal(FineUI.TreeNode treeNode)
        {
            if (_listRoleNodeProfileDtoDelete == null)
            {
                _listRoleNodeProfileDtoDelete = new List <rolenodeprofileDto>();
            }

            if (!treeNode.Checked)
            {
                if (treeNode.CommandName == "1")
                {
                    _listRoleNodeProfileDtoDelete.Add(new rolenodeprofileDto
                    {
                        i_NodeId = NodeId,
                        i_RoleId = RoleId,
                        i_ApplicationHierarchyId = Convert.ToInt32(treeNode.NodeID),
                    });
                }
            }

            foreach (FineUI.TreeNode tn in treeNode.Nodes)
            {
                DeleteGlobal(tn);
            }

            Session["sobjRoleNodeProfileDtoDelete"] = _listRoleNodeProfileDtoDelete.Count == 0 ? null : _listRoleNodeProfileDtoDelete;
        }
Esempio n. 19
0
    private void formGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        ChangeTrackingList <EntitySearcher> trackingList = new ChangeTrackingList <EntitySearcher>();

        foreach (EntitySearcher s in changeTrackingList)
        {
            trackingList.Add(s);
        }

        FineUI.TreeNode node = tvwSort.SelectedNode;
        if (node != null && node.NodeID != "0")
        {
            EntitySearcher search = new EntitySearcher();
            search.Field    = "TypeID";
            search.Relation = "AND";
            search.Operator = "=";
            search.Content  = tvwSort.SelectedNodeID;
            trackingList.Add(search);
        }

        formGrid.RecordCount = formBll.GetCount(trackingList);
        ExtBindingList <FineOffice.Modules.OA_Form> list = formBll.GetList(trackingList, this.formGrid.PageIndex, this.formGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        formGrid.DataSource = list;
        formGrid.DataBind();
    }
Esempio n. 20
0
        private void LoadTreeView()
        {
            string organizationId = ddlOrganization.SelectedValue;
            string locationId     = ddlLocation.SelectedValue;

            OperationResult objOperationResult = new OperationResult();
            var             objWarehouse       = Sigesoft.Server.WebClientAdmin.BLL
                                                 .Utils
                                                 .GetWarehouseByOrganizationAndLocationForTreeView(ref objOperationResult, organizationId, locationId);

            if (objWarehouse != null)
            {
                tvWarehouse.Nodes.Clear();
                FineUI.TreeNode nodePrimary = null;

                // armado del tree con todos los almacenes por organizaciones
                foreach (var item in objWarehouse)
                {
                    nodePrimary = new FineUI.TreeNode();
                    nodePrimary.EnableCheckBox = true;
                    nodePrimary.Text           = item.Value1;
                    nodePrimary.NodeID         = item.Id;
                    tvWarehouse.Nodes.Add(nodePrimary);
                }
            }
        }
Esempio n. 21
0
        private Accordion InitAccordionMenu()
        {
            int UserID = int.Parse(Session["UserID"].ToString());

            Accordion accordionMenu = new Accordion();

            accordionMenu.ID         = "accordionMenu";
            accordionMenu.EnableFill = true;
            accordionMenu.ShowBorder = false;
            accordionMenu.ShowHeader = false;
            Region2.Items.Add(accordionMenu);

            int user_id = int.Parse(Session["UserID"].ToString());

            Web_Node node1 = new Web_Node();

            node1.NAME       = "Web";
            node1.INDEX_     = 2;
            node1.PINDEX     = 1;
            node1.SPECIES    = 8;
            node1.SPECIES_ID = 1;
            node1.CS         = 1;
            FineUI.TreeNode tnode = new FineUI.TreeNode();
            tnode.Text        = node1.NAME;
            tnode.NodeID      = node1.INDEX_.ToString();
            tnode.NavigateUrl = "javascript:void(0)";

            TreeHelper_Web.BuildUserWebTree(user_id, tnode, accordionMenu);
            return(accordionMenu);
        }
Esempio n. 22
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     manage.Delete(Request["ID"].ToString());
     FineUI.TreeNode Node = tvList.Nodes[0];
     SetTreeValue(Node);
     Alert.ShowInParent("授权成功。", string.Empty, ActiveWindow.GetHidePostBackReference());
 }
Esempio n. 23
0
        public void AddTree(FineUI.Tree pcx, string ParentID, FineUI.TreeNode pNode)
        {
            btnUserName.Text = Session["AccountName"].ToString();
            dv = GetMainListByAccountID(Session["AccountID"].ToString(), ParentID);
            //dv = manage.GetUserMainList(ParentID, "f7f510c1-d10f-4bf4-ad13-941808a0d5ae");
            System.Data.DataView dvTree = new System.Data.DataView(dv.Tables[0]);
            //过滤ParentID,得到当前的所有子节点
            dvTree.RowFilter = "[ParentID]   =   '" + ParentID + "'";

            foreach (DataRowView Row in dvTree)
            {
                FineUI.TreeNode Node = new FineUI.TreeNode();
                Node.Text     = Row["MainName"].ToString();
                Node.Target   = Row["MainURL"].ToString();//Row["SystemURL"].ToString(); ;
                Node.Icon     = GetIcon(Row["MainIcon"].ToString()).Icon;
                Node.Expanded = true;
                if (Node.Target != "#")
                {
                    Node.Expanded      = true;
                    Node.OnClientClick = mainTabStrip.GetAddTabReference(Node.Text, Node.Target, Node.Text, IconHelper.GetIconUrl(GetIcon(Row["MainIcon"].ToString()).Icon), true);
                    Node.Icon          = GetIcon(Row["MainIcon"].ToString()).Icon;
                }
                pNode.Nodes.Add(Node);
                AddTree(pcx, Row["id"].ToString(), Node);//再次递归
            }
        }
Esempio n. 24
0
 protected void btnEnter_Click(object sender, EventArgs e)
 {
     if (tvwArea.SelectedNode != null)
     {
         FineUI.TreeNode node = tvwArea.SelectedNode;
         PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(node.Text, node.NodeID) + ActiveWindow.GetHideReference());
     }
 }
Esempio n. 25
0
        /// <summary>树控件(Tree)
        /// </summary>
        /// <param name="dataTable">DataTable数据源</param>
        /// <returns>树控件(Tree)</returns>
        public void BandingTree(DataTable dataTable)
        {
            try
            {
                //检查指定的列是否在数据源中能否找到
                if (dataTable.Rows.Count == 0)
                {
                    return;
                }
                //筛选出全部一级节点
                DataTable dtRoot = DataTableHelper.GetFilterData(dataTable, MenuInfoTable.ParentId, "0", MenuInfoTable.Sort, "Asc");
                //判断是否有节点存在
                if (dtRoot.Rows.Count != 0)
                {
                    //循环读取节点
                    foreach (DataRow dr in dtRoot.Rows)
                    {
                        //判断当前节点是否有权限访问,没有则跳过本次循环
                        //暂时先注释掉权限判断,等添加相关权限后再开启
                        if (_pagePower.IndexOf("," + dr[MenuInfoTable.Id].ToString() + ",") < 0)
                        {
                            continue;
                        }

                        //创建树节点
                        var treenode = new FineUI.TreeNode();
                        //设置节点ID
                        treenode.NodeID = dr[MenuInfoTable.Id].ToString();
                        //设置节点名称
                        treenode.Text = dr[MenuInfoTable.Name].ToString();
                        treenode.Target = "mainRegion";
                        //判断当前节点是否为最终节点
                        if (int.Parse(dr[MenuInfoTable.IsMenu].ToString()) != 0)
                        {
                            //设置节点链接地址,并在Url后面添加页面加密参数
                            treenode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "?" + MenuInfoBll.GetInstence().PageUrlEncryptString();
                            treenode.Leaf = true;
                        }
                        else
                        {
                            treenode.NavigateUrl = "";
                            treenode.Leaf = false;
                            //设置树节点收缩起来
                            treenode.Expanded = false;
                        }

                        //添加子节点
                        AddChildrenNode(dataTable, treenode, dr[MenuInfoTable.Id].ToString());
                        //将节点加入树列表中
                        leftMenuTree.Nodes.Add(treenode);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonBll.WriteLog("", ex);
            }
        }
Esempio n. 26
0
        /// <summary>树控件(Tree)
        /// </summary>
        /// <param name="dataTable">DataTable数据源</param>
        /// <returns>树控件(Tree)</returns>
        public void BandingTree(DataTable dataTable)
        {
            try
            {
                //检查指定的列是否在数据源中能否找到
                if (dataTable.Rows.Count == 0)
                {
                    return;
                }
                //筛选出全部一级节点
                DataTable dtRoot = DataTableHelper.GetFilterData(dataTable, MenuInfoTable.ParentId, "0", MenuInfoTable.Sort, "Asc");
                //判断是否有节点存在
                if (dtRoot.Rows.Count != 0)
                {
                    //循环读取节点
                    foreach (DataRow dr in dtRoot.Rows)
                    {
                        //判断当前节点是否有权限访问,没有则跳过本次循环
                        //暂时先注释掉权限判断,等添加相关权限后再开启
                        if (_pagePower.IndexOf("," + dr[MenuInfoTable.Id].ToString() + ",") < 0)
                        {
                            continue;
                        }

                        //创建树节点
                        var treenode = new FineUI.TreeNode();
                        //设置节点ID
                        treenode.NodeID = dr[MenuInfoTable.Id].ToString();
                        //设置节点名称
                        treenode.Text   = dr[MenuInfoTable.Name].ToString();
                        treenode.Target = "mainRegion";
                        //判断当前节点是否为最终节点
                        if (int.Parse(dr[MenuInfoTable.IsMenu].ToString()) != 0)
                        {
                            //设置节点链接地址,并在Url后面添加页面加密参数
                            treenode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "?" + MenuInfoBll.GetInstence().PageUrlEncryptString();
                            treenode.Leaf        = true;
                        }
                        else
                        {
                            treenode.NavigateUrl = "";
                            treenode.Leaf        = false;
                            //设置树节点收缩起来
                            treenode.Expanded = false;
                        }

                        //添加子节点
                        AddChildrenNode(dataTable, treenode, dr[MenuInfoTable.Id].ToString());
                        //将节点加入树列表中
                        leftMenuTree.Nodes.Add(treenode);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonBll.WriteLog("", ex);
            }
        }
Esempio n. 27
0
        private void SetTreeValue(FineUI.TreeNode pNode)
        {
            StringBuilder sb   = new StringBuilder();
            string        html = "";

            if (html.Length > 0)
            {
                html = "";
            }
            ds = new DataSet();
            ds = manage.GetSearchList("   CMS_WEBSITE.status = '1' and CMS_WEBSITE.ID='" + pNode.NodeID + "' ");
            if (ds.Tables[0].Rows.Count > 0)
            {
                //for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                //{
                if (ds.Tables[0].Rows[0]["id"].ToString() == "A8C9876A-7ECB-495C-836A-EC69143A63DE")
                {
                    //continue;
                }
                else
                {
                    dv = mBrock.GetList(" status= '1' and templateid= '" + ds.Tables[0].Rows[0]["TEMPLATEID"].ToString() + "' ");
                    if (dv.Tables[0].Rows.Count > 0)
                    {
                        for (int j = 0; j < dv.Tables[0].Rows.Count; j++)
                        {
                            html = mhc.replaceHtml(Server.MapPath(ds.Tables[0].Rows[0]["TEMPLATEURL"].ToString()), dv.Tables[0].Rows[j]["ID"].ToString(), dv.Tables[0].Rows[j]["BROCKCODE"].ToString());
                        }
                    }
                }
                //}
            }
            ViewState["HTML"] = html;
            if (ds.Tables[0].Rows[0]["id"].ToString() == "A8C9876A-7ECB-495C-836A-EC69143A63DE")
            {
                //;
            }
            else
            {
                if (pNode.NodeID == "f16375f4-9d60-4586-9548-fc3f0b0fefba")
                {
                    mhc.createHtml(Server.MapPath("~/template/masterpage1.html"), Server.MapPath("~/website/" + ds.Tables[0].Rows[0]["webcode"].ToString() + ".html"), html, "");
                }
                else
                {
                    mhc.createHtml(Server.MapPath("~/template/masterpage.html"), Server.MapPath("~/website/" + ds.Tables[0].Rows[0]["webcode"].ToString() + ".html"), html, "");
                }
            }
            html = "";
            foreach (FineUI.TreeNode cNode in pNode.Nodes)
            {
                if (cNode.Checked == true)
                {
                    SetTreeValue(cNode);
                }
            }
        }
Esempio n. 28
0
 public static void NodeParentsCheck(FineUI.TreeNode pNode)
 {
     FineUI.TreeNode _node = null;
     _node         = pNode.ParentNode;
     _node.Checked = pNode.Checked;
     if (_node.ParentNode != null)
     {
         NodeParentsCheck(_node);
     }
 }
Esempio n. 29
0
 /// <summary>
 /// 取所有子节点
 /// </summary>
 private string GetSubNodes(FineUI.TreeNode node)
 {
     strNodes.Append(node.NodeID);
     strNodes.Append(",");
     foreach (FineUI.TreeNode temp in node.Nodes)
     {
         GetSubNodes(temp);
     }
     return(strNodes.ToString());
 }
Esempio n. 30
0
        private void DynamicAppendNode(FineUI.TreeNode parentNode)
        {
            FineUI.TreeNode node         = null;
            var             parentNodeid = parentNode.NodeID;
            var             db           = new SAFEDB();
            var             res1         = (from x in db.ORG_JOBUNITRELATION_T
                                            where x.C_CORPCODE.CompareTo(parentNodeid) == 0
                                            select x);

            //如果res1找到了,说明这个id是个一级父类,需要加载二级父类的东西。二级类不是叶子
            if (res1.Count() > 0)
            {
                //选出的项首先不能与前者相等
                var res2 = (from x in res1
                            where (x.C_KSCODE.CompareTo(x.C_CORPCODE) != 0)
                            group x by new { x.C_KSCODE } into gr1

                            select gr1);
                foreach (var gr in res2)
                {
                    node                  = new FineUI.TreeNode();
                    node.Text             = gr.First().C_KSCODE + "_" + gr.First().C_KSNAME;
                    node.Leaf             = false;
                    node.EnableClickEvent = true;
                    node.NodeID           = gr.First().C_KSCODE;
                    parentNode.Nodes.Add(node);
                }
            }
            else
            {
                //如果res11找到了,说明这个id是个二级父类,需要加载三级类的东西。三级类属于叶子
                var res11 = (from x in db.ORG_JOBUNITRELATION_T
                             where x.C_KSCODE.CompareTo(parentNodeid) == 0
                             select x).ToList();
                if (res11.Count() > 0)
                {
                    //选出的项首先不能与前者相等
                    var res2 = (from x in res11
                                where (x.C_UNITCODE.CompareTo(x.C_KSCODE) != 0)
                                group x by new { x.C_UNITCODE } into gr1

                                select gr1);
                    foreach (var gr in res2)
                    {
                        node                  = new FineUI.TreeNode();
                        node.Text             = gr.First().C_UNITCODE + "_" + gr.First().C_UNITNAME;
                        node.Leaf             = true;
                        node.EnableClickEvent = true;
                        node.NodeID           = gr.First().C_UNITCODE;
                        parentNode.Nodes.Add(node);
                    }
                }
            }
        }
Esempio n. 31
0
        /// <summary>
        /// 添加子节点
        /// </summary>
        /// <param name="dt">数据表</param>
        /// <param name="treenode">当前树节点</param>
        /// <param name="parentID">父节点ID值</param>
        private void AddChildrenNode(DataTable dt, FineUI.TreeNode treenode, string parentID)
        {
            //筛选出当前节点下面的子节点
            DataTable Childdt = DataTableHelper.GetFilterData(dt, MenuInfoTable.ParentId, parentID, MenuInfoTable.Sort, "Asc");

            //判断是否有节点存在
            if (Childdt.Rows.Count > 0)
            {
                //循环读取节点
                foreach (DataRow dr in Childdt.Rows)
                {
                    //判断当前节点是否有权限访问,没有则跳过本次循环
                    if (_pagePower.IndexOf("|" + dr[MenuInfoTable.Id].ToString() + "|") < 0)
                    {
                        continue;
                    }

                    //创建子节点
                    var TreeChildNode = new FineUI.TreeNode();
                    //设置节点ID
                    TreeChildNode.NodeID = dr[MenuInfoTable.Id].ToString();
                    //设置节点名称
                    TreeChildNode.Text   = dr[MenuInfoTable.Name].ToString();
                    TreeChildNode.Target = "mainRegion";
                    //判断当前节点是否为最终节点
                    if (int.Parse(dr[MenuInfoTable.IsMenu].ToString()) != 0)
                    {
                        //设置节点链接地址
                        if (dr[MenuInfoTable.Url].ToString().IndexOf("?") > 0)
                        {
                            TreeChildNode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "&" + MenuInfoBll.GetInstence().PageUrlEncryptString();
                        }
                        else
                        {
                            TreeChildNode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "?" + MenuInfoBll.GetInstence().PageUrlEncryptString();
                        }
                        //TreeChildNode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "?" + MenuInfoBll.PageURLEncryptString();
                        TreeChildNode.Leaf = true;
                    }
                    else
                    {
                        TreeChildNode.NavigateUrl = "";
                        TreeChildNode.Leaf        = false;
                        //设置树节点扩张
                        TreeChildNode.Expanded = true;
                    }
                    //将节点添加进树列表中
                    treenode.Nodes.Add(TreeChildNode);

                    //递归添加子节点
                    AddChildrenNode(dt, TreeChildNode, dr[MenuInfoTable.Id].ToString());
                }
            }
        }
    /// <summary>
    /// 根据authorityGrid选中树
    /// </summary>
    //protected void authorityGrid_RowSelect(object sender, FineUI.GridRowSelectEventArgs e)
    //{
    //    string menuID = authorityGrid.DataKeys[e.RowIndex][1].ToString();
    //    FineUI.TreeNode node = GetMenuNode(tvwMenu.Nodes, menuID);
    //    node.Checked = true;
    //    CheckParentNode(node);
    //}

    /// <summary>
    /// 取出父菜单
    /// </summary>
    //protected FineUI.TreeNode GetMenuNode(FineUI.TreeNodeCollection nodes, string nodeid)
    //{
    //    FineUI.TreeNode node = nodes.Where(n => n.NodeID == nodeid).FirstOrDefault();
    //    if (node == null)
    //    {
    //        foreach (FineUI.TreeNode n in nodes)
    //        {
    //            node = GetMenuNode(n.Nodes, nodeid);
    //            if (node != null)
    //                break;
    //        }
    //    }
    //    return node;
    //}
    #endregion

    private void CheckParentNode(FineUI.TreeNode node)
    {
        if (node.ParentNode != null)
        {
            if (node.ParentNode.Checked)
            {
                return;
            }
            node.ParentNode.Checked = true;
            CheckParentNode(node.ParentNode);
        }
    }
Esempio n. 33
0
    /// <summary>
    /// 上传文件
    /// </summary>
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        string folderID = "";

        FineUI.TreeNode node = tvwFolder.SelectedNode;
        if (node != null && node.NodeID != "0")
        {
            folderID = node.NodeID;
        }
        uploadFileWin.IFrameUrl = string.Format("../HardDisk/FrmUploadFile.aspx?folderid={0}&tabid={1}", folderID, this._FrmMyHardDisk.ID);
        uploadFileWin.Hidden    = false;
    }
 private void LoadChildNodes(TreeNode node)
 {
     foreach (sys_Orgnization o in OrgnizationList.Where(p => p.PId == Convert.ToInt32(node.NodeID)))
     {
         var cNode = new TreeNode
         {
             Text = o.OrgnizationName,
             NodeID = o.Id.ToString(),
             Expanded = true
         };
         //加载子部门信息
         node.Nodes.Add(cNode);
         LoadChildNodes(cNode);
     }
 }
        private void LoadData()
        {
            trOrgnizationTree.Items.Clear();

            var rootNode = new TreeNode
            {
                Text = ConfigHelper.GetAppSettingString("CorpName"),
                NodeID = "0",
                Expanded = true
            };

            trOrgnizationTree.Nodes.Add(rootNode);

            LoadChildNodes(rootNode);

        }
        private void LoadData()
        {
            trAppTree.Nodes.Clear();

            foreach (sys_App a in AppList)
            {
                var cNode = new TreeNode
                {
                    Text = a.AppName,
                    NodeID = a.Id.ToString(),
                    IconUrl = a.Ico,
                    Expanded = true,
                    EnablePostBack = true

                };
                trAppTree.Nodes.Add(cNode);
            }
        }
        private void Init_Tree()
        {
            trOrgnization.Nodes.Clear();

            var rootNode = new TreeNode
            {
                Text = ConfigHelper.GetAppSettingString("CorpName"),
                NodeID = "0",
                Expanded = true,
                EnablePostBack = true
            };

            trOrgnization.Nodes.Add(rootNode);

            LoadChildNodes(rootNode);
        }
Esempio n. 38
0
        protected void CreateNode(string parentID, FineUI.TreeNodeCollection pnode, string RightStr)
        {
            foreach (sys_Menu m in sysMenuList.Where(p => p.PId == parentID).OrderBy(p => p.SortIndex).ToList())
            {
                if (!RightStr.Contains(m.MenuCode + "-0"))
                    continue;
                FineUI.TreeNode node = new FineUI.TreeNode();
                pnode.Add(node);
                node.NodeID = m.MenuCode;
                node.Text = m.MenuName;
                node.NavigateUrl = ResolveUrl(m.Url);
                node.IconUrl = m.Ico;

                CreateNode(m.Id, node.Nodes, RightStr);
            }
        }
        private void Init_Tree()
        {
            trDepartmentTree.Nodes.Clear();

            var rootNode = new TreeNode
            {
                Text = ConfigHelper.GetAppSettingString("CorpName"),
                NodeID = "0",
                Expanded = true
            };

            trDepartmentTree.Nodes.Add(rootNode);

            LoadChildNodes(rootNode);
        }
        private void LoadUserNodes(TreeNode node, List<sys_Member> memberList)
        {
            string selectUserId = "";
            if (Grid2.SelectedRowIndex >= 0)
            {
                string mid = Grid2.DataKeys[Grid2.SelectedRowIndex][0].ToString();
                if (MenuOperRes.ContainsKey(mid))
                    selectUserId = MenuOperRes[mid] + ",";
            }

            foreach (sys_Member m in memberList)
            {
                if (m.IsDelete == false && m.IsUsing == true)
                {
                    var cNode = new TreeNode
                    {
                        Text = m.RealName,
                        NodeID = "P" + m.id.ToString(),
                        Icon = (bool)m.Sex ? Icon.User : Icon.UserFemale,
                        AutoPostBack = true,
                        EnableCheckBox = true,
                        Checked = selectUserId.Contains(m.id.ToString() + ",")
                    };
                    node.Nodes.Add(cNode);
                }
            }
        }
 private void LoadChildNodes(TreeNode node)
 {
     foreach (sys_Orgnization o in OrgnizationList.Where(p => p.PId == Convert.ToInt32(node.NodeID)))
     {
         var cNode = new TreeNode
         {
             Text = o.OrgnizationName,
             NodeID = o.Id.ToString(),
             Expanded = true,
             EnableCheckBox = true,
             AutoPostBack = true
         };
         //加载子部门信息
         node.Nodes.Add(cNode);
         LoadUserNodes(cNode, o.sys_Member.ToList());
         LoadChildNodes(cNode);
     }
 }
        private void InitTree()
        {
            trUser.Nodes.Clear();

            var rootNode = new TreeNode
            {
                Text = ConfigHelper.GetAppSettingString("CorpName"),
                NodeID = "0",
                Expanded = true,
                EnableCheckBox = true,
                AutoPostBack = true
            };

            trUser.Nodes.Add(rootNode);

            LoadChildNodes(rootNode);

        }
Esempio n. 43
0
        /// <summary>
        /// 生成菜单树
        /// </summary>
        /// <param name="menus"></param>
        /// <param name="parentMenuId"></param>
        /// <param name="nodes"></param>
        private int ResolveMenuTree(List<Menu> menus, Menu parentMenu, FineUI.TreeNodeCollection nodes)
        {
            int count = 0;
            foreach (var menu in menus.Where(m => m.Parent == parentMenu))
            {
                FineUI.TreeNode node = new FineUI.TreeNode();
                nodes.Add(node);
                count++;

                node.Text = menu.Name;
                node.IconUrl = menu.ImageUrl;
                if (!String.IsNullOrEmpty(menu.NavigateUrl))
                {
                    node.EnablePostBack = false;
                    node.NavigateUrl = ResolveUrl(menu.NavigateUrl);
                    //node.OnClientClick = String.Format("addTab('{0}','{1}','{2}')", node.NodeID, ResolveUrl(menu.NavigateUrl), node.Text.Replace("'", ""));
                }

                if (menu.IsTreeLeaf)
                {
                    node.Leaf = true;

                    // 如果是叶子节点,但是不是超链接,则是空目录,删除
                    if (String.IsNullOrEmpty(menu.NavigateUrl))
                    {
                        nodes.Remove(node);
                        count--;
                    }
                }
                else
                {
                    node.SingleClickExpand = true;

                    int childCount = ResolveMenuTree(menus, menu, node.Nodes);

                    // 如果是目录,但是计算的子节点数为0,可能目录里面的都是空目录,则要删除此父目录
                    if (childCount == 0 && String.IsNullOrEmpty(menu.NavigateUrl))
                    {
                        nodes.Remove(node);
                        count--;
                    }
                }

            }

            return count;
        }
Esempio n. 44
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="node">树节点</param>
 /// <param name="xmlNode">树节点的数据源</param>
 public TreeNodeEventArgs(TreeNode node, XmlNode xmlNode)
 {
     _node = node;
     _nodeID = node.NodeID;
     _xmlNode = xmlNode;
 }
Esempio n. 45
0
        protected override void LoadDetail()
        {
            FineUI.TreeNode tn;
            DataTable dt;
            if (B_Action.ToLower() == "add")
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select * From Sys_Role Where Enabled=1 Order By Seq
                    ", ""), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["RoleID"]);
                    tn.Text = String.Format("{0}-{1}", dr["Seq"], dr["RoleName"]);
                    this.treeFr.Nodes.Add(tn);
                }
            }
            else
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select a.*
                        From Sys_Role a
                            Left Join Flow_OrgR b On b.RoleID=a.RoleID
                                And b.OrgID='{0}'
                        Where IsNull(b.RoleID,'')=''
                        Order By a.Seq
                    ", B_Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["RoleID"]);
                    tn.Text = String.Format("{0}-{1}", dr["Seq"], dr["RoleName"]);
                    this.treeFr.Nodes.Add(tn);
                }

                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select a.*
                        From Sys_Role a
                            Left Join Flow_OrgR b On b.RoleID=a.RoleID
                                And b.OrgID='{0}'
                        Where IsNull(b.RoleID,'')!=''
                        Order By a.Seq
                    ", B_Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["RoleID"]);
                    tn.Text = String.Format("{0}-{1}", dr["Seq"], dr["RoleName"]);
                    this.treeTo.Nodes.Add(tn);
                }
            }
        }
        /// <summary>
        /// 添加子节点
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="node"></param>
        /// <param name="nodeid"></param>
        private void AddNode(DataTable dt, FineUI.TreeNode node, string nodeid)
        {
            //筛选出当前节点下面的子节点
            var Childdt = DataTableHelper.GetFilterData(dt, MenuInfoTable.ParentId, nodeid, MenuInfoTable.Sort, "Asc");
            //判断是否有节点存在
            if (Childdt.Rows.Count > 0)
            {
                foreach (DataRow item in Childdt.Rows)
                {
                    bool ispage = int.Parse(item[MenuInfoTable.IsMenu].ToString()) == 0 ? false : true;
                    var tnode = new FineUI.TreeNode();
                    //设置节点名称
                    tnode.Text = item[MenuInfoTable.Name].ToString();
                    //设置节点ID
                    tnode.NodeID = item[MenuInfoTable.Id].ToString();

                    //判断当前节点是否为最终节点
                    if (ispage)
                    {
                        tnode.Leaf = true;
                        tnode.EnableClickEvent = true;
                    }
                    else
                    {
                        tnode.EnableClickEvent = false;
                        tnode.Enabled = false;
                    }
                    //是否自动扩大
                    tnode.Expanded = true;

                    //if (!TreeMenu.Nodes.Contains(tnode))
                    node.Nodes.Add(tnode);

                    //递归添加子节点
                    AddNode(dt, tnode, item[MenuInfoTable.Id].ToString());

                }
            }
        }
Esempio n. 47
0
 /// <summary>
 /// ���캯��
 /// </summary>
 /// <param name="node">���ڵ�</param>
 /// <param name="isChecked">�Ƿ�ѡ��</param>
 public TreeCheckEventArgs(TreeNode node, bool isChecked)
 {
     _node = node;
     _nodeID = node.NodeID;
     _checked = isChecked;
 }
Esempio n. 48
0
        void LoadModuleF(string Action, string Keyword)
        {
            FineUI.TreeNode tn;
            DataTable dt;
            this.treeFr2.Nodes.Clear();
            this.treeTo2.Nodes.Clear();
            if (Action.ToLower() == "add")
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                    Select a.*,b.Caption As ModuleName,c.Icon,c.FunctionName
                    From Sys_ModuleF a
                        Left Join Sys_Module b On b.ModuleID=a.ModuleID
                        Left Join Sys_Function c On c.FunctionID=a.FunctionID
                    Order By b.ModuleID,c.Seq
                    ", ""), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["ModuleFID"]);
                    tn.Icon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
                    tn.Text = String.Format("{0}-{1}", dr["ModuleName"], dr["FunctionName"]);
                    this.treeFr2.Nodes.Add(tn);
                }
            }
            else
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                    Select a.*,c.Caption As ModuleName,d.Icon,d.FunctionName
                    From Sys_ModuleF a
                        Left Join Sys_RoleMF b On b.ModuleFID=a.ModuleFID And b.RoleID='{0}'
                        Left Join Sys_Module c On c.ModuleID=a.ModuleID
                        Left Join Sys_Function d On d.FunctionID=a.FunctionID
                    Where IsNull(b.ModuleFID,'')=''
                    Order By c.ModuleID,d.Seq
                    ", Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["ModuleFID"]);
                    tn.Icon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
                    tn.Text = String.Format("{0}-{1}", dr["ModuleName"], dr["FunctionName"]);
                    this.treeFr2.Nodes.Add(tn);
                }

                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                    Select a.*,c.Caption As ModuleName,d.Icon,d.FunctionName
                    From Sys_ModuleF a
                        Left Join Sys_RoleMF b On b.ModuleFID=a.ModuleFID And b.RoleID='{0}'
                        Left Join Sys_Module c On c.ModuleID=a.ModuleID
                        Left Join Sys_Function d On d.FunctionID=a.FunctionID
                    Where IsNull(b.ModuleFID,'')!=''
                    Order By c.ModuleID,d.Seq
                    ", Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["ModuleFID"]);
                    tn.Icon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
                    tn.Text = String.Format("{0}-{1}", dr["ModuleName"], dr["FunctionName"]);
                    this.treeTo2.Nodes.Add(tn);
                }
            }
        }
Esempio n. 49
0
        void LoadUserR(string Action, string Keyword)
        {
            FineUI.TreeNode tn;
            DataTable dt;
            this.treeFr.Nodes.Clear();
            this.treeTo.Nodes.Clear();
            if (Action.ToLower() == "add")
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select * From Sys_User Where Enabled=1 Order By UserID
                    ", ""), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["UserID"]);
                    tn.Text = String.Format("{0}-{1}",dr["UserID"], dr["UserName"]);
                    this.treeFr.Nodes.Add(tn);
                }
            }
            else
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select a.*
                        From Sys_User a
                            Left Join Sys_UserR b On b.UserID=a.UserID
                                And b.RoleID='{0}'
                        Where IsNull(b.UserID,'')=''
                        Order By a.UserID
                    ", Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["UserID"]);
                    tn.Text = String.Format("{0}-{1}", dr["UserID"], dr["UserName"]);
                    this.treeFr.Nodes.Add(tn);
                }

                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select a.*
                        From Sys_User a
                            Left Join Sys_UserR b On b.UserID=a.UserID
                                And b.RoleID='{0}'
                        Where IsNull(b.UserID,'')!=''
                        Order By a.UserID
                    ", Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["UserID"]);
                    tn.Text = String.Format("{0}-{1}", dr["UserID"], dr["UserName"]);
                    this.treeTo.Nodes.Add(tn);
                }
            }
        }
Esempio n. 50
0
        void BuildTree(DataTable dt, string pId, FineUI.Tree tree, FineUI.TreeNode pn)
        {
            FineUI.TreeNode tn;
            string ModuleID;
            foreach (DataRow dr in dt.Select("IsNull(PID,'')='" + pId + "'", "RID"))
            {
                if (Convert.ToBoolean(dr["ModuleEnabled"]))
                {
                    ModuleID = dr["ModuleID"].ToString().Trim();
                    if (ModuleID != "")
                    {
                        if (!App_Com.Sys_User.CheckAuthorize(ModuleID, "View"))
                            continue;
                    }
                    tn = new FineUI.TreeNode();
                    tn.NodeID = dr["MenuID"].ToString();
                    tn.Text = dr["MenuName"].ToString();
                    tn.Icon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
                    tn.NavigateUrl = dr["Url"].ToString() + (dr["UrlParameter"].ToString() == "" ? "" : "?" + dr["UrlParameter"].ToString());
                    if (!Convert.ToBoolean(dr["Enabled"]))
                    {
                        tn.Enabled = false;
                        tn.ToolTip = "此模块尚未启用,请稍候再试.";
                        tn.Icon = Icon.BulletWrench;
                    }
                    if (pn != null)
                        pn.Nodes.Add(tn);
                    else
                        tree.Nodes.Add(tn);
                    BuildTree(dt, dr["RID"].ToString(), tree, tn);

                    if (ModuleID == "" && tn.Nodes.Count == 0)
                    {
                        if (tn.ParentNode != null)
                            tn.ParentNode.Nodes.Remove(tn);
                        else
                            tree.Nodes.Remove(tn);
                    }
                }
            }
        }
Esempio n. 51
0
        void LoadModuleF(string Action, string Keyword)
        {
            FineUI.TreeNode tn;
            DataTable dt;
            if (Action.ToLower() == "add")
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select * From Sys_Function Where Enabled=1 Order By Seq
                    ",""), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["FunctionID"]);
                    tn.Icon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
                    tn.Text = String.Format("{0}-{1}", dr["Seq"], dr["FunctionName"]);
                    this.treeFr.Nodes.Add(tn);
                }
            }
            else
            {
                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select a.*
                        From Sys_Function a
                            Left Join Sys_ModuleF b On b.FunctionID=a.FunctionID
                                And b.ModuleID='{0}'
                        Where IsNull(b.FunctionID,'')=''
                        Order By a.Seq
                    ", Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["FunctionID"]);
                    tn.Icon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
                    tn.Text = String.Format("{0}-{1}", dr["Seq"], dr["FunctionName"]);
                    this.treeFr.Nodes.Add(tn);
                }

                dt = RDFNew.Module.SqlHelper.ExecuteDataTable(String.Format(@"
                        Select a.*
                        From Sys_Function a
                            Left Join Sys_ModuleF b On b.FunctionID=a.FunctionID
                                And b.ModuleID='{0}'
                        Where IsNull(b.FunctionID,'')!=''
                        Order By a.Seq
                    ", Keyword), null);
                foreach (DataRow dr in dt.Rows)
                {
                    tn = new FineUI.TreeNode();
                    tn.NodeID = String.Format("{0}", dr["FunctionID"]);
                    tn.Icon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
                    tn.Text = String.Format("{0}-{1}", dr["Seq"], dr["FunctionName"]);
                    this.treeTo.Nodes.Add(tn);
                }
            }
        }
Esempio n. 52
0
        /// <summary>
        /// 添加子节点
        /// </summary>
        /// <param name="dt">数据表</param>
        /// <param name="treenode">当前树节点</param>
        /// <param name="parentID">父节点ID值</param>
        private void AddChildrenNode(DataTable dt, FineUI.TreeNode treenode, string parentID)
        {
            //筛选出当前节点下面的子节点
            DataTable Childdt = DataTableHelper.GetFilterData(dt, MenuInfoTable.ParentId, parentID, MenuInfoTable.Sort, "Asc");
            //判断是否有节点存在
            if (Childdt.Rows.Count > 0)
            {
                //循环读取节点
                foreach (DataRow dr in Childdt.Rows)
                {
                    //判断当前节点是否有权限访问,没有则跳过本次循环
                    if (_pagePower.IndexOf("," + dr[MenuInfoTable.Id].ToString() + ",") < 0)
                    {
                        continue;
                    }

                    //创建子节点
                    var TreeChildNode = new FineUI.TreeNode();
                    //设置节点ID
                    TreeChildNode.NodeID = dr[MenuInfoTable.Id].ToString();
                    //设置节点名称
                    TreeChildNode.Text = dr[MenuInfoTable.Name].ToString();
                    TreeChildNode.Target = "mainRegion";
                    //判断当前节点是否为最终节点
                    if (int.Parse(dr[MenuInfoTable.IsMenu].ToString()) != 0)
                    {
                        //设置节点链接地址
                        if (dr[MenuInfoTable.Url].ToString().IndexOf("?") > 0)
                        {
                            TreeChildNode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "&" + MenuInfoBll.GetInstence().PageUrlEncryptString();
                        }
                        else
                        {
                            TreeChildNode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "?" + MenuInfoBll.GetInstence().PageUrlEncryptString();
                        }
                        //TreeChildNode.NavigateUrl = dr[MenuInfoTable.Url].ToString() + "?" + MenuInfoBll.PageURLEncryptString();
                        TreeChildNode.Leaf = true;
                    }
                    else
                    {
                        TreeChildNode.NavigateUrl = "";
                        TreeChildNode.Leaf = false;
                        //设置树节点扩张
                        TreeChildNode.Expanded = true;
                    }
                    //将节点添加进树列表中
                    treenode.Nodes.Add(TreeChildNode);

                    //递归添加子节点
                    AddChildrenNode(dt, TreeChildNode, dr[MenuInfoTable.Id].ToString());

                }

            }
        }
Esempio n. 53
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="node">树节点</param>
 public TreeNodeEventArgs(TreeNode node)
 {
     _node = node;
     _nodeID = node.NodeID;
 }