Linerreste werden nun richtig berechnet
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
<Compile Include="Collections\ImprägnierBericht.cs" />
|
<Compile Include="Collections\ImprägnierBericht.cs" />
|
||||||
<Compile Include="Collections\Projekte.cs" />
|
<Compile Include="Collections\Projekte.cs" />
|
||||||
<Compile Include="DB.cs" />
|
<Compile Include="DB.cs" />
|
||||||
|
<Compile Include="LinerReste.cs" />
|
||||||
<Compile Include="Sanierung\Renovation\AbstractImprägnier.cs" />
|
<Compile Include="Sanierung\Renovation\AbstractImprägnier.cs" />
|
||||||
<Compile Include="Collections\AbwasserTechnischeAnlage.cs" />
|
<Compile Include="Collections\AbwasserTechnischeAnlage.cs" />
|
||||||
<Compile Include="Sanierung\Renovation\UVAnlagenTyp.cs" />
|
<Compile Include="Sanierung\Renovation\UVAnlagenTyp.cs" />
|
||||||
|
|||||||
13
KlassenBIB/LinerReste.cs
Normal file
13
KlassenBIB/LinerReste.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace KlassenBIB
|
||||||
|
{
|
||||||
|
public class LinerReste
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,25 +15,48 @@ namespace SanSystem
|
|||||||
{
|
{
|
||||||
public partial class FrmLinerReste : Form
|
public partial class FrmLinerReste : Form
|
||||||
{
|
{
|
||||||
|
Dictionary<string, double> Linerlaengen = new Dictionary<string, double>();
|
||||||
|
|
||||||
private void BuildListe()
|
private void BuildListe()
|
||||||
{
|
{
|
||||||
list_liner.Items.Clear();
|
list_liner.Items.Clear();
|
||||||
foreach (WerkseitigImprägniert linerTruhe in Database.Datenbank.Instance.TeufelDB.Imprägnierungen)
|
Linerlaengen.Clear();
|
||||||
|
// Jedes Projekt durchgehen
|
||||||
|
foreach (Projekt projekt in Database.Datenbank.Instance.TeufelDB.Projekte)
|
||||||
{
|
{
|
||||||
double verbrauch = 0;
|
// Alle Objekte durchgehen
|
||||||
decimal rest = linerTruhe.LinerLänge;
|
foreach(Inspektionsobjekt inspektionsobjekt in projekt.Objekte)
|
||||||
if (linerTruhe.NochVorhanden == false) continue;
|
|
||||||
/*
|
|
||||||
if (linerTruhe.MitLinerSanierteObjekte != null)
|
|
||||||
{
|
{
|
||||||
linerTruhe.MitLinerSanierteObjekte.ForEach(x => x.Objekt.ForEach(d => verbrauch += d.Haltungslaenge));
|
// Alle Sanierungen durchgehen
|
||||||
rest -= Convert.ToDecimal(verbrauch);
|
foreach(Sanierung sanierung in inspektionsobjekt.Sanierung)
|
||||||
|
{
|
||||||
|
if (sanierung is InlinerSanierung && (sanierung as InlinerSanierung).Imprägnierungsbericht != null && (sanierung as InlinerSanierung).Imprägnierungsbericht is WerkseitigImprägniert)
|
||||||
|
{
|
||||||
|
WerkseitigImprägniert werkseitigImprägniert = ((sanierung as InlinerSanierung).Imprägnierungsbericht as WerkseitigImprägniert);
|
||||||
|
if(Linerlaengen.ContainsKey(werkseitigImprägniert.Imprägniernummer))
|
||||||
|
{
|
||||||
|
Linerlaengen[werkseitigImprägniert.Imprägniernummer] += inspektionsobjekt.Haltungslaenge + inspektionsobjekt.Schachtlaenge;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Linerlaengen.Add(werkseitigImprägniert.Imprägniernummer, inspektionsobjekt.Haltungslaenge + inspektionsobjekt.Schachtlaenge);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
}
|
||||||
|
|
||||||
string listoutput = string.Format("({0}) DN: {1} G: {2} R: {3}", linerTruhe.Imprägniernummer, linerTruhe.DN, linerTruhe.LinerLänge, rest);
|
foreach(string imprägniernummer in Linerlaengen.Keys)
|
||||||
|
{
|
||||||
|
// Liner länge insgesammt rausfinden
|
||||||
|
WerkseitigImprägniert werkseitigImprägniert = Database.Datenbank.Instance.TeufelDB.Imprägnierungen.FindLast(x => x.Imprägniernummer.Equals(imprägniernummer));
|
||||||
|
if (werkseitigImprägniert.NochVorhanden == false) continue;
|
||||||
|
decimal rest = werkseitigImprägniert.LinerLänge - Convert.ToDecimal(Linerlaengen[imprägniernummer]);
|
||||||
|
string listoutput = string.Format("({0}) DN: {1} G: {2} R: {3}", imprägniernummer, werkseitigImprägniert.DN, werkseitigImprägniert.LinerLänge, rest);
|
||||||
list_liner.Items.Add(listoutput);
|
list_liner.Items.Add(listoutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public FrmLinerReste()
|
public FrmLinerReste()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user