public OptResult GetList(Dictionary <string, object> conditions) { OptResult rst = null; rst = _dictSrv.GetList(conditions); return(rst); }
public ActionResult GetTreeJson() { var data = dictService.GetList(); var treeList = new List <TreeViewModel>(); foreach (DictGridDto dict in data) { TreeViewModel tree = new TreeViewModel(); bool hasChildren = data.Count(t => t.ParentId == dict.Id) == 0 ? false : true; tree.id = dict.Id.ToString(); tree.text = dict.FullName; tree.value = dict.EnCode; tree.parentId = dict.ParentId.ToString(); tree.isexpand = true; tree.complete = true; tree.hasChildren = hasChildren; treeList.Add(tree); } return(Content(treeList.TreeViewJson())); }