Liste sortiert zusammenfassung

Die leitungen werden richtig angezeigt und zusammengefasst
This commit is contained in:
HuskyTeufel
2021-08-05 10:25:20 +02:00
parent e041283a39
commit a8ac043db0
4 changed files with 41 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using XMLParser;
namespace XMLProgramm
@@ -7,8 +10,42 @@ namespace XMLProgramm
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
XMLParse ser = new XMLParse("input.xml");
IEnumerable<string> datums = ser.KanalObjekte.Select(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum).Distinct();
foreach(string datum in datums) {
Console.WriteLine("Folgende Datums sind erfasst worden : "+datum);
List<KanalObjekt> inspektionen = ser.KanalObjekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals(datum));
int counter = 0;
foreach(KanalObjekt s in inspektionen) {
counter++;
decimal length = s.Inspektionsdaten.OptischeInspektion.Rohrleitung.Inspektionslaenge;
Console.Write(s.Stammdaten.Objektbezeichnung+ " "+length);
//if(s.Stammdaten.Objektbezeichnung.Equals("45893017")) Debugger.Break();
if(s.Inspektionsdaten.Anlagentyp.Equals(EAnlagetyp.Anschlussleitung)) {
if(s.Stammdaten.Knoten != null && s.Stammdaten.Knoten.Anschlusspunkt != null && s.Stammdaten.Knoten.Anschlusspunkt.Punktkennung.Equals("SE")) {
// 45903556RS07 ist anschlusspunkt => null, denn es ist einen Schacht
if(length > 5.0m) {
Console.Write(" Straßenablauf ");
decimal overlength = length - 5.0m;
Console.Write("# Over : "+overlength);
}
}
else {
if(length > 7.0m) {
Console.Write(" Sonstiges ");
decimal overlength = length - 7.0m;
Console.Write("# Over : "+overlength);
}
}
}
Console.WriteLine();
}
Console.WriteLine(counter);
counter = 0;
Console.WriteLine("####");
}
}
}
}