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 butAddRoom_Click(object sender, EventArgs e) { long mapAreaContainerNum = ListMaps.Max(x => x.MapAreaContainerNum) + 1; MapAreaContainer newMap = new MapAreaContainer(mapAreaContainerNum, 71, 57, 17, false, true, "New Room"); ListMaps.Add(newMap); comboRoom.Items.Clear(); foreach (MapAreaContainer mapCur in ListMaps) { comboRoom.Items.Add(mapCur.Description); } comboRoom.SelectedIndex = comboRoom.Items.Count - 1; _mapCur = ListMaps[ListMaps.Count - 1]; FillSettings(); FillMap(); }
private void mapToolStripMenuItem_Click(object sender, EventArgs e) { if (!Security.IsAuthorized(Permissions.Setup)) { return; } FormMapSetup FormMS = new FormMapSetup(); FormMS.ShowDialog(); if (FormMS.DialogResult != DialogResult.OK) { return; } _listMaps = FormMS.ListMaps; _mapCur = _listMaps[comboRoom.SelectedIndex]; FillCombo(); FillMapAreaPanel(); SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "MapHQ layout changed"); }
private void comboRoom_SelectionChangeCommitted(object sender, EventArgs e) { _mapCur = ListMaps[comboRoom.SelectedIndex]; FillSettings(); }
private void comboRoom_SelectionChangeCommitted(object sender, EventArgs e) { _mapCur = _listMaps[comboRoom.SelectedIndex]; FillMapAreaPanel(); FillTriageLabelColors(); }