private void viewAdventures_Click(object sender, EventArgs e)
        {
            AdventureLogic     adventureLogic = new AdventureLogic();
            string             caption        = person.Name + "'s Adventures";
            AdventuresViewForm myForm         = new AdventuresViewForm(adventureLogic.GetAllAdventuresByPersonID(person.PersonID).ToList(), caption, number);

            myForm.ShowDialog();
        }
Esempio n. 2
0
        public void GenerateAdventures(int personID, int numberOfAdventures, Random rand)
        {
            AdventureLogic adventure = new AdventureLogic();

            for (int i = 0; i < numberOfAdventures; i++)
            {
                adventure.Generate(rand.Next(1, 20), personID, rand);
            }
        }
        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();
        }