Example #1
0
        //**************************************************************
        //                       Wrestler Functions
        //**************************************************************
        private void btn_newWrestler_Click(object sender, EventArgs e)
        {
            CreateWrestlerForm createWrestlerForm = new CreateWrestlerForm();

            this.Hide();
            createWrestlerForm.ShowDialog();

            if (createWrestlerForm.NewWrestler != null)
            {
                AllWrestlers.Add(createWrestlerForm.NewWrestler);
                lst_allWrestlers.Items.Add(createWrestlerForm.NewWrestler);
            }

            this.Show();
        }
Example #2
0
        private void btn_editWrestler_Click(object sender, EventArgs e)
        {
            if (lst_allWrestlers.SelectedIndex != -1)
            {
                CreateWrestlerForm createWrestlerForm = new CreateWrestlerForm((Wrestler)lst_allWrestlers.SelectedItem);
                this.Hide();
                createWrestlerForm.ShowDialog();

                if (createWrestlerForm.NewWrestler != null)
                {
                    AllWrestlers[lst_allWrestlers.SelectedIndex]           = createWrestlerForm.NewWrestler;
                    lst_allWrestlers.Items[lst_allWrestlers.SelectedIndex] = createWrestlerForm.NewWrestler;
                }
            }
            else
            {
                MessageBox.Show("Please select a valid wrestler");
            }

            this.Show();
        }