示例#1
0
        public void CreateTeam()
        {
            TeamModel team = new TeamModel(TeamName);

            SqlDataHandler.CreateTeam(team);

            foreach (PlayerModel player in TeamMembers)
            {
                team.TeamMembers.Add(player);
                SqlDataHandler.CreateTeamMembers(team, player);
            }

            if (_tournamentCreationView != null)
            {
                var conductor = Parent as IConductor;
                _tournamentCreationView.TournamentTeams.Add(team);
                conductor.ActivateItem(_tournamentCreationView);
            }
            else
            {
                TeamName = "";
                TeamMembers.Clear();
                ErrorMessage = null;
            }
        }