private void deleteBtn_Click(object sender, EventArgs e) { ReadOnlyValues(true); ChangeToEditMode(false); AdventureLogic adventureLogic = new AdventureLogic(); foreach (Adventure adventure in currentLocation.Adventures) { Adventure myAdventure = adventureLogic.GetAdventure(adventure.AdventureID); adventureLogic.DeleteAdventure(myAdventure); } locationLogic.DeleteLocation(currentLocation); MessageBox.Show("Location has been deleted", "Success"); Reload(); }
private void searchById_Click(object sender, EventArgs e) { if (Int32.TryParse(advIDTxtBx.Text, out int result)) { currentAdventure = adventureLogic.GetAdventure(result); if (currentAdventure != null) { Display(); prevBtn.Visible = false; nextBtn.Visible = false; } else { MessageBox.Show("Adventure not found!", "Error 404"); } } else { MessageBox.Show("ID must be numeric!", "Error"); } }