List<EasyTreeData> treeList = new List<EasyTreeData>();//创建一个树类集合
List<CATEGORY> category = CategoryService.GetCategorys(id);//获取所需要数据的集合
foreach (CATEGORY info in category)//将所需要数据的集合转化为树类集合
{
treeList.Add(new EasyTreeData(info.CATEGORY_ID, info.CATEGORY_NAME, "icon-user"));
}
string json = new JavaScriptSerializer().Serialize(treeList);
return Content(json);
时间: 2024-12-19 19:13:25