usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Mvc;usingFluentData;usingMvcExtJsTree.Models;usingMvcExtJsTree.ViewModel;namespaceMvcExtJsTree.Controllers
{public classHomeController : Controller
{//
//GET: /Home/
publicActionResult Index()
{returnView();
}publicActionResult HandlerTreeFromDB()
{var categoryList = DAL.DBHelper.Context().Select("*").From("testTree").QueryMany();var result = this.ConvertTreeNodes(categoryList);returnJson(result, JsonRequestBehavior.AllowGet);
}#region 和树节点相关的
private List ConvertTreeNodes(ListlistCategory)
{
List listTreeNodes = new List();
LoadTreeNode(listCategory, listTreeNodes,-1);returnlistTreeNodes;
}private void LoadTreeNode(List listCategory, List listTreeNodes, intpid)
{foreach (testTree category inlistCateg