private Paragraph Organisation(CompetitionInfosViewModel zusatzInfos) { Paragraph paragraph = new Paragraph(); var ft = paragraph.AddFormattedText($"{Resources.LanguageFiles.DictPluginMain.Organization}:", TextFormat.Bold); ft.Underline = Underline.Single; paragraph.AddLineBreak(); paragraph.AddFormattedText("Protokoll: ", TextFormat.Bold); paragraph.AddTab(); paragraph.AddText(zusatzInfos.Protokollfuehrer); paragraph.AddLineBreak(); paragraph.AddFormattedText("Punktzettel: ", TextFormat.Bold); paragraph.AddTab(); paragraph.AddText(zusatzInfos.ErgebnislistenSchreiber); foreach (var ordner in zusatzInfos.Ordner) { paragraph.AddLineBreak(); paragraph.AddFormattedText("Ordner: ", TextFormat.Bold); paragraph.AddTab(); paragraph.AddText(ordner); } return(paragraph); }
public void UpdateUi() { MannschaftskampfViewModel = MannschaftskaempfeExplorer.SelectedItem as MannschaftskampfViewModel; CompetitionInfos = new CompetitionInfosViewModel(); CompetitionInfos.Ordner.Add("Test Ordner 1"); CompetitionInfos.Ordner.Add("Test Ordner 2"); }
private static CompetitionInfosViewModel TempTestdaten(MannschaftskampfViewModel mannschaftskampfViewModel) { CompetitionInfosViewModel zusatzInfos; //TODO: Aktuell nur zu Testzwecken, später von Oberfläche übergeben zusatzInfos = new CompetitionInfosViewModel() { ErgebnislistenSchreiber = "Tahar Alemann", Kampfart = "Verbandskampf", MannschaftsfuehrerHeim = "Halil Aygün", MannschaftsfuehrerGast = "Maximilian Fleischer", Ordner = new List <string>() { "Jürgen Pfaffe", "Christoph Zapf" }, Protokollfuehrer = "Anna Badewitz", VorKampfRueckKampf = "Rückkampf" }; return(zusatzInfos); }
public void Export(string pfad, MannschaftskampfViewModel daten, CompetitionInfosViewModel zusatzInfos) { Document report = ErstelleBericht(daten, zusatzInfos); exportPdf.Export(pfad, report); }
private void ErgaenzeHeader(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { section.Headers.Primary.Add(defaultElemente.GetUeberschrift(Resources.LanguageFiles.DictPluginMain.PdfProtocolHeadline)); section.Add(kampfInformationen.generate(mannschaftskampfViewModel, zusatzInfos, _randLinksRechts)); }
private void ErgaenzeInhalt(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos, bool useColor) { section.Add(PdfHelper.AddAbstandNachOben("0.8cm")); section.Add(kampfTabelle.generate(mannschaftskampfViewModel, _randLinksRechts, useColor)); section.Add(kampfBemerkungen.generate(mannschaftskampfViewModel, zusatzInfos, _randLinksRechts, useColor)); }
private Section ErstelleHauptSektion(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos, bool useColor) { ErgaenzeHeader(section, mannschaftskampfViewModel, zusatzInfos); ErgaenzeInhalt(section, mannschaftskampfViewModel, zusatzInfos, useColor); ErgaenzeFooter(section, mannschaftskampfViewModel, zusatzInfos.MannschaftsfuehrerHeim, zusatzInfos.MannschaftsfuehrerGast); return(section); }
public Document ErstelleBericht(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos, bool useColor) { string title = berichtTitel.GetTitle(mannschaftskampfViewModel); Document document = defaultElemente.GetDocument(title); Section hauptSection = defaultElemente.GetHauptSection(_randLinksRechts); ErstelleHauptSektion(hauptSection, mannschaftskampfViewModel, zusatzInfos, useColor); document.Add(hauptSection); return(document); }
private void ErgaenzeInhalt(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { section.Add(kampfTabelleKampfrichter.generate(mannschaftskampfViewModel, _randLinksRechts)); }
public TextFrame generate(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos, double randLinksRechts, bool useColor) { var result = new TextFrame(); result.Width = "25cm"; var table = result.AddTable(); table.Borders.Visible = false; table.TopPadding = "0.5cm"; double a4LandscapeBreite = (29.7 - 2 * randLinksRechts); double breite_Sieger = 8; double breite_Wettkampf = 6; double breite_Orga = 6; double breite_Kommentar = a4LandscapeBreite - breite_Orga - breite_Wettkampf - breite_Sieger; Column column = table.AddColumn($"{breite_Sieger}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{breite_Wettkampf}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{breite_Orga}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{breite_Kommentar}cm"); column.Format.Alignment = ParagraphAlignment.Left; Row zeile = table.AddRow(); zeile.Style = CustomStyles.BEMERKUNG; zeile.Cells[0].AddParagraph().AddFormattedText($"{Resources.LanguageFiles.DictPluginMain.Winner}:", TextFormat.Bold); zeile.Cells[0].Add(SiegerTeam(mannschaftskampfViewModel.HeimMannschaft, Convert.ToInt32(mannschaftskampfViewModel.HeimPunkte), mannschaftskampfViewModel.GastMannschaft, Convert.ToInt32(mannschaftskampfViewModel.GastPunkte), useColor)); zeile.Cells[1].Add(Wettkampf(mannschaftskampfViewModel)); zeile.Cells[2].Add(Organisation(zusatzInfos)); zeile.Cells[3].Add(Kommentar(mannschaftskampfViewModel.Kommentar)); return(result); }
public Table generate(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos, double randLinksRechts) { var table = new Table(); table.Style = CustomStyles.TABLEINFO; table.Borders.Visible = false; double a4LandscapeBreite = (29.7 - 2 * randLinksRechts) / 3.0; Column column = table.AddColumn($"{a4LandscapeBreite - 2}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{a4LandscapeBreite + 4}cm"); column.Format.Alignment = ParagraphAlignment.Center; column = table.AddColumn($"{a4LandscapeBreite - 2}cm"); column.Format.Alignment = ParagraphAlignment.Right; Row zeile = table.AddRow(); var spalte = zeile.Cells[0].AddParagraph(); var ft = spalte.AddFormattedText($"{mannschaftskampfViewModel.LigaId} {mannschaftskampfViewModel.TableId}", TextFormat.Bold); ft.Font.Size = CustomStyles.fontSizeGross; spalte.AddLineBreak(); ft = spalte.AddFormattedText($"{Resources.LanguageFiles.DictPluginMain.Location}:"); ft.Font.Size = CustomStyles.fontSizeKlein; ft.Bold = true; spalte.AddLineBreak(); ft = spalte.AddFormattedText($"{mannschaftskampfViewModel.Wettkampfstaette.Split(' ').Last()}"); ft.Font.Size = CustomStyles.fontSizeNormal; spalte = zeile.Cells[1].AddParagraph(); ft = spalte.AddFormattedText(zusatzInfos.Kampfart, TextFormat.Bold); ft.Font.Size = CustomStyles.fontSizeGross; spalte.AddLineBreak(); ft = spalte.AddFormattedText($"{Resources.LanguageFiles.DictPluginMain.LocationAddress}:"); ft.Font.Size = CustomStyles.fontSizeKlein; ft.Bold = true; spalte.AddLineBreak(); ft = spalte.AddFormattedText($"{mannschaftskampfViewModel.Wettkampfstaette}"); ft.Font.Size = CustomStyles.fontSizeNormal; spalte = zeile.Cells[2].AddParagraph(); ft = spalte.AddFormattedText(zusatzInfos.VorKampfRueckKampf, TextFormat.Bold); ft.Font.Size = CustomStyles.fontSizeGross; spalte.AddLineBreak(); ft = spalte.AddFormattedText($"{Resources.LanguageFiles.DictPluginMain.BoutDate}:"); ft.Font.Size = CustomStyles.fontSizeKlein; ft.Bold = true; spalte.AddLineBreak(); ft = spalte.AddFormattedText($"{mannschaftskampfViewModel.Kampfdatum.ToShortDateString()}"); ft.Font.Size = CustomStyles.fontSizeNormal; return(table); }
private static void CreateBoutResultList(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { //TODO Entfernen sobald in API vorhanden oder über UI zusatzInfos = TempTestdaten(mannschaftskampfViewModel); string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string filename = $"{mannschaftskampfViewModel.Kampfdatum.ToShortDateString()}_{mannschaftskampfViewModel.HeimMannschaft.Replace(' ', '-')}_vs_{mannschaftskampfViewModel.GastMannschaft.Replace(' ', '-')}_Ergebnisliste.pdf"; string pfad = Path.Combine(desktop, filename); LoggerMessage.Send(new LogEntry(LogEntryType.Message, $"Erstelle Ergebnisliste (Punktzettel) für Wettkampf {mannschaftskampfViewModel.Kampfdatum.ToShortDateString()} {mannschaftskampfViewModel.Value}. Bitte warten...")); IReport bericht = new ReportErgebnislisteKampfrichtertischPdf(); bericht.Export(pfad, mannschaftskampfViewModel, zusatzInfos); LoggerMessage.Send(new LogEntry(LogEntryType.Message, $"Ergebnisliste (Punktzettel) erfolgreich erstellt für Wettkampf {mannschaftskampfViewModel.Kampfdatum.ToShortDateString()} {mannschaftskampfViewModel.Value}. Öffne nun PDF-Datei.")); Process.Start(pfad); //Öffne PDF }
public static async Task OnCreateBoutResultListAsync(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos = null) { var myTask = Task.Run(() => { CreateBoutResultList(mannschaftskampfViewModel, zusatzInfos); return; }); await myTask; return; }
public Document ErstelleBericht(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { string title = ""; //TODO kläre warum ein Dokument einen Titel hat und diese nicht, was ist der default wert? Document document = defaultElemente.GetDocument(title); Section hauptSection = defaultElemente.GetHauptSection(_randLinksRechts); ErstelleHauptSektion(hauptSection, mannschaftskampfViewModel, zusatzInfos); document.Add(hauptSection); return(document); }
private void ErgaenzeInhalt(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { section.Add(Kampftabelle(mannschaftskampfViewModel)); }
private Section ErstelleHauptSektion(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { ErgaenzeHeader(section, mannschaftskampfViewModel, zusatzInfos); ErgaenzeInhalt(section, mannschaftskampfViewModel, zusatzInfos); return(section); }
private Table KampfInfos(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { var table = new Table(); table.Style = CustomStyles.TABLEINFO; double a4LandscapeBreite = (29.7 - 2 * _randLinksRechts) / 3.0; Column column = table.AddColumn($"{a4LandscapeBreite - 2}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{a4LandscapeBreite + 4}cm"); column.Format.Alignment = ParagraphAlignment.Center; column = table.AddColumn($"{a4LandscapeBreite - 2}cm"); column.Format.Alignment = ParagraphAlignment.Right; Row zeile = table.AddRow(); var spalte = zeile.Cells[0].AddParagraph(); var ft = spalte.AddFormattedText($"{mannschaftskampfViewModel.LigaId} {mannschaftskampfViewModel.TableId}", TextFormat.Bold); ft.Font.Size = CustomStyles.fontSizeNormal; ft.Font.Name = CustomStyles.fontUeberschriften; spalte = zeile.Cells[1].AddParagraph(); ft = spalte.AddFormattedText($"{zusatzInfos.Kampfart} {mannschaftskampfViewModel.HeimMannschaft} vs. {mannschaftskampfViewModel.GastMannschaft}", TextFormat.Bold); ft.Font.Size = CustomStyles.fontSizeNormal; ft.Font.Name = CustomStyles.fontUeberschriften; spalte = zeile.Cells[2].AddParagraph(); ft = spalte.AddFormattedText($"{mannschaftskampfViewModel.Kampfdatum.ToShortDateString()}", TextFormat.Bold); ft.Font.Size = CustomStyles.fontSizeNormal; ft.Font.Name = CustomStyles.fontUeberschriften; return(table); }
private void ErgaenzeHeader(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos) { section.Headers.Primary.Add(defaultElemente.GetUeberschrift("Ergebnisliste für Kampfrichtertisch")); section.Add(kampfInformationen.generate(mannschaftskampfViewModel, zusatzInfos, _randLinksRechts)); section.Headers.Primary.Add(PdfHelper.AddAbstandNachOben("0.1cm")); }
public static async Task OnCreateProtocolAsync(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos = null) //TODO: ZusatzInfos von Oberfläche übergeben { var myTask = Task.Run(() => { CreateProtocol(mannschaftskampfViewModel, zusatzInfos); return; }); await myTask; return; }