private void butSave_Click(object sender, EventArgs e) { PhoneMapJSON.SaveToDb(ListMaps); DataValid.SetInvalid(InvalidType.PhoneMap); DialogResult = DialogResult.OK; Close(); }
private void ButDelete_Click(object sender, EventArgs e) { if (!Security.IsAuthorized(Permissions.SecurityAdmin)) { return; } if (MsgBox.Show(MsgBoxButtons.YesNo, "This will IMMEDIATELY delete the displayed room from the database. Continue?")) //Not translating because HQ only. { if (MsgBox.Show(MsgBoxButtons.YesNo, "Are you sure?")) { string mapName = _mapCur.Description; //Delete cubicles mapAreaPanel.Clear(true); //Delete room ListMaps.Remove(_mapCur); PhoneMapJSON.SaveToDb(ListMaps); //reset combobox comboRoom.Items.Clear(); foreach (MapAreaContainer mapCur in ListMaps) { comboRoom.Items.Add(mapCur.Description); } comboRoom.SelectedIndex = 0; if (!ListMaps.IsNullOrEmpty()) { _mapCur = ListMaps[0]; } FillSettings(); SecurityLogs.MakeLogEntry(Permissions.SecurityAdmin, 0, mapName + " deleted from call center map by user."); } } }
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; }