/// <summary> /// 获取树形页面的数据 /// </summary> /// <returns></returns> public ActionResult GetTree() { List<SystemTree> listSystemTree = new List<SystemTree>(); IBLL.ISysMenuBLL db = new SysMenuBLL(); SysMenuTreeNodeCollection tree = new SysMenuTreeNodeCollection(); var trees = db.GetAll().OrderBy(o => o.Id); if (trees != null) { string parentId = Request["parentid"];//父节点编号 if (string.IsNullOrWhiteSpace(parentId)) { tree.Bind(trees, null, ref listSystemTree); } else { tree.Bind(trees, parentId, ref listSystemTree); } } return Json(listSystemTree, JsonRequestBehavior.AllowGet); }
public SysMenuController(SysMenuBLL bll) { m_BLL = bll; }
public ActionResult GetAllMetadata2(string id) { SysMenuBLL m_BLL = new SysMenuBLL(); var rows = m_BLL.GetAllMetadata().ToList().Select(s => new { Id = s.Id , Name = s.Name , _parentId = s.ParentId , isCheck = string.Join(",", s.SysOperation.Select(t => t.Id + "^" + t.Name)) , iconCls = s.Iconic } ).OrderBy(o => o.Id); return Json(new treegrid() { rows = rows }); }
public ActionResult GetAllMetadata(string id) { SysMenuBLL m_BLL = new SysMenuBLL(); IQueryable<SysMenu> rows = m_BLL.GetAllMetadata(id); if (rows.Any()) {//是否可以省 return Json(new treegrid { rows = rows.Select(s => new { Id = s.Id ,Name = s.Name ,_parentId = s.ParentId ,state = s.SysMenu1.Any(a => a.ParentId == s.Id) ? "closed" : null ,Url = s.Url ,iconCls = s.Iconic ,Sort = s.Sort ,Remark = s.Remark ,State = s.State ,CreatePerson = s.CreatePerson ,CreateTime = s.CreateTime ,UpdateTime = s.UpdateTime ,UpdatePerson = s.UpdatePerson ,IsLeaf = s.IsLeaf } ).OrderBy(o => o.Sort) }); } return Content("[]"); }