コード例 #1
0
        public List <RoomItem> getSearchResult(string searchKey)
        {
            //HttpDataService service = new HttpDataService();
            //List<RoomItem> roomList = service.GetSearchRoomList(searchKey);

            //if (roomList != null)
            //{
            //    roomList = roomList.Where(r => r.roomName.Contains(searchKey)).ToList();
            //}

            List <RoomItem> result = new List <RoomItem>();

            ClassRoomInfoManager classRoomInfoManager = new ClassRoomInfoManager();

            var roomList = classRoomInfoManager.GetClassRoomInfoByName(searchKey);

            if (roomList != null)
            {
                roomList.ForEach(r => result.Add(new RoomItem()
                {
                    roomId = r.Code, roomName = r.Name
                }));
            }

            return(result);
        }
コード例 #2
0
        public List <AutoCompleteItem> getSearchResult(string searchKey)
        {
            List <AutoCompleteItem> result = new List <AutoCompleteItem>();

            //HttpDataService service = new HttpDataService();
            //List<RoomItem> roomList = service.GetSearchRoomList(searchKey);

            //if (roomList != null)
            //{
            //    result = roomList.Where(r => r.roomName.Contains(searchKey)).Select(r => new AutoCompleteItem() { Text = r.roomName, Value = r.roomId }).ToList();
            //}

            ClassRoomInfoManager classRoomInfoManager = new ClassRoomInfoManager();

            var roomList = classRoomInfoManager.GetClassRoomInfoByName(searchKey);

            if (roomList != null)
            {
                result = roomList.Select(r => new AutoCompleteItem()
                {
                    Text = r.Name, Value = r.Code
                }).ToList();
            }

            return(result);
        }
コード例 #3
0
        public string GetClassRoomInfoByName(string name)
        {
            ClassRoomInfoManager manager = new ClassRoomInfoManager();

            return(new JavaScriptSerializer().Serialize(manager.GetClassRoomInfoByName(name)));
        }