private void SelectOrganisationenToWordUpID_OnLoaded (object Sender, RoutedEventArgs E) { if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) return; Cursor = Cursors.Wait; DataModell = DataWrapper.Instance; this.DataContext = DataModell; Cursor = Cursors.Arrow; }
private List<Object> CreateOutStatusTaggedGenderPDF (WordUp.DataSelection dataSelection, DataWrapper.Statistics RequestedStatistic) { Dictionary<Typ, GenderStatistikClass> Counter = new Dictionary<Typ, GenderStatistikClass>(); GenderSummStatistikClass AllCounter = new GenderSummStatistikClass(dataSelection, Data.DbServer3.WordUp.Typen.LoadThenFind(ProjekteTypen.Alle)); List<Object> Result = new List<Object>(); switch (dataSelection) { case WordUp.DataSelection.Ideen: foreach (WSPlakat wSPlakat in Data.DbServer3.WordUp.WSPlakate) { AllCounter.Add(wSPlakat.WertM, wSPlakat.WertW, wSPlakat.WertU); if (!Counter.ContainsKey(wSPlakat.Typ)) { Counter[wSPlakat.Typ] = new GenderStatistikClass(dataSelection, wSPlakat.Typ); Counter[wSPlakat.Typ].AllCounter = AllCounter; Counter[wSPlakat.Typ].PageBreakAllowedBefore = true; } Counter[wSPlakat.Typ].Add(wSPlakat.WertM, wSPlakat.WertW, wSPlakat.WertU); if (AllCounter.GenderMaxGesamt < Counter[wSPlakat.Typ].GenderCounter) AllCounter.GenderMaxGesamt = Counter[wSPlakat.Typ].GenderCounter; } Result.Add(AllCounter); foreach (GenderStatistikClass genderStatistikClass in Counter .Values.OrderByDescending(ord => ord.ProcentGenderCounter)) { Result.Add(genderStatistikClass); } break; case WordUp.DataSelection.Wuensche: foreach (Projekt projekt in Data.DbServer3.WordUp.Projekte) { AllCounter.Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (!Counter.ContainsKey(projekt.Typ)) { Counter[projekt.Typ] = new GenderStatistikClass(dataSelection, projekt.Typ); Counter[projekt.Typ].AllCounter = AllCounter; Counter[projekt.Typ].PageBreakAllowedBefore = true; } Counter[projekt.Typ].Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (AllCounter.GenderMaxGesamt < Counter[projekt.Typ].GenderCounter) AllCounter.GenderMaxGesamt = Counter[projekt.Typ].GenderCounter; } Result.Add(AllCounter); foreach (GenderStatistikClass genderStatistikClass in Counter .Values.OrderByDescending(ord => ord.ProcentGenderCounter)) { Result.Add(genderStatistikClass); } break; case WordUp.DataSelection.Planungen: foreach (Projekt projekt in Data.DbServer3.WordUp.Projekte .Where(sel => sel.WertigkeitValue > 0)) { AllCounter.Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (!Counter.ContainsKey(projekt.Typ)) { Counter[projekt.Typ] = new GenderStatistikClass(dataSelection, projekt.Typ); Counter[projekt.Typ].AllCounter = AllCounter; Counter[projekt.Typ].PageBreakAllowedBefore = true; } Counter[projekt.Typ].Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (AllCounter.GenderMaxGesamt < Counter[projekt.Typ].GenderCounter) AllCounter.GenderMaxGesamt = Counter[projekt.Typ].GenderCounter; } Result.Add(AllCounter); foreach (GenderStatistikClass genderStatistikClass in Counter .Values.OrderByDescending(ord => ord.ProcentGenderCounter)) { Result.Add(genderStatistikClass); } break; case WordUp.DataSelection.Projekte: foreach (Projekt projekt in Data.DbServer3.WordUp.Projekte .Find_PhasenCorrectProjekte(WordUp.DataSelection.Projekte.ToString())) { AllCounter.Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (!Counter.ContainsKey(projekt.Typ)) { Counter[projekt.Typ] = new GenderStatistikClass(dataSelection, projekt.Typ); Counter[projekt.Typ].AllCounter = AllCounter; Counter[projekt.Typ].PageBreakAllowedBefore = true; } Counter[projekt.Typ].Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (AllCounter.GenderMaxGesamt < Counter[projekt.Typ].GenderCounter) AllCounter.GenderMaxGesamt = Counter[projekt.Typ].GenderCounter; } Result.Add(AllCounter); foreach (GenderStatistikClass genderStatistikClass in Counter .Values.OrderByDescending(ord => ord.ProcentGenderCounter)) { Result.Add(genderStatistikClass); } break; case WordUp.DataSelection.Realisierungen: foreach (Projekt projekt in Data.DbServer3.WordUp.Projekte .Find_PhasenCorrectProjekte(WordUp.DataSelection.Realisierungen.ToString())) { AllCounter.Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (!Counter.ContainsKey(projekt.Typ)) { Counter[projekt.Typ] = new GenderStatistikClass(dataSelection, projekt.Typ); Counter[projekt.Typ].AllCounter = AllCounter; Counter[projekt.Typ].PageBreakAllowedBefore = true; } Counter[projekt.Typ].Add(projekt.SummeM, projekt.SummeW, projekt.SummeU); if (AllCounter.GenderMaxGesamt < Counter[projekt.Typ].GenderCounter) AllCounter.GenderMaxGesamt = Counter[projekt.Typ].GenderCounter; } Result.Add(AllCounter); foreach (GenderStatistikClass genderStatistikClass in Counter .Values.OrderByDescending(ord => ord.ProcentGenderCounter)) { Result.Add(genderStatistikClass); } break; } return Result; }
public List<object> CreateData(DataWrapper.Statistics RequestedStatistic, DataWrapper.ReportType StatisticSubType, string OutputDirectory) { List<object> Result = null; switch (RequestedStatistic) { case DataWrapper.Statistics.ZustaendigAgOrtsTeilOrt: { ZustaendigAgOrtsTeilOrt ZustaendigAgOrtsTeilOrtInstance = new ZustaendigAgOrtsTeilOrt(); ZustaendigAgOrtsTeilOrtInstance.FillMe(); ZustaendigAgOrtsTeilOrtInstance.AddMyChildsToMe(); switch (StatisticSubType) { case DataWrapper.ReportType.StatistikenBaseData: { foreach (StatistikRootClass.StatistikDataSelectionTypes writeOutType in Enum.GetValues(typeof (StatistikRootClass.StatistikDataSelectionTypes))) { string OutputFileName = Path.Combine(OutputDirectory, RequestedStatistic + "_" + writeOutType + ".csv"); if (File.Exists(OutputFileName)) Basics.SecureFileDelete(OutputFileName); if (File.Exists(OutputFileName.Replace(".csv", ".xlsx"))) Basics.SecureFileDelete(OutputFileName.Replace(".csv", ".xlsx")); WriteOutZustaendigAGOrtsTeilOrt(ZustaendigAgOrtsTeilOrtInstance, writeOutType, OutputFileName.Replace(".csv", ".xlsx")); ZustaendigAgOrtsTeilOrtInstance.WriteCSVData(writeOutType, OutputFileName); } string HaeufigkeitenFileName = Path.Combine(OutputDirectory, "Ideen_Projekt_Häufigkeiten.xlsx"); if (File.Exists(HaeufigkeitenFileName)) Basics.SecureFileDelete(HaeufigkeitenFileName); WriteOutNumberOfEntriesPerOrtsTeil (ZustaendigAgOrtsTeilOrtInstance, HaeufigkeitenFileName); } break; case DataWrapper.ReportType.StatistikenLayouted: break; } } break; case DataWrapper.Statistics.SchulenZuOrtsTeilen: { } break; case DataWrapper.Statistics.TypenVerteilung: { } break; case DataWrapper.Statistics.GenderedIdeen: { Data.DbServer3.WordUp.WSPlakate.Clear(); Data.DbServer3.WordUp.WSPlakate.Load_ActualPlakate(); bool IsExcelOrPdf = true; if (OutputDirectory.Contains("PDF")) IsExcelOrPdf = false; string FileNamePart = RequestedStatistic + ".xlsx"; string OutputFileName = Path.Combine(OutputDirectory, FileNamePart); if (File.Exists(OutputFileName)) Basics.SecureFileDelete(OutputFileName); if (IsExcelOrPdf) WriteOutStatusTaggedGenderExcel(WordUp.DataSelection.Ideen, OutputFileName); else { Result = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Ideen, RequestedStatistic).ToList<Object>(); } } break; case DataWrapper.Statistics.GenderedWuensche: { Data.DbServer3.WordUp.WSPlakate.Load_ActualPlakate(); Data.DbServer3.WordUp.AktivitaetsTypen.Load_All(); Data.DbServer3.WordUp.Aktivitaeten.Load_ActualAktivitaeten(); Data.DbServer3.WordUp.Projekte.Load_ActualProjekte(); Data.DbServer3.WordUp.AcceptChanges(); bool IsExcelOrPdf = true; if (OutputDirectory.Contains("PDF")) IsExcelOrPdf = false; string FileNamePart = RequestedStatistic + ".xlsx"; string OutputFileName = Path.Combine(OutputDirectory, FileNamePart); if (File.Exists(OutputFileName)) Basics.SecureFileDelete(OutputFileName); if (IsExcelOrPdf) WriteOutStatusTaggedGenderExcel(WordUp.DataSelection.Wuensche, OutputFileName); else { Result = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Wuensche, RequestedStatistic).ToList<Object>(); } } break; case DataWrapper.Statistics.GenderedPlanungen: { Data.DbServer3.WordUp.WSPlakate.Load_ActualPlakate(); Data.DbServer3.WordUp.AktivitaetsTypen.Load_All(); Data.DbServer3.WordUp.Aktivitaeten.Load_ActualAktivitaeten(); Data.DbServer3.WordUp.Projekte.Load_ActualProjekte(); Data.DbServer3.WordUp.AcceptChanges(); bool IsExcelOrPdf = true; if (OutputDirectory.Contains("PDF")) IsExcelOrPdf = false; string FileNamePart = RequestedStatistic + ".xlsx"; string OutputFileName = Path.Combine(OutputDirectory, FileNamePart); if (File.Exists(OutputFileName)) Basics.SecureFileDelete(OutputFileName); if (IsExcelOrPdf) WriteOutStatusTaggedGenderExcel(WordUp.DataSelection.Planungen, OutputFileName); else { Result = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Planungen, RequestedStatistic).ToList<Object>(); } } break; case DataWrapper.Statistics.GenderedProjekte: { Data.DbServer3.WordUp.WSPlakate.Load_ActualPlakate(); Data.DbServer3.WordUp.AktivitaetsTypen.Load_All(); Data.DbServer3.WordUp.Aktivitaeten.Load_ActualAktivitaeten(); Data.DbServer3.WordUp.Projekte.Load_ActualProjekte(); Data.DbServer3.WordUp.AcceptChanges(); bool IsExcelOrPdf = true; if (OutputDirectory.Contains("PDF")) IsExcelOrPdf = false; string FileNamePart = RequestedStatistic + ".xlsx"; string OutputFileName = Path.Combine(OutputDirectory, FileNamePart); if (File.Exists(OutputFileName)) Basics.SecureFileDelete(OutputFileName); if (IsExcelOrPdf) WriteOutStatusTaggedGenderExcel(WordUp.DataSelection.Projekte, OutputFileName); else { Result = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Projekte, RequestedStatistic).ToList<Object>(); } } break; case DataWrapper.Statistics.GenderedRealisierungen: { Data.DbServer3.WordUp.WSPlakate.Load_ActualPlakate(); Data.DbServer3.WordUp.AktivitaetsTypen.Load_All(); Data.DbServer3.WordUp.Aktivitaeten.Load_ActualAktivitaeten(); Data.DbServer3.WordUp.Projekte.Load_ActualProjekte(); Data.DbServer3.WordUp.AcceptChanges(); bool IsExcelOrPdf = true; if (OutputDirectory.Contains("PDF")) IsExcelOrPdf = false; string FileNamePart = RequestedStatistic + ".xlsx"; string OutputFileName = Path.Combine(OutputDirectory, FileNamePart); if (File.Exists(OutputFileName)) Basics.SecureFileDelete(OutputFileName); if (IsExcelOrPdf) WriteOutStatusTaggedGenderExcel(WordUp.DataSelection.Realisierungen, OutputFileName); else { Result = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Realisierungen, RequestedStatistic).ToList<Object>(); } } break; case DataWrapper.Statistics.GenderedVergleich: { Data.DbServer3.WordUp.WSPlakate.Load_ActualPlakate(); Data.DbServer3.WordUp.AktivitaetsTypen.Load_All(); Data.DbServer3.WordUp.Aktivitaeten.Load_ActualAktivitaeten(); Data.DbServer3.WordUp.Projekte.Load_ActualProjekte(); Data.DbServer3.WordUp.AcceptChanges(); bool IsExcelOrPdf = true; if (OutputDirectory.Contains("PDF")) IsExcelOrPdf = false; string FileNamePart = RequestedStatistic + ".xlsx"; string OutputFileName = Path.Combine(OutputDirectory, FileNamePart); if (File.Exists(OutputFileName)) Basics.SecureFileDelete(OutputFileName); if (IsExcelOrPdf) WriteOutStatusTaggedGenderExcel(WordUp.DataSelection.Planungen, OutputFileName); else { List<Object> ResultIdeen = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Ideen, RequestedStatistic); List<Object> ResultWuensche = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Wuensche, RequestedStatistic); List<Object> ResultPlanung = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Planungen, RequestedStatistic); List<Object> ResultProjekt = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Projekte, RequestedStatistic); List<Object> ResultRealisierung = CreateOutStatusTaggedGenderPDF (WordUp.DataSelection.Realisierungen, RequestedStatistic); return CombineStatisticResults(ResultIdeen, ResultWuensche, ResultPlanung, ResultProjekt, ResultRealisierung); } } break; case DataWrapper.Statistics.GenderedWertigkeiten: { } break; case DataWrapper.Statistics.GenderedAusschliessungen: { } break; } return Result; }
public void CreateProjectListings(DataWrapper.SortOrder SortCriteria, Basics.DataSelection SpecialPhase, String[] SecurityGroupParameter, bool WithOrWithoutPlakate, bool WithOrWithoutActivities, bool WithOrWithoutTermine, String OutputFileName, String HeadLine) { ShowProgressMessage("CreateCompleteProjectListNumericID as PDF in all Formats is active"); List<Basics.DataSelection> AllPhasen; if (SpecialPhase != Basics.DataSelection.Error) AllPhasen = new List<Basics.DataSelection>() { SpecialPhase }; else AllPhasen = new List<Basics.DataSelection>() { Basics.DataSelection.Wuensche, Basics.DataSelection.Planungen, Basics.DataSelection.Projekte, Basics.DataSelection.Realisierungen, Basics.DataSelection.Fertig }; String[] SecurityGroups = null; String[] SecurityGroupsShort = null; GetActuallSecurityParameter(SecurityGroupParameter, out SecurityGroups, out SecurityGroupsShort); foreach (Basics.DataSelection Phase in AllPhasen) { IEnumerable<DbEntities.dbserver3.wordup.rows.Projekt> Projekte = null; switch (SortCriteria) { case DataWrapper.SortOrder.Verantwortlich: { Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte(Phase.ToString()) .OrderBy(Entry => Entry.Zustaendigkeit?.NameId) .ThenBy(Entry => Entry.Ort?.OrtsTeil?.NameId) .ThenBy(Entry => Entry.Ort?.Bezeichnung) .ThenBy(Entry => Entry.NumericProjektId); break; } case DataWrapper.SortOrder.Typen: Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte(Phase.ToString()) .OrderBy(Entry => Entry.Typ?.TypNameId) .ThenBy(Entry => Entry.Ort?.OrtsTeil?.NameId) .ThenBy(Entry => Entry.Ort?.Bezeichnung) .ThenBy(Entry => Entry.NumericProjektId); break; case DataWrapper.SortOrder.NumericProjektID: Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte(Phase.ToString()) .OrderBy(Entry => Entry.NumericProjektId); break; case DataWrapper.SortOrder.ArbeitsGruppen: case DataWrapper.SortOrder.ArbeitsGruppenGetrennt: Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte(Phase.ToString()) .OrderBy(Entry => Entry.Ort?.OrtsTeil?.AktuallArbeitsGruppe?.NameId) .ThenBy(Entry => Entry.Ort?.OrtsTeil?.NameId) .ThenBy(Entry => Entry.Ort?.Bezeichnung) .ThenBy(Entry => Entry.NumericProjektId); break; default: Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte(Phase.ToString()) .OrderBy(Entry => Entry.Beschreibung); break; } int NumberOfRecords = Projekte.Count(); if (NumberOfRecords == 0) continue; if (SecurityGroups.Length == 0) { SecurityGroups = new String[] {""}; } foreach (String SecurityGroup in SecurityGroups) { switch (SortCriteria) { case DataWrapper.SortOrder.Verantwortlich: CreateProjectListSpecialFieldOAP(Projekte, Phase, "Zustaendig", SecurityGroup, OutputFileName, HeadLine, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine); break; case DataWrapper.SortOrder.Typen: CreateProjectListSpecialFieldOAP(Projekte, Phase, "ProjektTyp", SecurityGroup, OutputFileName, HeadLine, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine); break; case DataWrapper.SortOrder.NumericProjektID: CreateProjectListNumericID(Projekte, Phase, SecurityGroup, OutputFileName, HeadLine, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine); break; case DataWrapper.SortOrder.ArbeitsGruppen: CreateProjectListOAP(Projekte, Phase, SecurityGroup, OutputFileName, HeadLine, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine); break; case DataWrapper.SortOrder.ArbeitsGruppenGetrennt: CreateProjectListOAPGetrennt(Projekte, Phase, SecurityGroup, OutputFileName, HeadLine, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine); break; case DataWrapper.SortOrder.NotDefined: CreateProjectListSpecialFieldOAP(Projekte, Phase, "ProjektTyp", SecurityGroup, OutputFileName, HeadLine, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine); break; } } } ShowProgressMessage(""); }
public void CreatePlakatListings(DataWrapper.SortOrder SortCriteria, Basics.DataSelection SpecialPhase, String[] SecurityGroupParameter, bool WithOrWithoutPlakate, bool WithOrWithoutActivities, bool WithOrWithoutTermine, String OutputFileName, String HeadLine) { WSPlakatContentType[] typesToProcess = new WSPlakatContentType[] { WSPlakatContentType.nichtZugeordnet, WSPlakatContentType.Zugeordnet, WSPlakatContentType.alle }; foreach (WSPlakatContentType wsPlakatContentType in typesToProcess) { String TopHeadLine = String.Empty; switch (wsPlakatContentType) { case WSPlakatContentType.alle: TopHeadLine = $"{HeadLine} {DateTime.Now.ToString("MMM-dd")} erfasste Plakate aller Klassen"; break; case WSPlakatContentType.nichtZugeordnet: TopHeadLine = $"{HeadLine} {DateTime.Now.ToString("MMM-dd")} noch nicht zugeordnete Plakate"; break; case WSPlakatContentType.Zugeordnet: TopHeadLine = $"{HeadLine} {DateTime.Now.ToString("MMM-dd")} nur zugeordnete Plakate"; break; } String DetailedOutputFileName = OutputFileName.Replace(".", $"_{wsPlakatContentType}."); CreatePlakatListingsDependingOnAssignmentStatus(SortCriteria, SpecialPhase, SecurityGroupParameter, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine, DetailedOutputFileName, TopHeadLine, wsPlakatContentType); } }
public void CreatePlakatListingsDependingOnAssignmentStatus(DataWrapper.SortOrder SortCriteria, Basics.DataSelection SpecialPhase, String[] SecurityGroupParameter, bool WithOrWithoutPlakate, bool WithOrWithoutActivities, bool WithOrWithoutTermine, String OutputFileName, String HeadLine, WSPlakatContentType wsPlakatContentType) { DocumentPrintOut.ActuallOutputType = DocumentPrintOut.OutputType.RTFDocument; DocumentPrintOut PlakatWriter = new DocumentPrintOut (System.IO.Path.Combine(DataWrapper.Instance.TargetDirectory, OutputFileName), false); bool PageBreakRequested = false; PlakatWriter.WriteLine(DocumentPrintOut.ElementType.Heading1, HeadLine); foreach (Organisation Klasse in Data.DbServer3.WordUp.Organisationen.AktuelleKlassen.OrderBy(klasse => klasse.CodeName)) { int NumberOfPlakateDerKlasse = Data.DbServer3.WordUp.WSPlakate .Count(whe => whe.Organisation == Klasse); int NumberOfAssignedPlakateDerKlasse = Data.DbServer3.WordUp.WSPlakate .Count(whe => whe.Organisation == Klasse && whe.Projekt != null); int NumberOfUnAssignedPlakateDerKlasse = Data.DbServer3.WordUp.WSPlakate .Count(whe => whe.Organisation == Klasse && whe.Projekt == null); switch (wsPlakatContentType) { case WSPlakatContentType.alle: break; case WSPlakatContentType.Zugeordnet: if (NumberOfAssignedPlakateDerKlasse == 0) continue; break; case WSPlakatContentType.nichtZugeordnet: if (NumberOfUnAssignedPlakateDerKlasse == 0) continue; break; } if (PageBreakRequested) PlakatWriter.InsertPageBreak(); PageBreakRequested = false; IEnumerable<WSPlakat> PlakateAusKlasse = Klasse.WSPlakate; PlakatWriter.WriteLine(DocumentPrintOut.ElementType.Heading2, $"Plakate der Klasse {Klasse.CodeName} " + $"alle {NumberOfPlakateDerKlasse} nZug. {NumberOfUnAssignedPlakateDerKlasse} Zug. {NumberOfAssignedPlakateDerKlasse}"); Termin connectedWSTermin = Data.DbServer3.WordUp.OrganisationenZuTerminen .Where(whe => whe.Organisation == Klasse).Select(sel => sel.Termin) .Where(whe => whe.TermineTypId == TermineTypen.WS || whe.TermineTypId == TermineTypen.OeffWS).FirstOrDefault(); List<String> Betreuer = new List<string>(); foreach (PersonZuTermin personZuTermin in connectedWSTermin.PersonenZuTerminen) Betreuer.Add(personZuTermin.Person.VorName + " " + personZuTermin.Person.FamilienName); String BetreuerNamen = String.Join(", ", Betreuer); PlakatWriter.WriteLine(DocumentPrintOut.ElementType.ContentLevel1, $"Betreuer beim Workshop: {BetreuerNamen}"); if (PlakateAusKlasse.Count() == 0) { PlakatWriter.WriteLine(DocumentPrintOut.ElementType.ContentLevel1, "Bisher keine Plakate erfasst"); continue; } String OldPlakat = String.Empty; PageBreakRequested = true; //More than 0 Plakatlines available foreach (WSPlakat PlakatZeile in PlakateAusKlasse.OrderBy(plakat => plakat.ErfassungsId)) { String projektNumber = String.Empty; switch (wsPlakatContentType) { case WSPlakatContentType.alle: break; case WSPlakatContentType.nichtZugeordnet: if (PlakatZeile.Projekt != null) continue; break; case WSPlakatContentType.Zugeordnet: if (PlakatZeile.Projekt == null) continue; projektNumber = PlakatZeile.Projekt.NumericProjektId + " - "; break; } if (OldPlakat != PlakatZeile.PlakatID) { OldPlakat = PlakatZeile.PlakatID; PlakatWriter.WriteLine(DocumentPrintOut.ElementType.Heading2, "Plakat # " + OldPlakat); } PlakatWriter.WriteLine(DocumentPrintOut.ElementType.ContentLevel1, $"- {projektNumber}" + PlakatZeile.LangBeschreibung); PlakatWriter.WriteLine(DocumentPrintOut.ElementType.ContentLevel2, $" {PlakatZeile.Ort.Bezeichnung} - " + $"({PlakatZeile.OrtsHinweis})"); } } PlakatWriter.Close(); }
public void CreateProjectListings(DataWrapper.SortOrder SortCriteria, Basics.DataSelection SpecialPhase = Basics.DataSelection.Error, String[] SecurityGroupParameter = null) { ShowProgressMessage("CreateCompleteProjectListNumericID as PDF in all Formats is active"); List<Basics.DataSelection> AllPhasen; if (SpecialPhase != Basics.DataSelection.Error) AllPhasen = new List<Basics.DataSelection>() { SpecialPhase }; else AllPhasen = new List<Basics.DataSelection>() { Basics.DataSelection.Wuensche, Basics.DataSelection.Planungen, Basics.DataSelection.Projekte, Basics.DataSelection.Realisierungen, Basics.DataSelection.Fertig }; String[] SecurityGroups = null; String[] SecurityGroupsShort = null; GetActuallSecurityParameter(SecurityGroupParameter, out SecurityGroups, out SecurityGroupsShort); foreach (Basics.DataSelection Phase in AllPhasen) { IEnumerable<DbEntities.dbserver3.wordup.rows.Projekt> Projekte = null; switch (SortCriteria) { case DataWrapper.SortOrder.NumericProjektID: Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte(Phase.ToString()) .OrderBy(Entry => Entry.NumericProjektId); break; case DataWrapper.SortOrder.ArbeitsGruppen: Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte(Phase.ToString()) .OrderBy(Entry => Entry.Ort?.OrtsTeil?.AktuallArbeitsGruppe?.NameId); break; } int NumberOfRecords = Projekte.Count(); if (NumberOfRecords == 0) continue; foreach (String SecurityGroup in SecurityGroups) { switch (SortCriteria) { case DataWrapper.SortOrder.NumericProjektID: CreateProjectListNumericID(Projekte, Phase, SecurityGroup, "Numeric"); break; case DataWrapper.SortOrder.ArbeitsGruppen: CreateProjectListOAP(Projekte, Phase, SecurityGroup, "AG"); break; } } } ShowProgressMessage(""); }