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); }
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; }
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); }
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; }
private void SavePlayers(CompetitionPlayer[] players, string playersPath, HebrewWordInverter inverter) { File.WriteAllLines(playersPath, players.Select(p=>string.Format("{0};;;", inverter.Invert(p.FullName)))); }
private void SavePlayers(CompetitionPlayer[] players, string playersPath, HebrewWordInverter inverter) { File.WriteAllLines(playersPath, players.Select(p => string.Format("{0};;;", inverter.Invert(p.FullName)))); }