private void btnSeedFinish_Click(object sender, EventArgs e) { if (!fStartCompetition.ShowStartWindow(FCompetitionController)) { return; } /* Начало изменений */ SeedingArgs args = SeedingArgs.Empty; args.PlayersToSeed = FCompetition.Players; args.SeedOrder = FCompetitionController.GetDrawOrder(args.PlayersToSeed.Count); args.SeedType = Seeding.SeedType.Matches; args.AllowRating = FCompetition.Info.ChangesRating; if (FCompetition is Olympic) { args.SeedType = Seeding.SeedType.Olympic; args.LastPlayerWithBay = 0; } if (FCompetition is RobinOlympic) { args.SeedType = Seeding.SeedType.Groups; int playersInGroup = FCompetition.Players.Count / (FCompetition as RobinOlympic).GroupCount; if (playersInGroup * (FCompetition as RobinOlympic).GroupCount < FCompetition.Players.Count) { playersInGroup++; } args.Param = playersInGroup; } //if (fGraphicalSeeding.Seed(args) /*конец изменений*/&& fStartCompetition.ShowStartWindow(FCompetitionController)) if (fGraphicalSeeding.Seed(args)) { if (pnlCompetitionParams != null) { pnlCompetitionParams.ReadParameters(); } string error = ""; if (!FCompetition.CheckCompetitionParams(ref error)) { if (error != "") { WindowSkin.MessageBox.Show(error, Localizator.Dictionary.GetString("PARAMS_ERROR")); } return; } LongOpertationExecutor.Execute(SeedPlayers); pnlCompetition.OpenCompetition(FCompetition); tcMain.SelectedTab = tpgCompetition; FCompetition.Info.Status = CompetitionInfo.CompetitionState.Playing; DatabaseManager.CurrentDb.CompetitionInfoSave(FCompetition.Info); UpdateButtons(); } }
private void btnPlayersList_Click(object sender, EventArgs e) { CompetitionPlayerList listA = FCompetition.Players; List <int> listB = new List <int>(); foreach (int id in listA.Keys) { listB.Add(id); } if (fPlayerSelect.Select(FCompetition.Info.SportType.Id, listA)) { LongOpertationExecutor.Execute(SaveCompetitionPlayers, listA, listB); } }
private void OnNextRound(object sender, EventArgs e) { try { LongOpertationExecutor.Execute(SeedPlayers); pnlCompetition.OpenCompetition(FCompetition); DatabaseManager.CurrentDb.CompetitionInfoSave(FCompetition.Info); btnFinish.Enabled = false; } catch (Exception ex) { WindowSkin.MessageBox.Show(ex.Message, Localizator.Dictionary.GetString("ERROR")); } }
private void btnSeedRating_Click(object sender, EventArgs e) { LongOpertationExecutor.Execute(SeedRating); UpdateCompetitionPlayersGrid(); }