Example #1
0
 /// <summary>
 /// Utilizes PlayerEditor form to edit a player's values.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void uxEditPlayer_Click(object sender, EventArgs e)
 {
     if (SelectedListBox != null)
     {
         PlayerDto player = (PlayerDto)SelectedListBox.SelectedItem;
         if (player != null)
         {
             _mflController.RemovePlayerFromTeam(player);
             PlayerEditor playerEditor = new PlayerEditor(player);
             if (playerEditor.ShowDialog() == DialogResult.OK)
             {
                 _mflController.AddPlayerToTeam(player);
                 LoadListBoxes();
             }
             else
             {
                 _mflController.AddPlayerToTeam(player);
             }
             SetTeam();
         }
     }
     else
     {
         MessageBox.Show(@"Error - Invalid Player");
     }
 }
Example #2
0
        /// <summary>
        /// Utilizes the PlayerEditor form to create a player.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void uxCreatePlayer_Click(object sender, EventArgs e)
        {
            PlayerEditor playerEditor = new PlayerEditor();

            if (playerEditor.ShowDialog() == DialogResult.OK)
            {
                _mflController.AddPlayer(playerEditor.Player);
                LoadListBoxes();
            }
        }