public InfoTeamWindow(TeamT team) { InitializeComponent(); Team = team; Players = Team.PlayerT.ToList(); DataContext = this; }
private void AddButton(object sender, RoutedEventArgs e) { if (StackAdd.Children.OfType <TextBox>().Any(x => x.Text == "") || StackAdd.Children.OfType <ComboBox>().Any(x => x.SelectedIndex < 0)) { MessageBox.Show("Заполните все поля"); return; } Teams.Photo = BArray; Teams.StatisticTeamT = new StatisticTeamT(); try { Connection.NewInstance().TeamT.Add(Teams); Connection.NewInstance().SaveChanges(); } catch (Exception ex) { Connection.NewInstance().TeamT.Remove(Teams); MessageBox.Show(ex.Message, "Ошибка заполнения данных"); } finally { DataContext = null; Countries = Connection.NewInstance().CountryT.ToList(); Stadiums = Connection.NewInstance().StadiumT.ToList(); Teams = new TeamT(); PhotoImage.Source = null; BArray = null; DataContext = this; StackAdd.Children.OfType <TextBox>().ToList().ForEach(tb => tb.Text = String.Empty); StackAdd.Children.OfType <ComboBox>().ToList().ForEach(cb => cb.SelectedIndex = -1); } }
public CreateClubPage() { InitializeComponent(); Countries = Connection.NewInstance().CountryT.ToList(); Stadiums = Connection.NewInstance().StadiumT.ToList(); Teams = new TeamT(); DataContext = this; }
public void ResetStats(bool resetTeams = true) { DispatcherHelper.CheckBeginInvokeOnUI(delegate { AverageHealthDamage = 0; AverageHltvRating = 0; AverageEseaRws = 0; AssistPerRound = 0; DeathPerRound = 0; KillPerRound = 0; DamageHealthCount = 0; DamageArmorCount = 0; MvpCount = 0; KillCount = 0; KnifeKillCount = 0; TeamKillCount = 0; HeadshotCount = 0; AssistCount = 0; DeathCount = 0; SmokeThrownCount = 0; FlashbangThrownCount = 0; HeadshotCount = 0; DecoyThrownCount = 0; MolotovThrownCount = 0; IncendiaryThrownCount = 0; HitCount = 0; WeaponFiredCount = 0; AssistPerRound = 0; DeathPerRound = 0; OneKillCount = 0; TwoKillCount = 0; ThreeKillCount = 0; FourKillCount = 0; FiveKillCount = 0; ScoreTeam1 = 0; ScoreTeam2 = 0; ScoreFirstHalfTeam1 = 0; ScoreFirstHalfTeam2 = 0; ScoreSecondHalfTeam1 = 0; ScoreSecondHalfTeam2 = 0; Rounds.Clear(); WeaponFired.Clear(); Kills.Clear(); Overtimes.Clear(); PositionPoints.Clear(); MolotovsFireStarted.Clear(); DecoyStarted.Clear(); BombPlanted.Clear(); BombDefused.Clear(); BombExploded.Clear(); BombPlanted.Clear(); BombDefused.Clear(); BombExploded.Clear(); ClutchCount = 0; ClutchLostCount = 0; ClutchWonCount = 0; EntryKillCount = 0; MostBombPlantedPlayer = null; MostEntryKillPlayer = null; MostHeadshotPlayer = null; MostKillingWeapon = null; HasCheater = false; PlayersHurted.Clear(); PlayerBlinded.Clear(); Winner = null; Surrender = null; if (resetTeams) { Players.Clear(); TeamCT.Clear(); TeamT.Clear(); } else { foreach (Player playerExtended in Players) { playerExtended.ResetStats(); } } }); }
private void ComboBoxClub(object sender, SelectionChangedEventArgs e) { Team = ClubComboBox.SelectedItem as TeamT; }
private void NameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { Team = NameComboBox?.SelectedItem as TeamT; }