Esempio n. 1
0
        /// <summary>
        /// Показывает форму участника и возвращает сведения об участнике
        /// </summary>
        /// <returns>Сведения об участнике или null</returns>
        private Player GetNewPlayer()
        {
            if (playerForm == null)
            {
                playerForm = new PlayerForm();
            }
            else
            {
                playerForm.Player = null;
            }
            playerForm.ShowDialog(this);
            var player = playerForm.Player;

            return(player);
        }
Esempio n. 2
0
        private void EditRow()
        {
            var row = gridPlayers.CurrentRow;

            if (row != null)
            {
                var player = (Player)row.Tag;
                if (playerForm == null)
                {
                    playerForm = new PlayerForm(player ?? new Player {
                        Location = name.Text
                    });
                }
                else
                {
                    playerForm.Player = player ?? new Player {
                        Location = name.Text
                    }
                };
                playerForm.ShowDialog(this);
                if (playerForm.Player != null)
                {
                    row.Tag = playerForm.Player;
                    row.Cells[ColName.Index].Value  = playerForm.Player.Name;
                    row.Cells[ColTitle.Index].Value = playerForm.Player.Grade.ShortName;
                }
                CheckSaveButton();
            }
        }
    }