/// <summary> /// 获取树状的通知数据结构 /// </summary> /// <param name="param"></param> /// <returns></returns> public override BaseResult GetTree(Hashtable param = null) { BaseResult br = new BaseResult(); IList <Faq_Tree> list = DAL.QueryList <Faq_Tree>(typeof(Faq), param); if (list.Count > 0) { IList <Faq_Tree> lst = CreateTree(list); Faq_Tree f = null; for (int i = 0; i < lst.Count; i++) { for (int y = i; y < lst.Count; y++) { if (lst[i].id < lst[y].id) { f = lst[i]; lst[i] = lst[y]; lst[y] = f; } } } br.Data = lst; } else { br.Data = CreateTree(list); } br.Success = true; return(br); }
/// <summary> /// 分页获取数据 /// znt 2015-05-11 /// </summary> public override PageNavigate GetPage(Hashtable param = null) { PageNavigate pn = new PageNavigate(); IList <Faq_Tree> list = DAL.QueryPage <Faq_Tree>(typeof(Faq), param);// if (list.Count > 0) { IList <Faq_Tree> lst = CreateTree(list); Faq_Tree f = null; for (int i = 0; i < lst.Count; i++) { for (int y = i; y < lst.Count; y++) { if (lst[i].id < lst[y].id) { f = lst[i]; lst[i] = lst[y]; lst[y] = f; } } } pn.Data = lst; } pn.Success = true; return(pn); }