Ejemplo n.º 1
0
        public ResultsListExporter(IRulesRepository rulesRepository)
        {
            AddAthleteField("Athlete.AthleteId", "ID", e => e.AthleteId);
            AddAthleteField("Athlete.FirstName", "First name", e => e.FirstName);
            AddAthleteField("Athlete.Surname", "Surname", e => e.Surname);
            AddAthleteField("Athlete.FullName", "Name", e => ExportedTableColumnExtractors.AthleteFullName(e));
            AddAthleteField("Athlete.Club", "Club", e => e.Club);
            AddAthleteField("Athlete.CountryName", "Country", e => e.CountryName);
            AddAthleteField("Athlete.Sex", "Sex", e => e.Sex);
            AddAthleteField("Athlete.Category", "Category", e => e.Category);
            AddAthleteField("Athlete.ModeratorNotes", "Notes", e => e.ModeratorNotes);

            AddResultsField("Announcement.Duration", "Announced", e => ExportedTableColumnExtractors.PerformanceDuration(e.Announcement?.Performance));
            AddResultsField("Announcement.Depth", "Announced", e => ExportedTableColumnExtractors.PerformanceDepth(e.Announcement?.Performance));
            AddResultsField("Announcement.Distance", "Announced", e => ExportedTableColumnExtractors.PerformanceDistance(e.Announcement?.Performance));
            AddResultsField("Announcement.Points", "Announced", e => ExportedTableColumnExtractors.PerformancePoints(e.Announcement?.Performance));
            AddResultsField("Announcement.Combined", "Announced", e => ExportedTableColumnExtractors.PerformanceCombined(e.Announcement?.Performance));

            AddResultsField("CurrentResult.Actual.Duration", "Realized", e => ExportedTableColumnExtractors.PerformanceDuration(e.CurrentResult?.Performance));
            AddResultsField("CurrentResult.Actual.Depth", "Realized", e => ExportedTableColumnExtractors.PerformanceDepth(e.CurrentResult?.Performance));
            AddResultsField("CurrentResult.Actual.Distance", "Realized", e => ExportedTableColumnExtractors.PerformanceDistance(e.CurrentResult?.Performance));
            AddResultsField("CurrentResult.Actual.Points", "Realized", e => ExportedTableColumnExtractors.PerformancePoints(e.CurrentResult?.Performance));
            AddResultsField("CurrentResult.Actual.Combined", "Realized", e => ExportedTableColumnExtractors.PerformanceCombined(e.CurrentResult?.Performance));

            AddResultsField("CurrentResult.Final.Duration", "Realized", e => ExportedTableColumnExtractors.PerformanceDuration(e.CurrentResult?.FinalPerformance));
            AddResultsField("CurrentResult.Final.Depth", "Realized", e => ExportedTableColumnExtractors.PerformanceDepth(e.CurrentResult?.FinalPerformance));
            AddResultsField("CurrentResult.Final.Distance", "Realized", e => ExportedTableColumnExtractors.PerformanceDistance(e.CurrentResult?.FinalPerformance));
            AddResultsField("CurrentResult.Final.Points", "Realized", e => ExportedTableColumnExtractors.PerformancePoints(e.CurrentResult?.FinalPerformance));
            AddResultsField("CurrentResult.Final.Combined", "Realized", e => ExportedTableColumnExtractors.PerformanceCombined(e.CurrentResult?.FinalPerformance));

            AddResultsField("FinalPoints", "Points", e => ExportedTableColumnExtractors.Points(e.FinalPoints));
            AddResultsField("FinalPointsTotal", "", e => ExportedTableColumnExtractors.Points(e.FinalPoints));
        }
Ejemplo n.º 2
0
        public StartingListExporter(IRulesRepository rulesRepository)
        {
            availableColumns = new Dictionary <string, IExportedTableColumn <StartingListReportEntry> >();

            AddColumn("Athlete.AthleteId", "ID", e => e.Athlete.AthleteId);
            AddColumn("Athlete.FirstName", "First name", e => e.Athlete.FirstName);
            AddColumn("Athlete.Surname", "Surname", e => e.Athlete.Surname);
            AddColumn("Athlete.FullName", "Name", e => ExportedTableColumnExtractors.AthleteFullName(e.Athlete));
            AddColumn("Athlete.Club", "Club", e => e.Athlete.Club);
            AddColumn("Athlete.CountryName", "Country", e => e.Athlete.CountryName);
            AddColumn("Athlete.Sex", "Sex", e => e.Athlete.Sex);
            AddColumn("Athlete.Category", "Category", e => e.Athlete.Category);
            AddColumn("Athlete.ModeratorNotes", "Notes", e => e.Athlete.ModeratorNotes);

            AddColumn("Discipline.DisciplineId", "Discipline", e => e.Discipline.DisciplineId);
            AddColumn("Discipline.Name", "Discipline", e => e.Discipline.Name);
            AddColumn("Discipline.Rules", "Rules", e => e.Discipline.Rules);

            AddColumn("Announcement.Duration", "Announced", e => ExportedTableColumnExtractors.PerformanceDuration(e.Announcement?.Performance));
            AddColumn("Announcement.Depth", "Announced", e => ExportedTableColumnExtractors.PerformanceDepth(e.Announcement?.Performance));
            AddColumn("Announcement.Distance", "Announced", e => ExportedTableColumnExtractors.PerformanceDistance(e.Announcement?.Performance));
            AddColumn("Announcement.Points", "Announced", e => ExportedTableColumnExtractors.PerformancePoints(e.Announcement?.Performance));
            AddColumn(new ExportedTableColumnPrimaryComponent <StartingListReportEntry>(
                          "Announcement.Primary", "Announced", rulesRepository, e => e.Discipline.Rules, e => e.Announcement?.Performance));

            AddColumn("Start.StartingLaneId", "Lane", e => e.Start.StartingLaneId);
            AddColumn("Start.StartingLaneLongName", "Lane", e => e.Start.StartingLaneLongName);
            AddColumn("Start.WarmUpTime", "WU", e => ExportedTableColumnExtractors.StartTime(e.Start.WarmUpTime));
            AddColumn("Start.OfficialTop", "OT", e => ExportedTableColumnExtractors.StartTime(e.Start.OfficialTop));

            AddColumn("CurrentResult.Actual.Duration", "Realized", e => ExportedTableColumnExtractors.PerformanceDuration(e.CurrentResult?.FinalPerformance));
            AddColumn("CurrentResult.Actual.Depth", "Realized", e => ExportedTableColumnExtractors.PerformanceDepth(e.CurrentResult?.FinalPerformance));
            AddColumn("CurrentResult.Actual.Distance", "Realized", e => ExportedTableColumnExtractors.PerformanceDistance(e.CurrentResult?.FinalPerformance));
            AddColumn("CurrentResult.Actual.Points", "Realized", e => ExportedTableColumnExtractors.PerformancePoints(e.CurrentResult?.FinalPerformance));
            AddColumn(new ExportedTableColumnPrimaryComponent <StartingListReportEntry>(
                          "CurrentResult.Actual.Primary", "Realized", rulesRepository, e => e.Discipline.Rules, e => e.CurrentResult?.Performance));

            AddColumn("CurrentResult.Final.Duration", "Realized", e => ExportedTableColumnExtractors.PerformanceDuration(e.CurrentResult?.FinalPerformance));
            AddColumn("CurrentResult.Final.Depth", "Realized", e => ExportedTableColumnExtractors.PerformanceDepth(e.CurrentResult?.FinalPerformance));
            AddColumn("CurrentResult.Final.Distance", "Realized", e => ExportedTableColumnExtractors.PerformanceDistance(e.CurrentResult?.FinalPerformance));
            AddColumn("CurrentResult.Final.Points", "Realized", e => ExportedTableColumnExtractors.PerformancePoints(e.CurrentResult?.FinalPerformance));
            AddColumn(new ExportedTableColumnPrimaryComponent <StartingListReportEntry>(
                          "CurrentResult.Final.Primary", "Realized", rulesRepository, e => e.Discipline.Rules, e => e.CurrentResult?.Performance));

            AddColumn("CurrentResult.CardResult", "Card", e => e.CurrentResult?.CardResult);
            AddColumn("CurrentResult.JudgeComment", "Comment", e => e.CurrentResult?.JudgeComment);

            minimal = BuildExporter(
                "Athlete.FullName",
                "Athlete.CountryName",
                "Start.OfficialTop",
                "Start.StartingLaneLongName",
                "Announcement.Primary"
                );
            running = BuildExporter(
                "Athlete.FullName",
                "Athlete.CountryName",
                "Start.OfficialTop",
                "Start.StartingLaneLongName",
                "Announcement.Primary",
                "CurrentResult.Actual.Primary",
                "CurrentResult.CardResult",
                "CurrentResult.JudgeComment"
                );
        }