예제 #1
0
        public ActionResult GetTreeSelectJson()
        {
            var data     = categoryApp.GetList();
            var treeList = new List <TreeSelectModel>();

            foreach (CategoryEntity item in data)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id       = item.F_Id;
                treeModel.text     = item.Category_EnCode + ":" + item.Category_FullName;
                treeModel.parentId = item.F_ParentId;
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeSelectJson()));
        }
예제 #2
0
        //[HandlerAjaxOnly]
        public ActionResult GetTreeSelectJson(string keyword)
        {
            var data     = business.GetList(keyword);
            var treeList = new List <TreeSelectModel>();

            foreach (CategoryEntity item in data)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id   = item.F_ID.ToString();
                treeModel.text = item.F_Name;
                treeModel.data = item;
                treeList.Add(treeModel);
            }
            return(Content(treeList.ToJson()));
        }