internal Structs.Competitor[] GetCompetitors(Structs.Club ClubToFetch, Structs.ResultWeaponsClass wclass, string sorting) { Trace.WriteLine("CDatabase: Entering getCompetitors(" + ClubToFetch.ToString() + ", " + wclass + ")"); Structs.CompetitionTypeEnum compType = getCompetitions()[0].Type; ArrayList competitors = new ArrayList(); Structs.Competitor competitor = new Structs.Competitor(); foreach(DatabaseDataset.ShootersRow shooter in Database.Shooters.Select("ClubId='" + ClubToFetch.ClubId + "'", sorting)) { DatabaseDataset.CompetitorsRow[] compRows = shooter.GetCompetitorsRows(); foreach(DatabaseDataset.CompetitorsRow compRow in compRows) { Structs.Weapon weapon = MyInterface.GetWeapon(compRow.WeaponId); if (CConvert.ConvertWeaponsClassToResultClass(weapon.WClass, compType) == wclass) { Structs.Competitor comp = MyInterface.GetCompetitor(compRow.CompetitorId); competitors.Add(comp); } } } return (Structs.Competitor[])competitors.ToArray(competitor.GetType()); }
internal Structs.Competitor[] getCompetitors() { Trace.WriteLine("CDatabase: Entering getCompetitors()"); ArrayList competitors = new ArrayList(); Structs.Competitor competitor = new Structs.Competitor(); foreach(DatabaseDataset.CompetitorsRow row in Database.Competitors) { competitor = new Structs.Competitor(); competitor.CompetitionId = row.CompetitionId; competitor.CompetitorId = row.CompetitorId; competitor.ShooterClass = (Structs.ShootersClass)row.ShooterClass; if (row.IsPatrolIdNull()) competitor.PatrolId = -1; else competitor.PatrolId = row.PatrolId; competitor.ShooterId = row.ShooterId; competitor.WeaponId = row.WeaponId; if (row.IsLaneNull()) competitor.Lane = -1; else competitor.Lane = row.Lane; competitor.FinalShootingPlace = row.FinalShootingPlace; competitors.Add(competitor); } return (Structs.Competitor[])competitors.ToArray(competitor.GetType()); }