HTML styles hinzugefügt

This commit is contained in:
HuskyTeufel
2021-08-16 12:41:01 +02:00
parent c2fdd2fe7b
commit 81253eff65
5 changed files with 30 additions and 12 deletions

View File

@@ -36,12 +36,13 @@ namespace XMLParser.Functions
if(length > 7.0m) SOOverlength += length - 7.0m;
});
result.Add(ECalculatedResult.STRASSENABLAUFANZAHL,SEs.Count);
result.Add(ECalculatedResult.SONSTIGEANZAHL,SOs.Count);
result.Add(ECalculatedResult.STRASSENABLAUFLAENGEZULAGEMETER,SEOverlength);
result.Add(ECalculatedResult.SONSTIGELAENGEZULAGEMETER,SOOverlength);
result.Add(ECalculatedResult.STRASSENABLAUFANZAHL,SEs.Count);
result.Add(ECalculatedResult.STRASSENABLAUFLAENGEZULAGEMETER,SEOverlength);
decimal HauptkanalLaenge =0.0m;
List<int> ranges = new List<int>()

View File

@@ -4,6 +4,8 @@ using XMLParser.Contract;
using XMLParser.Model;
using System;
using System.Text;
using System.Linq;
using System.Diagnostics;
namespace XMLParser.Functions.ProtokollWriter
{
@@ -11,8 +13,14 @@ namespace XMLParser.Functions.ProtokollWriter
{
FileStream handle = null;
Dictionary<ECalculatedResult,string> headertitles = null;
Dictionary<string,string> Entwaesserung = null;
public HTMLProtkollWriter(Dictionary<ECalculatedResult, string> headertitles)
{
Entwaesserung = new Dictionary<string, string>();
Entwaesserung.Add("KR","Regenwasser");
Entwaesserung.Add("KS","Schmutzwasser");
Entwaesserung.Add("KM","Mischwasser");
handle = File.Create("./data.html");
this.headertitles = headertitles;
}
@@ -28,12 +36,17 @@ namespace XMLParser.Functions.ProtokollWriter
{
writeToFile("<html>");
writeToFile("<head>");
writeToFile("<style>#subject { margin-top: 120px; margin-left: auto; margin-right: auto; width: 50%; }</style>");
writeToFile("</head>");
writeToFile("<body>");
writeToFile("<div id='root'>");
writeToFile("<div id='page'>");
writeToFile("<div id='banner'><img src='briefkopf.png' width='100%' /></div>");
}
void writeHTMLFooter()
{
writeToFile("</div></div>");
writeToFile("</body>");
writeToFile("</html>");
}
@@ -41,6 +54,12 @@ namespace XMLParser.Functions.ProtokollWriter
public void WriteEntry(Dictionary<ECalculatedResult, decimal> calculated, List<KanalObjekt> inspektionenAmTag)
{
writeHTMLHeader();
KanalObjekt objekt = inspektionenAmTag.Last();
//Debugger.Break();
writeToFile("<div id='subject'>");
writeToFile("<h1>"+objekt.Inspektionsdaten.Lage.Strassename+"</h1>");
writeToFile("<h1>"+Entwaesserung[objekt.Inspektionsdaten.OptischeInspektion.Rohrleitung.Grunddaten.Kanalart]+"</h1>");
writeToFile("</div>");
writeToFile("<table border='2'>");
List<ECalculatedResult> avaibleHeaders = new List<ECalculatedResult>();
@@ -64,9 +83,7 @@ namespace XMLParser.Functions.ProtokollWriter
writeToFile("<tr>");
foreach(ECalculatedResult s in avaibleHeaders)
{
writeToFile("<td>");
writeToFile(headertitles[s]);
writeToFile("</td>");
writeToFile(string.Format("<th>{0}</th>",headertitles[s]));
}
writeToFile("</tr>");
}