コード例 #1
0
        /// <summary>
        /// 获取组织机构数据
        /// </summary>
        /// <returns></returns>
        public List <ZTreeItem> GetOrganizationDataZtree()
        {
            var list = _organizationAppService.GetList();
            List <ZTreeItem> treelist = new List <ZTreeItem>();

            foreach (var item in list)
            {
                ZTreeItem tree = new ZTreeItem();
                tree.Id   = item.Id;
                tree.pId  = item.ParentId == null ? 0 : (long)item.ParentId;
                tree.Name = item.DisplayName;
                treelist.Add(tree);
            }
            return(treelist);
        }