private void viewHome_Click(object sender, EventArgs e) { LocationLogic locationLogic = new LocationLogic(); string caption = person.Name + "'s Hometown"; LocationViewForm myForm = new LocationViewForm(locationLogic.GetLocation(person.HomeTownLocationID), caption, number); myForm.ShowDialog(); }
private void newBtn_Click(object sender, EventArgs e) { PersonLogic personLogic = new PersonLogic(); LocationLogic locationLogic = new LocationLogic(); Random rand = new Random(); currentAdventure = adventureLogic.Generate(rand.Next(1, 20), personLogic.GetRandomID(rand), rand); currentAdventure.Person = personLogic.GetPerson(currentAdventure.MainPersonID); currentAdventure.Location = locationLogic.GetLocation(currentAdventure.WhereToLocationID); Display(); }
private void searchIDBtn_Click(object sender, EventArgs e) { if (Int32.TryParse(idTxtBx.Text, out int result)) { currentLocation = locationLogic.GetLocation(result); if (currentLocation != null) { Display(); prevBtn.Visible = false; nextBtn.Visible = false; } else { MessageBox.Show("Location not found!", "Error 404"); } } else { MessageBox.Show("ID must be numeric!", "Error"); } }