private List <Result> GetResults200m(string competition)
        {
            DatabaseApi.SelectCompetition200m(competition);
            var settings      = SettingsHelper.GetSettings();
            var rawResults    = DatabaseApi.LoadCompetitionFromTable(TableName.OrionResult);
            var registrations = DatabaseApi.LoadCompetitionFromTable(TableName.LeonRegistration);
            var actualResults = this.AddNewResults(rawResults.OfType <OrionResult>().ToList(), settings);
            var results       = BuildResultObjects(actualResults);

            foreach (var item in results)
            {
                if (registrations.Any())
                {
                    var registration = registrations.OfType <LeonPerson>().Last(r => r.ShooterId == item.ShooterId);
                    if (registration != null)
                    {
                        item.Name     = registration.Name;
                        item.Class    = registration.Class;
                        item.ClubName = registration.ClubName;
                    }
                }
            }

            return(results);
        }
Exemple #2
0
        private List <Result> GetResults200m(string competition)
        {
            DatabaseApi.SelectCompetition200m(competition);
            var settings      = SettingsHelper.GetSettings();
            var rawResults    = DatabaseApi.LoadCompetitionFromTable(TableName.OrionResult);
            var actualResults = this.AddNewResults(rawResults.OfType <OrionResult>().ToList(), settings);

            return(BuildResultObjects(actualResults));
        }
        private List <Registration> GetRegistrations200m(string competition)
        {
            DatabaseApi.SelectCompetition200m(competition);
            var rawResults = DatabaseApi.LoadCompetitionFromTable(TableName.LeonRegistration);
            var actualRegs = this.AddNewRegistrations(rawResults.OfType <LeonPerson>().ToList());
            var results    = this.GetResults200m(competition);

            foreach (var result in results)
            {
                var reg = actualRegs.SingleOrDefault(r => r.ShooterId == result.ShooterId);
                if (reg != null)
                {
                    reg.Result = result;
                }
            }

            return(actualRegs);
        }