private void FillMaps() { //Get the list of maps from our JSON preference. _listMaps = PhoneMapJSON.GetFromDb(); //Add a custom order to this map list which will prefer maps that are associated to the local computer's site. _listMaps = _listMaps.OrderBy(x => x.SiteNum != _siteCur.SiteNum) .ThenBy(x => x.MapAreaContainerNum).ToList(); //Select the first map in our list that matches the site associated to the current computer. _mapCur = _listMaps[0]; }
private void FillCombo() { ListMaps = PhoneMapJSON.GetFromDb(); _mapCur = ListMaps[0]; foreach (MapAreaContainer mapCur in ListMaps) { comboRoom.Items.Add(mapCur.Description); } comboRoom.SelectedIndex = 0; _listSites = Sites.GetDeepCopy(); comboSite.Items.Clear(); comboSite.Items.AddList(_listSites, x => x.Description); }
private void FillCombo() { ListMaps = PhoneMapJSON.GetFromDb(); _mapCur = ListMaps[0]; foreach (MapAreaContainer mapCur in ListMaps) { comboRoom.Items.Add(mapCur.Description); } comboRoom.SelectedIndex = 0; _listSites = Sites.GetDeepCopy(); comboSite.Items.Clear(); for (int i = 0; i < _listSites.Count; i++) { comboSite.Items.Add(new ODBoxItem <Site>(_listSites[i].Description, _listSites[i])); } }
private void UpdateComboRooms() { int selectedIndex = comboRoom.SelectedIndex; _listRooms = PhoneMapJSON.GetFromDb(); comboRoom.Items.Clear(); comboRoom.Items.Add("All"); for (int i = 0; i < _listRooms.Count; i++) { comboRoom.Items.Add(_listRooms[i].Description); if (_listRooms[i].MapAreaContainerNum == _mapAreaContainerNum) { selectedIndex = i + 1; } } comboRoom.SelectedIndex = selectedIndex == -1 ? 0 : selectedIndex; }