求大牛给一份多级部署的方案。 有点迷茫。 我有一份树状数据,需要分级部署,然后分级管理
生成json格式为:
生成数据应该结构是这样的:
然后以这个类生成List集合:
public class CustomerViewModel
{
public int ID { get; set; }
public int ParentID { get; set; }
public string Name { get; set; }
public int Class { get; set; }
public bool IsAgency { get; set; }
public string Remark { get; set; }
public string Iocn { get; set; }
public List Children { get; set; }
}
可以无限分级,如果有更好的方法可以不用递归
最好能贴出代码