using KlassenBIB; using SchnittstelleImporter.XML2006; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SchnittstelleImporter { /// /// /// public class I2006XML : IImportedObjekte { string xmlFile; string projektnummer; /// /// Angabe zur XML datei /// public string XMLFile { get { return xmlFile; } set { xmlFile = value; } } /// /// Angabe zur Projektnummer /// public string Projektnummer { get { return projektnummer; } set { projektnummer = value; } } /// /// /// /// public List GetInspektionsobjekte() { List result = new List(); List anlagen = XMLParser.GetList(XMLFile); foreach(InspizierteAbwassertechnischeAnlage src in anlagen) { Inspektionsobjekt inspektionsobjekt = new Inspektionsobjekt(); InspektionskuerzelnCollection inspektionskuerzelns = new InspektionskuerzelnCollection(); inspektionsobjekt.Projektnummer = projektnummer; inspektionsobjekt.Objektbezeichnung = src.Objektbezeichnung; inspektionsobjekt.OrtName = src.Lage.Ortname!= null? src.Lage.Ortname : ""; inspektionsobjekt.StrasseName = src.Lage.Strassename != null ? src.Lage.Strassename : "noname"; inspektionsobjekt.RohrMaterial = src.OptischeInspektion.Rohrleitung.Grunddaten.Material != null ? src.OptischeInspektion.Rohrleitung.Grunddaten.Material : "Unbekannt"; inspektionsobjekt.Kanalrohrweite = src.OptischeInspektion.Rohrleitung.Grunddaten.Profilhoehe != 0 ? (uint)src.OptischeInspektion.Rohrleitung.Grunddaten.Profilhoehe : (uint)src.OptischeInspektion.Rohrleitung.Grunddaten.Profilbreite; inspektionsobjekt.Haltungslaenge = Convert.ToDouble(src.OptischeInspektion.Rohrleitung.Inspektionslaenge); inspektionsobjekt.VonPunkt = src.OptischeInspektion.Rohrleitung.Grunddaten.KnotenZulauf; inspektionsobjekt.BisPunkt = src.OptischeInspektion.Rohrleitung.Grunddaten.KnotenAblauf; inspektionsobjekt.Bemerkung = src.OptischeInspektion.Rohrleitung.Inspektionsrichtung; foreach(RZustand zustand in src.OptischeInspektion.Rohrleitung.Zustaende) { Inspektionskuerzeln inspektionskuerzeln = new Inspektionskuerzeln(); inspektionskuerzeln.Station = zustand.Station; inspektionskuerzeln.Hauptkode = zustand.Inspektionskode; inspektionskuerzeln.Charakterisierung1 = zustand.Charakterisierung1; inspektionskuerzeln.Charakterisierung2 = zustand.Charakterisierung2; inspektionskuerzeln.ImVerbindung = zustand.Verbindung; inspektionskuerzeln.LageAmUmfangStart = Convert.ToUInt32(zustand.PositionVon); inspektionskuerzeln.LageAmUmfangEnde = Convert.ToUInt32(zustand.PositionBis); Quantifizierung quant1 = zustand.Quantifizierung1; Quantifizierung quant2 = zustand.Quantifizierung2; inspektionskuerzeln.Quantifizierung1 = Convert.ToUInt32(quant1.Numerisch); inspektionskuerzeln.Quantifizierung2 = Convert.ToUInt32(quant2.Numerisch); inspektionskuerzelns.Add(inspektionskuerzeln); } inspektionsobjekt.Schadenskuerzeln = inspektionskuerzelns; result.Add(inspektionsobjekt); } return result; } } }