コード例 #1
0
        public ActionResult GetOperationTreeSelectJson()
        {
            var data     = organizeApp.GetOperationList();
            var treeList = new List <TreeSelectModel>();

            foreach (OrganizeEntity item in data)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id       = item.FId;
                treeModel.text     = item.FShortName;
                treeModel.parentId = data.Count(t => t.FId == item.FParentId) == 0 ? "0" : item.FParentId;
                treeModel.data     = item;
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeSelectJson()));
        }