Beispiel #1
0
        public void VerifyPlayer(IVerifyUserView inForm, Player player, IPlayerRepository playerRepository, ITrainerRepository trainerRepository, ITeamRepository teamRepository)
        {
            inForm.SetPlayerValues(player);
            var result = inForm.ShowViewModal();

            if (result == DialogResult.OK)
            {
                playerRepository.Verify(player);
                _form.DisplayPlayerList(playerRepository.GetAll(), teamRepository.GetAll());
            }
            else if (result == DialogResult.No)
            {
                playerRepository.Delete(player);
            }
            _form.DisplayRegisterRequests(playerRepository.GetAll(), trainerRepository.GetAll());
        }
Beispiel #2
0
        public void ShowPlayerOptions(IAdminView parentForm, IAdminPlayerOptionsView form, Player player, IPlayerRepository playerRepository, ITeamRepository teamRepository, ITransactionRepository transactionRepository)
        {
            form.DisplayTransactionList(transactionRepository.GetAll());
            form.SetPlayerValues(player, teamRepository.GetAll());
            var result = form.ShowViewModal();

            if (result == DialogResult.Yes)
            {
                teamRepository.AddPlayerToTeam(player, playerRepository);
            }
            else if (result == DialogResult.No)
            {
                teamRepository.RemovePlayerFromTeam(player, playerRepository);
            }
            else if (result == DialogResult.Abort)
            {
                teamRepository.DeletePlayer(player, playerRepository);
            }
            parentForm.DisplayPlayerList(playerRepository.GetAll(), teamRepository.GetAll());
            parentForm.DisplayTeamList(teamRepository.GetAll());
        }