Beispiel #1
0
 //用户管理,设备域管理调用
 public static List<TreeModel> toDeviceTreeModel(List<Control> controlList)
 {
     //Control转换为menuTree
     List<TreeModel> menuTreeList = new List<TreeModel>();
     foreach (Control control in controlList)
     {
         TreeModel menuTree = new TreeModel();
         menuTree.Id = control.ControlID.ToString();
         menuTree.MenuName = control.ControlName;
         menuTreeList.Add(menuTree);
     }
     return menuTreeList;
 }
Beispiel #2
0
 // <summary>
 // 转化为menuTreemodel
 // </summary>
 public static List<TreeModel> toMenuTreeModelList(List<Sys_Menu> sysMenuList)
 {
     //sysMenu转换为menuTree
     List<TreeModel> menuTreeList = new List<TreeModel>();
     foreach (Sys_Menu sysMenu in sysMenuList)
     {
         TreeModel menuTree = new TreeModel();
         menuTree.Id = sysMenu.MenuID.ToString();
         menuTree.Pid = sysMenu.MenuParentNo;
         menuTree.MenuName = sysMenu.MenuName;
         menuTree.Url = sysMenu.MenuURL;
         menuTreeList.Add(menuTree);
     }
     return menuTreeList;
 }