/// <summary>
 ///将部门信息绑定至tree
 /// </summary>
 /// <param name="nodes"></param>
 private void BuildTree(Ext.Net.TreeNodeCollection nodes)
 {
     try
     {
         TreePanel1.RemoveAll(true);
         if (nodes == null)
         {
             nodes = new Ext.Net.TreeNodeCollection();
         }
         Ext.Net.TreeNode root = new Ext.Net.TreeNode();
         root.Text = GetLangStr("policeOffcer54", "部门列表");
         nodes.Add(root);
         root.Draggable  = true;
         root.Expandable = ThreeStateBool.True;
         root.Expanded   = true;
         DataTable dt = settingManager.GetConfigDepartment("0");
         if (dt != null)
         {
             if (dt.Rows.Count > 0)
             {
                 Addree(dt, dt.Rows[0]["col3"].ToString(), root, null);
             }
         }
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex);
         logManager.InsertLogError("PoliceOfficer.aspx-BuildTree", ex.Message + ";" + ex.StackTrace, "BuildTree has an exception");
     }
 }
예제 #2
0
        /// <summary>
        /// 创建部门列表树形菜单
        /// </summary>
        /// <param name="nodes"></param>
        private void BuildTree(Ext.Net.TreeNodeCollection nodes)
        {
            try
            {
                TreePanel1.RemoveAll(true);

                if (nodes == null)
                {
                    nodes = new Ext.Net.TreeNodeCollection();
                }

                Ext.Net.TreeNode root = new Ext.Net.TreeNode();

                nodes.Add(root);
                root.Draggable  = true;
                root.Expandable = ThreeStateBool.True;
                root.Expanded   = true;
                DataTable dt = Bll.Common.ChangColName(GetRedisData.GetData("t_sys_code:240050"));//把字典从400200改成240050   2016-11-17
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        Addree(dt, "", root, null);
                    }
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("ImportantManager.aspx-BuildTree", ex.Message + ";" + ex.StackTrace, "BuildTree has an exception");
            }
        }
예제 #3
0
        private void BuildTree(Ext.Net.TreeNodeCollection nodes)
        {
            try
            {
                TreePanel1.RemoveAll(true);
                if (nodes == null)
                {
                    nodes = new Ext.Net.TreeNodeCollection();
                }

                Ext.Net.TreeNode root = new Ext.Net.TreeNode();
                root.Text = "Root";
                nodes.Add(root);
                root.Draggable  = true;
                root.Expandable = ThreeStateBool.True;
                root.Expanded   = true;
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(HttpContext.Current.Server.MapPath("MapLayerConfig.xml"));
                foreach (XmlNode plantNode in xmlDoc.SelectNodes("layers/layer"))
                {
                    Ext.Net.TreeNode Node = new Ext.Net.TreeNode();
                    Node.NodeID  = plantNode.Attributes["id"].Value;
                    Node.Text    = plantNode.Attributes["name"].Value;
                    Node.IconCls = plantNode.Attributes["icon"].Value;
                    root.Nodes.Add(Node);
                    foreach (XmlNode SubNode in plantNode.ChildNodes)
                    {
                        Ext.Net.TreeNode subNode = new Ext.Net.TreeNode();
                        subNode.Leaf    = true;
                        subNode.Checked = ThreeStateBool.False;
                        subNode.NodeID  = SubNode.Attributes["id"].Value;
                        subNode.Text    = SubNode.Attributes["name"].Value;
                        subNode.IconCls = SubNode.Attributes["icon"].Value;
                        ConfigItem ci0 = new ConfigItem("marktype", SubNode.Attributes["marktype"].Value, ParameterMode.Value);
                        subNode.CustomAttributes.Add(ci0);
                        ConfigItem ci1 = new ConfigItem("markicon", SubNode.Attributes["markicon"].Value, ParameterMode.Value);
                        subNode.CustomAttributes.Add(ci1);
                        Node.Nodes.Add(subNode);
                    }
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("BGisBrowse.aspx-BuildTree", ex.Message + ";" + ex.StackTrace, "BuildTree has an exception");
            }
        }