public JsonResult Create(ModuleType obj)
 {
     bool isOk = Save(obj);
     return Json(new { IsSuccess = isOk });
 }
 private void GetChildren(IList<ModuleType> objList, ModuleType item)
 {
     foreach (ModuleType k in item.children)
     {
         List<ModuleType> kList = objList.Where(p => p.ParentId == k.Id).OrderByDescending(p => p.SortCode).ToList();
         k.children = kList;
         GetChildren(objList, k);
     }
 }
 private void GetChildren(IList<ModuleType> objList, ModuleType item, List<SystemTree> trees)
 {
     foreach (ModuleType k in item.children)
     {
         SystemTree tree = trees.Find(p => p.id == k.Id.ToString());
         List<ModuleType> kList = objList.Where(p => p.ParentId == k.Id).OrderByDescending(p => p.SortCode).ToList();
         k.children = kList;
         List<SystemTree> mlist = ConvertToTree(kList);
         tree.children = mlist;
         GetChildren(objList, k, mlist);
     }
 }
 public ActionResult Edit(ModuleType obj)
 {
     bool isOk = Update<ModuleType>(obj);
     return Json(new { IsSuccess = isOk });
 }