public void ChangePlayer() { if (selectedPlayer >= 0) { Player player = activeTournament.GetPlayerByNr(selectedPlayer); NewPlayerDialog npd = new NewPlayerDialog(activeTournament.Nicknames, player); npd.Title = "Spieler " + player.Nickname + " ändern"; npd.ButtonOKContent = "Änderung übernehmen"; npd.Run(); if (npd.DialogReturn && npd.Changes) { Player xwp = new Player(npd.GetNickName(), npd.SquadPoints, Player.StringToFaction(npd.GetFaction())); xwp.Team = npd.GetTeam(); xwp.Name = npd.GetName(); xwp.Forename = npd.GetForename(); xwp.Nr = player.Nr; xwp.WonFreeticket = npd.FreeTicket(); xwp.SquadListGiven = npd.SquadListGiven(); xwp.Payed = npd.Paid(); activeTournament.ChangePlayer(xwp); RefreshDataGridPlayer(activeTournament.Participants); } npd.Destroy(); } }
protected void NewPlayer_Click(object sender, EventArgs e) { NewPlayerDialog npd = new NewPlayerDialog(activeTournament.Nicknames); npd.Run(); if (npd.DialogReturn) { Player xwp = new Player(npd.GetNickName(), npd.SquadPoints, Player.StringToFaction(npd.GetFaction())); xwp.Team = npd.GetTeam(); xwp.Name = npd.GetName(); xwp.Forename = npd.GetForename(); xwp.WonFreeticket = npd.FreeTicket(); xwp.SquadListGiven = npd.SquadListGiven(); xwp.Payed = npd.Paid(); AddPlayer(xwp); } npd.Destroy(); }