コード例 #1
0
        private DrawGeneratorInfo GetGenerateInfo(CompetitionDetails details, HebrewWordInverter inverter)
        {
            var result = GetDefaultGenerateInfo();

            result.DrawTitle      = inverter.Invert(details.Name);
            result.DrawType       = inverter.Invert(details.SitePhone) + ", " + inverter.Invert(details.Site);
            result.DrawOtherInfo  = inverter.Invert(details.MainRefereePhone) + ", " + inverter.Invert(details.MainRefereeName);
            result.DocumentAuthor = "Simple. SAMS - ITA " + DateTime.Now.Year.ToString();

            return(result);
        }
コード例 #2
0
        public string Generate(CompetitionDetails details, CompetitionSection section)
        {
            var name = string.Format("{0}-{1}-{2}-{3}", details.Name, details.Id, Guid.NewGuid(), section);
            var outputPath = Path.Combine(m_targetPath, name + ".pdf");
            var infoPath = Path.Combine(m_targetPath, name + ".pcdf");
            var playersPath = Path.Combine(m_targetPath, name + ".players.csv");
            var schedulePath = Path.Combine(m_targetPath, name + ".schedule.csv");
            var inverter = new HebrewWordInverter();
            var info = GetGenerateInfo(details, inverter);
            
            var players = details.Players.Where(p => p.Section == section).ToArray();
            var matches = details.Matches.Where(m => m.Section == section).ToArray();
            SavePlayers(players, playersPath, inverter);
            SaveSchedule(matches, players, schedulePath);
            info.DataParticipantsFile = playersPath;
            info.DataScheduleFile = schedulePath;

            info.Write(infoPath);
            GeneratePdf(infoPath, outputPath);
            return outputPath;
        }
コード例 #3
0
        public string Generate(CompetitionDetails details, CompetitionSection section)
        {
            var name         = string.Format("{0}-{1}-{2}-{3}", details.Name, details.Id, Guid.NewGuid(), section);
            var outputPath   = Path.Combine(m_targetPath, name + ".pdf");
            var infoPath     = Path.Combine(m_targetPath, name + ".pcdf");
            var playersPath  = Path.Combine(m_targetPath, name + ".players.csv");
            var schedulePath = Path.Combine(m_targetPath, name + ".schedule.csv");
            var inverter     = new HebrewWordInverter();
            var info         = GetGenerateInfo(details, inverter);

            var players = details.Players.Where(p => p.Section == section).ToArray();
            var matches = details.Matches.Where(m => m.Section == section).ToArray();

            SavePlayers(players, playersPath, inverter);
            SaveSchedule(matches, players, schedulePath);
            info.DataParticipantsFile = playersPath;
            info.DataScheduleFile     = schedulePath;

            info.Write(infoPath);
            GeneratePdf(infoPath, outputPath);
            return(outputPath);
        }
コード例 #4
0
 private DrawGeneratorInfo GetGenerateInfo(CompetitionDetails details, HebrewWordInverter inverter)
 {
     var result = GetDefaultGenerateInfo();
     
     result.DrawTitle = inverter.Invert(details.Name);
     result.DrawType = inverter.Invert(details.SitePhone) + ", " + inverter.Invert(details.Site);
     result.DrawOtherInfo = inverter.Invert(details.MainRefereePhone) + ", " + inverter.Invert(details.MainRefereeName);
     result.DocumentAuthor = "Simple. SAMS - ITA " + DateTime.Now.Year.ToString();
     
     return result;
 }
コード例 #5
0
 private void SavePlayers(CompetitionPlayer[] players, string playersPath, HebrewWordInverter inverter)
 {
     File.WriteAllLines(playersPath, players.Select(p=>string.Format("{0};;;", inverter.Invert(p.FullName))));
 }
コード例 #6
0
 private void SavePlayers(CompetitionPlayer[] players, string playersPath, HebrewWordInverter inverter)
 {
     File.WriteAllLines(playersPath, players.Select(p => string.Format("{0};;;", inverter.Invert(p.FullName))));
 }