public ActionResult GetAllMetadata() { IQueryable <SMMENUTB> rows = SMMENUTBService.GetAllMetadata(); if (rows.Any()) {//是否可以省 return(Json(new treegrid { rows = rows.Select(s => new { ID = s.ID , NAME = s.NAME , _parentId = s.PARENTID , state = s.ISLEAF == "Y" ? "null" : "closed" , URL = s.URL , iconCls = s.ICONIC , SORT = s.SORT , REMARK = s.REMARK , STATE = s.STATE == "Y" ? "启用" : "停用" , CREATEPERSON = s.CREATEPERSON , CREATETIME = s.CREATETIME , UPDATETIME = s.UPDATETIME , UPDATEPERSON = s.UPDATEPERSON } ).OrderBy(o => o.SORT) })); } return(Content("[]")); }
public ActionResult GetAllMetadata2(string id) { var rows = SMMENUTBService.GetAllMetadata().ToList().Select(s => new { ID = s.ID , NAME = s.NAME , _parentId = s.PARENTID , isCheck = string.Join(",", s.SMFUNCTB.Select(t => t.FUNC_ID + "^" + t.FUNC_NAME)) , iconCls = s.ICONIC } ).OrderBy(o => o.ID); return(Json(new treegrid() { rows = rows })); }