コード例 #1
0
ファイル: OlympiadViewModel.cs プロジェクト: TorideX/Olympics
 private void FillParticipantEventChanged()
 {
     FillParticipantSportsmen.Clear();
     FillParticipantParticipants.Clear();
     if (FillParticipantOlympiad != null && FillParticipantEvent != null)
     {
         foreach (var item in db.Olympiads.ToList().First(o => o.Id == FillParticipantOlympiad.Id).Events.First(e => e.Id == FillParticipantEvent.Id).Participants)
         {
             FillParticipantParticipants.Add(item);
         }
     }
 }
コード例 #2
0
ファイル: OlympiadViewModel.cs プロジェクト: TorideX/Olympics
        private void FillParticipantParticipantChanged()
        {
            FillParticipantSportsmen.Clear();
            MedalSportsmen.Clear();

            if (FillParticipantOlympiad != null && FillParticipantEvent != null && FillParticipantParticipant != null)
            {
                foreach (var item in db.Sportsmen.ToList().Where(s => s.Country == FillParticipantParticipant.Country && s.Sport == FillParticipantEvent.Sport))
                {
                    FillParticipantSportsmen.Add(item);
                }
                FillSportsmanCount = FillParticipantSportsmen.Count;


                foreach (var item in db.Participants.ToList().First(p => p.Id == FillParticipantParticipant.Id).Medals)
                {
                    MedalSportsmen.Add(item);
                }
                MedalSportsmenCount = MedalSportsmen.Count;
            }
        }