Пример #1
0
 private static void LoadZTreeNode(List <SYS_DEPTANDMEMBER_TEMP> listMenus, List <ZTreeNode> listTreeNodes, string pid, bool isCheckAll)
 {
     foreach (SYS_DEPTANDMEMBER_TEMP menu in listMenus)
     {
         if (menu.PARENT_CODE == pid)
         {
             ZTreeNode node = menu.TransformZTreeNode(isCheckAll);
             listTreeNodes.Add(node);
             LoadZTreeNode(listMenus, node.children, node.id, isCheckAll);
         }
     }
 }
Пример #2
0
        private ZTreeNode TransformZTreeNode(bool isCheckAll)
        {
            string mytext = this.ORGRY_NAME;

            if (!string.IsNullOrEmpty(RYMOBILE))
            {
                mytext += "-" + RYMOBILE;
            }
            //string orgOpenState=ConfigurationSettings.AppSettings["OrgOpenState"];
            ZTreeNode zTreeNode = new ZTreeNode()
            {
                id         = this.ORGRY_CODE,
                name       = mytext,
                open       = this.STATE.Equals("1") ? "true" : "false",//只有存在下级才可设为closed,否则会循环查询
                iconSkin   = this.ICO,
                Checked    = isCheckAll,
                attributes = new { mobile = RYMOBILE, ico = ICO, phone = PHONE },
                children   = new List <ZTreeNode>()
            };

            return(zTreeNode);
        }