Home > Net >  The menu tree structure, how to read using recursive function
The menu tree structure, how to read using recursive function

Time:12-29

How a multilevel menu data table, I read into the tree object according to LayerCode level.
 
The Name LayerCode
A1 1
A2 1009
A3 1009009
A4 1009005
A5 1009018
A6 1009004
A7 1009006
A8 1009011
A9 1009008
A10 1009013
A11 1009019
A12 1009001
A13 1009001001
A14 1009001002
A15 1009010
A16 1009015
A17 1009022
A18 1009014
A19 1009025
A20 1009007
A21 1009017
A22 1009003
A23 1009023
A24 1009023001
A25 1009024
A26 1009012
A27 1009020
A28 1009016
A29 1009002
A30 1009002005
A31 1009002004
A32 1009002002
A33 1009002003
A34 1009002001
A35 1009002006
A36 1009021
A37 1004
A38 1004005
A39 1004007
A40 1004003
Room A41 1004003013

 
3 public class TreeNode
4 {
5
6 public Data {T get; set; }
7 public TreeNode The Parent {get; set; }
8 public List The Children {get; set; }
9}
  •  Tags:  
  • C #
  • Related