diff --git a/Schnittstelle/Contract/ICodeBeschreibung.cs b/Schnittstelle/Contract/ICodeBeschreibung.cs index 8314fca..9b5e9a9 100644 --- a/Schnittstelle/Contract/ICodeBeschreibung.cs +++ b/Schnittstelle/Contract/ICodeBeschreibung.cs @@ -1,4 +1,6 @@ -namespace Schnittstelle.Contract +using Schnittstelle.Sanierung; + +namespace Schnittstelle.Contract { interface ICodeBeschreibung { diff --git a/Schnittstelle/DWA149-2_2013/BAA.cs b/Schnittstelle/DWA149-2_2013/BAA.cs index ea0d317..e26075c 100644 --- a/Schnittstelle/DWA149-2_2013/BAA.cs +++ b/Schnittstelle/DWA149-2_2013/BAA.cs @@ -1,18 +1,24 @@ using Schnittstelle.Import.XML.v2013.Model; +using Schnittstelle.Sanierung; using System; using System.Collections.Generic; using System.Text; namespace Schnittstelle.DWA149_2_2013 { - class BAA : CodeBeschreibung + class BAA : CodeBeschreibung, IReparatur, IRenovation { + List reparatur = new List(); + List renovation = new List(); + public BAA(RZustand kuerzel) : base("Verformung",kuerzel) { CH1.Add("A", "vertikal"); CH1.Add("B", "horizontal"); } - + List IReparatur.Massnahmen => reparatur; + + List IRenovation.Massnahmen => renovation; } } \ No newline at end of file diff --git a/Schnittstelle/DWA149-2_2013/BAB.cs b/Schnittstelle/DWA149-2_2013/BAB.cs index 4a69677..65fac0d 100644 --- a/Schnittstelle/DWA149-2_2013/BAB.cs +++ b/Schnittstelle/DWA149-2_2013/BAB.cs @@ -1,10 +1,14 @@ using Schnittstelle.Import.XML.v2013.Model; +using Schnittstelle.Sanierung; using System; +using System.Collections.Generic; namespace Schnittstelle.DWA149_2_2013 { - class BAB : CodeBeschreibung + class BAB : CodeBeschreibung, IReparatur { + List reparatur = new List(); + public BAB(RZustand kuerzel) : base("Rissbildung", kuerzel) { CH1.Add("A", "Oberflächenriss (Haarriss)"); @@ -16,7 +20,13 @@ namespace Schnittstelle.DWA149_2_2013 CH2.Add("C", "komplexe Rissbildung"); CH2.Add("D", "gewundene oder spiralförmige Rissbildung"); CH2.Add("E", "sternförmige Rissbildung"); + + reparatur.Add(new SanierungMassnahme("anfräsen",100)); + reparatur.Add(new SanierungMassnahme("kurzliner",200)); } + List IReparatur.Massnahmen => reparatur; + + } } \ No newline at end of file diff --git a/Schnittstelle/DWA149-2_2013/CodeBeschreibung.cs b/Schnittstelle/DWA149-2_2013/CodeBeschreibung.cs index a48361e..a3a47a9 100644 --- a/Schnittstelle/DWA149-2_2013/CodeBeschreibung.cs +++ b/Schnittstelle/DWA149-2_2013/CodeBeschreibung.cs @@ -1,5 +1,6 @@ using Schnittstelle.Contract; using Schnittstelle.Import.XML.v2013.Model; +using Schnittstelle.Sanierung; using System.Collections.Generic; namespace Schnittstelle.DWA149_2_2013 @@ -33,6 +34,5 @@ namespace Schnittstelle.DWA149_2_2013 return string.Format("{0} {1} {2}", beschreibung, ch1,ch2); } } - } } \ No newline at end of file diff --git a/Schnittstelle/Import/XML/v2013/Model/RZustand.cs b/Schnittstelle/Import/XML/v2013/Model/RZustand.cs index 1be287d..70cd909 100644 --- a/Schnittstelle/Import/XML/v2013/Model/RZustand.cs +++ b/Schnittstelle/Import/XML/v2013/Model/RZustand.cs @@ -1,3 +1,6 @@ +using Schnittstelle.Sanierung; +using System.Collections.Generic; + namespace Schnittstelle.Import.XML.v2013.Model { public struct Quantifizierung @@ -30,6 +33,8 @@ namespace Schnittstelle.Import.XML.v2013.Model string kommentar; Klassifizierung? klassifizierung; string kodeDescription; + IReparatur? reparatur; + IRenovation? renovation; public decimal Station { get => station; set => station = value; } public string Inspektionskode { get => inspektionskode; set => inspektionskode = value; } @@ -45,5 +50,7 @@ namespace Schnittstelle.Import.XML.v2013.Model public string Kommentar { get => kommentar; set => kommentar = value; } public Klassifizierung? Klassifizierung { get => klassifizierung; set => klassifizierung = value; } public string KodeDescription { get => kodeDescription; set => kodeDescription = value; } + public IReparatur Reparatur { get => reparatur; set => reparatur = value; } + public IRenovation Renovation { get => renovation; set => renovation = value; } } } diff --git a/Schnittstelle/Import/XML/v2013/XML2013.cs b/Schnittstelle/Import/XML/v2013/XML2013.cs index 715682a..0b69d30 100644 --- a/Schnittstelle/Import/XML/v2013/XML2013.cs +++ b/Schnittstelle/Import/XML/v2013/XML2013.cs @@ -1,6 +1,7 @@ using Schnittstelle.Contract; using Schnittstelle.DWA149_2_2013; using Schnittstelle.Import.XML.v2013.Model; +using Schnittstelle.Sanierung; using System; using System.Collections.Generic; using System.Diagnostics; @@ -330,6 +331,9 @@ namespace Schnittstelle.Import.XML.v2013 ICodeBeschreibung codedescription = factory.GetCodeBeschreibung(rZustand); rZustand.KodeDescription = codedescription.GetBeschreibung; + if (codedescription is IRenovation) rZustand.Renovation = (IRenovation)codedescription; + if(codedescription is IReparatur) rZustand.Reparatur = (IReparatur)codedescription; + result.Add(rZustand); } diff --git a/Schnittstelle/Sanierung/ISanierung.cs b/Schnittstelle/Sanierung/ISanierung.cs new file mode 100644 index 0000000..ccb3279 --- /dev/null +++ b/Schnittstelle/Sanierung/ISanierung.cs @@ -0,0 +1,33 @@ +using Schnittstelle.DWA149_2_2013; +using System.Collections.Generic; + +namespace Schnittstelle.Sanierung +{ + public interface IReparatur + { + List Massnahmen { get; } + } + + public interface IRenovation + { + List Massnahmen { get; } + } + + + + public class SanierungMassnahme + { + string beschreibung = string.Empty; + decimal kosten = decimal.MinValue; + + public string Beschreibung { get => beschreibung; } + public decimal Kosten { get => kosten; } + + public SanierungMassnahme(string beschreibung, decimal kosten) + { + this.beschreibung=beschreibung; + this.kosten = kosten; + } + } + +}