Пример #1
0
        public ActionResult GetTreeSelectJson()
        {
            var data     = SysItemsService.GetList();
            var treeList = new List <TreeSelectModel>();

            foreach (var item in data)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id       = item.Id;
                treeModel.text     = item.FullName;
                treeModel.parentId = item.ParentId;
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeSelectJson()));
        }
 private object GetDataItemList()
 {
     var itemdata = _SysItemsDetailService.GetList();
     Dictionary<string, object> dictionaryItem = new Dictionary<string, object>();
     foreach (var item in _SysItemsService.GetList())
     {
         var dataItemList = itemdata.Where(t => t.ItemId.Equals(item.Id));
         Dictionary<string, string> dictionaryItemList = new Dictionary<string, string>();
         foreach (var itemList in dataItemList)
         {
             dictionaryItemList.Add(itemList.ItemCode, itemList.ItemName);
         }
         dictionaryItem.Add(item.EnCode, dictionaryItemList);
     }
     return dictionaryItem;
 }