Strassen werden nun richtig in csv geschrieben
This commit is contained in:
48
XMLParser.Functions/TagesUmsatzCSVWriter.cs
Normal file
48
XMLParser.Functions/TagesUmsatzCSVWriter.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using XMLParser.Contract;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLParser.Functions
|
||||
{
|
||||
[DebuggerDisplay("{" + nameof(GetDebuggerDisplay) + "(),nq}")]
|
||||
public class TagesUmsatzCSVWriter : CSVWriterBase
|
||||
{
|
||||
public TagesUmsatzCSVWriter()
|
||||
{
|
||||
handle = File.Create("./data.csv");
|
||||
string WriteHeader = "Inspektionsdatum#Anzahl Straßenablaufe#Länge über 5m#SonstigeLeitungen#Sonstige Länge über 5m#Hauptkanallänge";
|
||||
writeToFile(WriteHeader);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
handle.Close();
|
||||
}
|
||||
|
||||
private string GetDebuggerDisplay()
|
||||
{
|
||||
return ToString();
|
||||
}
|
||||
|
||||
|
||||
public override void WriteEntry(Dictionary<ECalculatedResult, decimal> calculated, List<KanalObjekt> inspektionenAmTag)
|
||||
{
|
||||
int anzahlStraßenablaufe = (int)calculated[ECalculatedResult.STRASSENABLAUFANZAHL];
|
||||
int sonstigeLeitungen = (int)calculated[ECalculatedResult.SONSTIGEANZAHL];
|
||||
decimal Strassenablaufzulage = calculated[ECalculatedResult.STRASSENABLAUFLAENGEZULAGEMETER];
|
||||
decimal Sonstigezulage = calculated[ECalculatedResult.SONSTIGELAENGEZULAGEMETER];
|
||||
decimal HauptkanalLänge = calculated[ECalculatedResult.GESAMTHAUPTKANAL];
|
||||
|
||||
KanalObjekt last = inspektionenAmTag.Last();
|
||||
|
||||
string entry = last.Inspektionsdaten.OptischeInspektion.Inspektionsdatum + "#"+anzahlStraßenablaufe+"#"+Strassenablaufzulage+"#"+sonstigeLeitungen+"#"+Sonstigezulage+"#"+HauptkanalLänge;
|
||||
writeToFile(entry);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user