52 lines
2.3 KiB
C#
52 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using XMLParser;
|
|
|
|
namespace XMLProgramm
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
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("####");
|
|
}
|
|
}
|
|
}
|
|
}
|