Linercharges werden nun in textdatei gespeichert
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -8,13 +9,33 @@ namespace KlassenBIB
|
|||||||
{
|
{
|
||||||
public static class LinerChargen
|
public static class LinerChargen
|
||||||
{
|
{
|
||||||
public static void GenLinerChargenOverview(List<Projekt> ProjektListe)
|
public static Dictionary<string, List<string>> GenLinerChargenOverview(List<Projekt> ProjektListe)
|
||||||
{
|
{
|
||||||
|
Dictionary<string, List<string>> Daten = new Dictionary<string, List<string>>();
|
||||||
foreach(Projekt projekt in ProjektListe)
|
foreach(Projekt projekt in ProjektListe)
|
||||||
{
|
{
|
||||||
|
foreach(Inspektionsobjekt objekt in projekt.Objekte)
|
||||||
|
{
|
||||||
|
foreach(Sanierung sanierung in objekt.Sanierung)
|
||||||
|
{
|
||||||
|
if (!(sanierung is InlinerSanierung)) continue;
|
||||||
|
|
||||||
|
if (!((sanierung as InlinerSanierung).Imprägnierungsbericht is WerkseitigImprägniert)) continue;
|
||||||
|
|
||||||
|
WerkseitigImprägniert imprignierung = ((sanierung as InlinerSanierung).Imprägnierungsbericht as WerkseitigImprägniert);
|
||||||
|
string datenbezeichnung = projekt.Nummer + " # " + objekt.Objektbezeichnung;
|
||||||
|
if (Daten.ContainsKey(imprignierung.Imprägniernummer))
|
||||||
|
{
|
||||||
|
Daten[imprignierung.Imprägniernummer].Add(datenbezeichnung);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Daten.Add(imprignierung.Imprägniernummer, new List<string>() { datenbezeichnung });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Daten;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,8 +271,30 @@ namespace SanSystem
|
|||||||
|
|
||||||
private void VerbrauchToolStripMenuItem_Click(object sender, EventArgs e)
|
private void VerbrauchToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
FrmGetDataFromBluelight frmGetDataFromBluelight = new FrmGetDataFromBluelight();
|
/*FrmGetDataFromBluelight frmGetDataFromBluelight = new FrmGetDataFromBluelight();
|
||||||
frmGetDataFromBluelight.ShowDialog();
|
frmGetDataFromBluelight.ShowDialog();*/
|
||||||
|
Dictionary<string,List<string>> daten = KlassenBIB.LinerChargen.GenLinerChargenOverview(Datenbank.Instance.TeufelDB.Projekte);
|
||||||
|
List<string> content = new List<string>();
|
||||||
|
foreach (KeyValuePair<string, List<string>> x in daten)
|
||||||
|
{
|
||||||
|
content.Add(x.Key);
|
||||||
|
|
||||||
|
content.Add("================");
|
||||||
|
foreach(string values in x.Value)
|
||||||
|
{
|
||||||
|
content.Add(values);
|
||||||
|
}
|
||||||
|
content.Add("##############");
|
||||||
|
}
|
||||||
|
|
||||||
|
string[] datencontent = new string[content.Count];
|
||||||
|
for(int i = 0; i < content.Count; i++)
|
||||||
|
{
|
||||||
|
datencontent[i] = content[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
File.WriteAllLines("linercharges.txt", datencontent);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user