private void SetSportaSheet(ExcelWorksheet worksheet)
        {
            ExcelHelper.SetHeader(
                worksheet,
                ExcelExportResources.CompetitionVolgnummer,
                ExcelExportResources.CompetitionIndex,
                ExcelExportResources.CompetitionLidnummer,
                ExcelExportResources.PlayerName,
                ExcelExportResources.PlayerRanking,
                ExcelExportResources.PlayerRankingValue
            );

            int i = 2;
            var rankingValueConverter = new KlassementValueConverter();
            foreach (var player in _players.Where(x => x.ClubIdSporta == Constants.OwnClubId).OrderBy(x => x.VolgnummerSporta))
            {
                worksheet.Cells[i, 1].Value = player.VolgnummerSporta;
                worksheet.Cells[i, 2].Value = player.IndexSporta;
                worksheet.Cells[i, 3].Value = player.LidNummerSporta;
                worksheet.Cells[i, 4].Value = player.Naam;
                worksheet.Cells[i, 5].Value = player.KlassementSporta;
                worksheet.Cells[i, 6].Value = rankingValueConverter.Sporta(player.KlassementSporta);

                i++;
            }
            worksheet.Cells.AutoFitColumns();
        }
        private void SetSportaSheet(ExcelWorksheet worksheet)
        {
            ExcelHelper.SetHeader(
                worksheet,
                ExcelExportResources.CompetitionVolgnummer,
                ExcelExportResources.CompetitionIndex,
                ExcelExportResources.CompetitionLidnummer,
                ExcelExportResources.PlayerName,
                ExcelExportResources.PlayerRanking,
                ExcelExportResources.PlayerRankingValue
                );

            int i = 2;
            var rankingValueConverter = new KlassementValueConverter();

            foreach (var player in _players.Where(x => x.ClubIdSporta == Constants.OwnClubId).OrderBy(x => x.VolgnummerSporta))
            {
                worksheet.Cells[i, 1].Value = player.VolgnummerSporta;
                worksheet.Cells[i, 2].Value = player.IndexSporta;
                worksheet.Cells[i, 3].Value = player.LidNummerSporta;
                worksheet.Cells[i, 4].Value = player.Name;
                worksheet.Cells[i, 5].Value = player.KlassementSporta;
                worksheet.Cells[i, 6].Value = rankingValueConverter.Sporta(player.KlassementSporta);

                i++;
            }
            worksheet.Cells.AutoFitColumns();
        }
 public static void Configure(KlassementValueConverter klassementToValueConverter)
 {
     Factory = new MapperConfiguration(cfg =>
     {
         PlayerMapping(cfg, klassementToValueConverter);
         ClubMapping(cfg);
         MatchMapping(cfg);
         TeamMapping(cfg);
         ReportMapping(cfg);
     });
 }
 private static PlayerCompetition CreateVttlPlayer(KlassementValueConverter converter, int clubId, int uniqueIndex, string frenoyLink, string ranking, int position, int rankingIndex)
 {
     return new PlayerCompetition(
         Competition.Vttl,
         clubId, uniqueIndex, frenoyLink, ranking, position, rankingIndex, converter.Vttl(ranking));
 }
 private static void PlayerMapping(IMapperConfiguration cfg, KlassementValueConverter klassementToValueConverter)
 {
     cfg.CreateMap<PlayerEntity, Player>()
         .ForMember(
             dest => dest.Name,
             opts => opts.MapFrom(src => src.Naam))
         .ForMember(
             dest => dest.Alias,
             opts => opts.MapFrom(src => src.NaamKort))
         .ForMember(
             dest => dest.Active,
             opts => opts.MapFrom(src => !src.IsGestopt))
         .ForMember(
             dest => dest.QuitYear,
             opts => opts.MapFrom(src => src.Gestopt))
         .ForMember(
             dest => dest.Security,
             opts => opts.MapFrom(src => src.Toegang.ToString()))
         .ForMember(
             dest => dest.Style,
             opts => opts.MapFrom(src => new PlayerStyle(src.Id, src.Stijl, src.BesteSlag)))
         .ForMember(
             dest => dest.Contact,
             opts => opts.MapFrom(src => new PlayerContact(src.Id, src.Email, src.Gsm, src.Adres, src.Gemeente)))
         .ForMember(
             dest => dest.Vttl,
             opts => opts.MapFrom(src => src.ClubIdVttl.HasValue ?
                 CreateVttlPlayer(klassementToValueConverter, src.ClubIdVttl.Value, src.ComputerNummerVttl.Value, src.LinkKaartVttl, src.KlassementVttl, src.VolgnummerVttl.Value, src.IndexVttl.Value)
                 : null))
         .ForMember(
             dest => dest.Sporta,
             opts => opts.MapFrom(src => src.ClubIdSporta.HasValue ?
                 CreateSportaPlayer(klassementToValueConverter, src.ClubIdSporta.Value, src.LidNummerSporta.Value, src.LinkKaartSporta, src.KlassementSporta, src.VolgnummerSporta.Value, src.IndexSporta.Value)
                 : null))
         ;
 }