/// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- /// <name>LoadAthleteInformation</name> /// <date>14/03/15</date> /// <summary> /// Loads the athlete information via the business library and adds it to the athlete collection. /// </summary> /// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- private void LoadAthleteInformation() { List <AthleteDetails> orderedList = this.model.Athletes.AthleteDetails.OrderBy(athlete => athlete.Forename).ToList(); orderedList = orderedList.OrderBy(athlete => athlete.Surname).ToList(); this.athleteCollection = new ObservableCollection <AthleteType>(); foreach (AthleteDetails athlete in orderedList) { this.athleteCollection.Add( new AthleteType( athlete.Key, athlete.Name, athlete.Club, athlete.Sex, ListOCConverter.ToObservableCollection(athlete.RunningNumbers), athlete.BirthDate.BirthYear, athlete.BirthDate.BirthMonth, athlete.BirthDate.BirthDay, athlete.SignedConsent, athlete.Active, athlete.PredeclaredHandicap.ToString())); } this.AthletesRaisePropertyChanged(); }
//athleteCurrentSeason.Points.BestPoints)); /// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- /// <name>LoadAthleteInformation</name> /// <date>14/03/15</date> /// <summary> /// Loads the athlete information via the business library and adds it to the athlete collection. /// </summary> /// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- private void LoadAthleteInformation(List <AthleteDetails> athletes) { NormalisationConfigType hcConfiguration = this.normalisationConfigManager.ReadNormalisationConfiguration(); List <AthleteDetails> orderedList = athletes.OrderBy(athlete => athlete.Forename).ToList(); orderedList = orderedList.OrderBy(athlete => athlete.Surname).ToList(); this.AthleteCollection = new ObservableCollection <AthleteCompleteViewModel>(); foreach (AthleteDetails athlete in orderedList) { AthleteSeasonDetails athleteCurrentSeason = this.model.CurrentSeason.Athletes.Find(a => a.Key == athlete.Key); if (athleteCurrentSeason == null) { athleteCurrentSeason = new AthleteSeasonDetails( athlete.Key, athlete.Name, this.resultsConfigurationManager); } string handicap = athleteCurrentSeason.GetRoundedHandicap(hcConfiguration)?.ToString() ?? athlete.RoundedHandicap.ToString(); this.AthleteCollection.Add( new AthleteCompleteViewModel( athlete.Key, athlete.Name, athlete.Club, athlete.Sex.ToString(), handicap, athlete.PB.ToString(), athlete.LastAppearance.ToString(), athlete.Appearances, athlete.SignedConsent, athlete.Active, athleteCurrentSeason.SB.ToString(), ListOCConverter.ToObservableCollection(athlete.RunningNumbers), this.ConvertAppearances(athleteCurrentSeason.Times), this.ConvertAppearances(athlete.Times), athleteCurrentSeason.Points.TotalPoints, athleteCurrentSeason.Points.FinishingPoints, athleteCurrentSeason.Points.PositionPoints, athleteCurrentSeason.Points.BestPoints)); } }
/// <summary> /// Gets the current athlete list and add registered athletes in numerical order. /// </summary> private void GetCurrentAthleteList() { //List<AthleteSeasonDetails> orderedList = Model.Instance.CurrentSeason.Athletes.OrderBy(athlete => athlete.PrimaryNumber).ToList(); RegisteredAthletes = new ObservableCollection <AthleteSeasonBase>(); foreach (AthleteSeasonDetails athlete in this.model.CurrentSeason.Athletes) { RegisteredAthletes.Add( new AthleteSeasonBase( athlete.Key, athlete.Name, ListOCConverter.ToObservableCollection( this.model.Athletes.GetAthleteRunningNumbers( athlete.Key)))); } }