Exemplo n.º 1
0
        /// <summary>
        /// 取得MenuNode
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public List <FunctionMenuNode> GetFunctionToNode(string userID)
        {
            var menuData = Utility.MigrationIEnumerable <FunctionMenuDTO, FunctionMenuVO>(_functionRepo.GetMenuData(userID));

            var topData = menuData.Where(o => o.Parent == 0).ToList();

            var NotTopData = menuData.Where(o => o.Parent != 0).ToList();

            var result = new List <FunctionMenuNode>()
            {
            };

            foreach (var item in topData)
            {
                var node = new FunctionMenuNode(item)
                {
                };
                result.Add(node);
                SetNode(NotTopData, node);
            }

            return(result);
        }