/** * 加载所有的大厅 * */ private void LoadAllHalls() { List <HallInfoData> hallInfoDatas = HallInfoConnector.HallInfoDatas(); foreach (HallInfoData hall in hallInfoDatas) { SearchHallCombo.Items.Add(hall.HName); ModifyHallCombo.Items.Add(hall.HName); } SearchHallCombo.SelectedIndex = 0; ModifyHallCombo.SelectedIndex = 0; }
//动态添加房间名的方法 private void AddNewRooms() { List <ListBoxItem> listBoxItems = new List <ListBoxItem>(); hallInfoDatas = HallInfoConnector.HallInfoDatas(); foreach (HallInfoData hall in hallInfoDatas) { ListBoxItem list = new ListBoxItem(); list.Content = hall.HName; listBoxItems.Add(list); } RoomList.ItemsSource = listBoxItems; }
/* * 加载全部的大厅 * */ private void LoadAllHalls() { int count = HallList.Items.Count; for (int i = 0; i < count; i++) { HallList.Items.RemoveAt(0); } List <HallInfoData> hallInfoDatas = HallInfoConnector.HallInfoDatas(); foreach (HallInfoData infoData in hallInfoDatas) { ListBoxItem listBoxItem = new ListBoxItem() { Content = infoData.HName, FontSize = 14, Foreground = new SolidColorBrush(Color.FromRgb(255, 255, 255)) }; HallList.Items.Add(listBoxItem); } }