コード例 #1
0
ファイル: OrganizeController.cs プロジェクト: qshitems/MyTest
        public ActionResult GetTreeSelectJson()
        {
            var data     = organizebll.GetModelList("");
            var treeList = new List <TreeSelectModel>();

            foreach (var item in data)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id       = item.F_Id;
                treeModel.text     = item.F_FullName;
                treeModel.parentId = item.F_ParentId;
                treeModel.data     = item;
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeSelectJson()));
        }
コード例 #2
0
        private object GetOrganizeList()
        {
            Sys_OrganizeBLL             obll       = new Sys_OrganizeBLL();
            var                         data       = obll.GetModelList("");
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            foreach (var item in data)
            {
                var fieldItem = new
                {
                    encode   = item.F_EnCode,
                    fullname = item.F_FullName
                };
                dictionary.Add(item.F_Id, fieldItem);
            }
            return(dictionary);
        }