Ejemplo n.º 1
0
        public RoomController()
        {
            areaData  = areaApp.GetList();
            ownerData = customerApp.GetTypeCustomers(strOwnerTypeId);

            deviceTypeData   = systemServiceApp.GetItemsDetail("DeviceType");
            deviceStatusData = systemServiceApp.GetItemsDetail("DeviceStatus");
        }
 //[HandlerAjaxOnly]
 public ActionResult GetTreeSelectJson()
 {
     var data = areaApp.GetList();
     var treeList = new List<TreeSelectModel>();
     foreach (AreaEntity item in data)
     {
         TreeSelectModel treeModel = new TreeSelectModel();
         treeModel.id = item.F_Id;
         treeModel.text = item.F_FullName;
         treeModel.parentId = item.F_ParentId;
         treeList.Add(treeModel);
     }
     return Content(treeList.TreeSelectJson());
 }
        public async Task <IActionResult> GetTreeSelectJson()
        {
            var data = await areaApp.GetList();

            var treeList = new List <TreeSelectModel>();

            foreach (AreaEntity 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()));
        }
Ejemplo n.º 4
0
        public ActionResult GetAllTreeGridJson(string keyword)
        {
            var data = areaApp.GetList();

            if (!string.IsNullOrEmpty(keyword))
            {
                data = data.TreeWhere(t => t.F_FullName.Contains(keyword));
            }
            var treeList = new List <TreeGridModel>();

            foreach (AreaEntity item in data)
            {
                TreeGridModel treeModel   = new TreeGridModel();
                bool          hasChildren = data.Count(t => t.F_ParentId == item.F_Id) == 0 ? false : true;
                treeModel.id         = item.F_Id;
                treeModel.text       = item.F_FullName;
                treeModel.isLeaf     = hasChildren;
                treeModel.parentId   = item.F_ParentId;
                treeModel.expanded   = true;
                treeModel.entityJson = item.ToJson();
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeGridJson()));
        }