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); }
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); }
public string GetClassRoomInfoByName(string name) { ClassRoomInfoManager manager = new ClassRoomInfoManager(); return(new JavaScriptSerializer().Serialize(manager.GetClassRoomInfoByName(name))); }