private Section ErstelleHauptSektion(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos)
        {
            ErgaenzeHeader(section, mannschaftskampfViewModel, zusatzInfos);
            ErgaenzeInhalt(section, mannschaftskampfViewModel, zusatzInfos);

            return(section);
        }
Пример #2
0
        public Table generate(MannschaftskampfViewModel mannschaftskampfViewModel, double randLinksRechts, bool useColor)
        {
            Color colorRed  = Colors.Black;
            Color colorBlue = Colors.Black;

            if (useColor)
            {
                colorRed  = CustomStyles.ROT;
                colorBlue = CustomStyles.BLAU;
            }

            Table table = SetUpKampftabelle(randLinksRechts);

            Row zeileMannschaften = table.AddRow();

            MannschaftenUeberschrift(zeileMannschaften, mannschaftskampfViewModel);

            var kopfzeile = table.AddRow();

            Kopfzeilen(kopfzeile, colorRed, colorBlue);

            Kampfzeilen(table, mannschaftskampfViewModel.Children, colorRed, colorBlue);

            Row zeile = table.AddRow();

            GesamtErgebnis(zeile, Convert.ToInt32(mannschaftskampfViewModel.HeimPunkte), Convert.ToInt32(mannschaftskampfViewModel.GastPunkte), colorRed, colorBlue);

            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"));
        }
Пример #4
0
        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 Tuple <Mannschaftskampf, List <Einzelkampf> > MapErgebnis(MannschaftskampfViewModel viewModel)
        {
            var ergebnis = new Tuple <Mannschaftskampf, List <Einzelkampf> >(new Mannschaftskampf(), new List <Einzelkampf>());

            //TODO Map Daten für Senden an BRV

            return(ergebnis);
        }
Пример #6
0
        private Table Kampftabelle(MannschaftskampfViewModel mannschaftskampfViewModel)
        {
            Table table     = SetUpKampftabelle();
            Row   kopfzeile = table.AddRow();

            Kopfzeilen(kopfzeile);
            Kampfzeilen(table, mannschaftskampfViewModel.Children);

            return(table);
        }
Пример #7
0
        public Table generate(MannschaftskampfViewModel mannschaftskampfViewModel, double randLinksRechts)
        {
            Table table     = SetUpKampftabelle(randLinksRechts);
            Row   kopfzeile = table.AddRow();

            Kopfzeilen(kopfzeile);
            Kampfzeilen(table, mannschaftskampfViewModel.Children);

            return(table);
        }
Пример #8
0
        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);
        }
Пример #9
0
        public static async Task OnCreateBoutResultListAsync(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos = null)
        {
            var myTask = Task.Run(() =>
            {
                CreateBoutResultList(mannschaftskampfViewModel, zusatzInfos);

                return;
            });
            await myTask;

            return;
        }
Пример #10
0
        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;
        }
        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);
        }
        public void TesteErgebnislisteExport()
        {
            string daten = File.ReadAllText($"{System.AppDomain.CurrentDomain.BaseDirectory}\\TestDaten\\2019_Landesliga_RCA-Bayreuth_vs_ASV-Hof.json");
            MannschaftskampfViewModel testMannschaftskampfViewModel = new MannschaftskampfViewModel(JObject.Parse(daten), null);
            var zusatzInfos = GetDemoZusatzInfos();

            Random random   = new Random();
            string filename = $"Test_{random.Next()}.pdf";

            IReport bericht = new ReportErgebnislisteKampfrichtertischPdf();

            bericht.Export(filename, testMannschaftskampfViewModel, zusatzInfos);
            Process.Start(filename);//Öffne PDF
        }
Пример #13
0
        private Paragraph Wettkampf(MannschaftskampfViewModel mannschaftskampfViewModel)
        {
            Paragraph paragraph = new Paragraph();

            var ft = paragraph.AddFormattedText($"{Resources.LanguageFiles.DictPluginMain.Bout}:", TextFormat.Bold);

            ft.Underline = Underline.Single;

            paragraph.AddLineBreak();
            paragraph.AddFormattedText("Geplanter Beginn: ", TextFormat.Bold);
            paragraph.AddTab();
            paragraph.AddFormattedText($"{mannschaftskampfViewModel.GeplanterKampfbeginn:hh':'mm} Uhr");
            paragraph.AddLineBreak();

            DateTime ersterKampf  = DateTime.Now;
            DateTime letzterKampf = DateTime.Now;

            try
            {
                //ersterKampf = mannschaftskampfViewModel.Children.Min(li => li.Wertungspunkte.Min(na => na.Zeit.Value));
                //letzterKampf = mannschaftskampfViewModel.Children.Max(li => li.Wertungspunkte.Max(na => na.Zeit.Value));
            }
            catch (Exception)
            {
                //TODO: Kampfzeiten konnten nicht ermittelt werden, weil na.Zeit == null war.
                LoggerMessage.Send(new LogEntry(LogEntryType.Error, "Kampfzeiten konnten nicht ermittelt werden"));
            }

            paragraph.AddFormattedText("Erster Kampf: ", TextFormat.Bold);
            paragraph.AddTab();
            paragraph.AddTab();
            paragraph.AddFormattedText($"{ersterKampf.ToShortTimeString()} Uhr");
            paragraph.AddLineBreak();

            paragraph.AddFormattedText("Letzter Kampf: ", TextFormat.Bold);
            paragraph.AddTab();
            paragraph.AddTab();
            paragraph.AddFormattedText($"{letzterKampf.ToShortTimeString()} Uhr");
            paragraph.AddLineBreak();

            paragraph.AddFormattedText("Anzahl Zuschauer: ", TextFormat.Bold);
            paragraph.AddTab();
            paragraph.AddFormattedText($"{mannschaftskampfViewModel.AnzahlZuschauer}");
            paragraph.AddLineBreak();

            return(paragraph);
        }
Пример #14
0
        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);
        }
Пример #15
0
        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
        }
Пример #16
0
        private void MannschaftenUeberschrift(Row mannschaften, MannschaftskampfViewModel mannschaftskampfViewModel)
        {
            mannschaften.Format.Font.Bold = true;
            mannschaften.Borders.Visible  = false;

            mannschaften.Cells[2].AddParagraph(mannschaftskampfViewModel.HeimMannschaft);
            mannschaften.Cells[2].Format.Font.Bold    = true;
            mannschaften.Cells[2].Format.Font.Size    = CustomStyles.fontSizeGross;
            mannschaften.Cells[2].Format.Alignment    = ParagraphAlignment.Left;
            mannschaften.Cells[2].VerticalAlignment   = VerticalAlignment.Center;
            mannschaften.Cells[2].MergeRight          = 4;
            mannschaften.Cells[2].Borders.Right.Width = 2;

            mannschaften.Cells[7].AddParagraph(mannschaftskampfViewModel.GastMannschaft);
            mannschaften.Cells[7].Format.Font.Bold    = true;
            mannschaften.Cells[7].Format.Font.Size    = CustomStyles.fontSizeGross;
            mannschaften.Cells[7].Format.Alignment    = ParagraphAlignment.Left;
            mannschaften.Cells[7].VerticalAlignment   = VerticalAlignment.Center;
            mannschaften.Cells[7].MergeRight          = 4;
            mannschaften.Cells[7].Borders.Right.Width = 1;
        }
Пример #17
0
        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 TestePdfFarbigExport()
        {
            string daten = File.ReadAllText($"{System.AppDomain.CurrentDomain.BaseDirectory}\\TestDaten\\2019_Landesliga_RCA-Bayreuth_vs_ASV-Hof.json");
            MannschaftskampfViewModel testMannschaftskampfViewModel = new MannschaftskampfViewModel(JObject.Parse(daten), null);

            var zusatzInfos = GetDemoZusatzInfos();

            //TODO Löschen, sobald wirklich Punkte hinterlegt sind
            Random rnd = new Random();
            int    cnt = 0;

            foreach (Bout bout in testMannschaftskampfViewModel.Children)
            {
                for (int i = 0; i < rnd.Next(1, 10); i++)
                {
                    var ringer = (rnd.Next(1, 3) == 1 ? Core.CS.BoutPoint.Wrestler.Home : Core.CS.BoutPoint.Wrestler.Opponent);

                    var zeit = new DateTime(
                        testMannschaftskampfViewModel.BoutDateDateTime.Year,
                        testMannschaftskampfViewModel.BoutDateDateTime.Month,
                        testMannschaftskampfViewModel.BoutDateDateTime.Day,
                        testMannschaftskampfViewModel.ScaleTime.Hours,
                        testMannschaftskampfViewModel.ScaleTime.Minutes + cnt + i + 4,
                        rnd.Next(1, 59)
                        );

                    bout.Points.Add(new Core.CS.BoutPoint(rnd.Next(1, 5).ToString(), null, ringer, zeit));
                }

                cnt++;
            }

            Random random   = new Random();
            string filename = $"Test_{random.Next()}.pdf";

            IReport bericht = new ReportFarbigPdf();

            bericht.Export(filename, testMannschaftskampfViewModel, zusatzInfos);
            Process.Start(filename);//Öffne PDF
        }
Пример #19
0
        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);
        }
        public MannschaftskampfViewModel Map(Mannschaftskampf model)
        {
            var viewModel = new MannschaftskampfViewModel(model.SaisonId, model.WettkampfId)
            {
                HeimMannschaft          = model.HeimMannschaft,
                GastMannschaft          = model.GastMannschaft,
                HeimPunkte              = model.HeimPunkte,
                GastPunkte              = model.GastPunkte,
                Kampfdatum              = model.Kampfdatum,
                GeplanterKampfbeginn    = model.GeplanterKampfbeginn,
                EchterKampfbeginn       = model.EchterKampfbeginn,
                EchtesKampfende         = model.EchtesKampfende,
                AnzahlZuschauer         = model.AnzahlZuschauer,
                Wettkampfstaette        = model.Wettkampfstaette,
                Schiedsrichter_Vorname  = model.Schiedsrichter_Vorname,
                Schiedsrichter_Nachname = model.Schiedsrichter_Nachname,
                Sieger = model.Sieger,
                IstErgebnisGeprueft = model.IstErgebnisGeprueft,
                Kommentar           = model.Kommentar,
            };

            return(viewModel);
        }
Пример #21
0
 public void UpdateUi()
 {
     MannschaftskampfViewModel = MannschaftskaempfeExplorer.SelectedItem as MannschaftskampfViewModel;
 }
Пример #22
0
        public string GetTitle(MannschaftskampfViewModel mannschaftskampfViewModel)
        {
            string title = string.Format(Resources.LanguageFiles.DictPluginMain.PdfProtocolTitle, mannschaftskampfViewModel.LigaId, mannschaftskampfViewModel.TableId, mannschaftskampfViewModel.HeimMannschaft, mannschaftskampfViewModel.GastMannschaft, mannschaftskampfViewModel.Kampfdatum.ToShortDateString());

            return(title);
        }
 private void ErgaenzeInhalt(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos)
 {
     section.Add(kampfTabelleKampfrichter.generate(mannschaftskampfViewModel, _randLinksRechts));
 }
        public void Export(string pfad, MannschaftskampfViewModel daten, CompetitionInfosViewModel zusatzInfos)
        {
            Document report = ErstelleBericht(daten, zusatzInfos);

            exportPdf.Export(pfad, report);
        }
Пример #25
0
 private void ErgaenzeFooter(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, string trainerHeim, string trainerGast)
 {
 }
Пример #26
0
 private void ErgaenzeFooter(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, string trainerHeim, string trainerGast)
 {
     section.Footers.Primary.Add(unterschriftKampfrichter.generate(mannschaftskampfViewModel.Schiedsrichter_Vorname, trainerHeim, trainerGast, _randLinksRechts));
     section.Footers.Primary.Add(hinweißVorläufigesErgebnis.generate());
 }
Пример #27
0
 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));
 }
Пример #28
0
 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));
 }
Пример #29
0
 public async Task Map_und_Sende_Ergebnis_Async(MannschaftskampfViewModel viewModel)
 {
     var ergebnis = _mapper.MapErgebnis(viewModel);
     await _apiErgebnisdienst.Uebermittle_Ergebnis_Async(ergebnis.Item1, ergebnis.Item2);
 }
Пример #30
0
 private void ErgaenzeInhalt(Section section, MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos)
 {
     section.Add(Kampftabelle(mannschaftskampfViewModel));
 }