Contracts hinzugefügt
This commit is contained in:
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,11 +1,7 @@
|
||||
/XMLParser/bin/*
|
||||
/XMLParser/obj/*
|
||||
/XMLParserTest/bin/Debug/*
|
||||
/XMLParserTest/obj/Debug/*
|
||||
/XMLParserTest/obj/*
|
||||
/XMLProgramm/bin/*
|
||||
/XMLProgramm/obj/*
|
||||
*/bin/*
|
||||
*/obj/*
|
||||
data.csv
|
||||
.vs/XMLParser/DesignTimeBuild/.dtbcache.v2
|
||||
.vs/XMLParser/v16/.suo
|
||||
.vs/XMLParser/v16/TestStore/*
|
||||
*/obj/*
|
||||
|
||||
10
XMLParser.Contract/ICSVWriter.cs
Normal file
10
XMLParser.Contract/ICSVWriter.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLParser.Contract
|
||||
{
|
||||
public interface ICSVWriter
|
||||
{
|
||||
void WriteEntry(Dictionary<ECalculatedResult, decimal> calculated, List<KanalObjekt> inspektionenAmTag);
|
||||
}
|
||||
}
|
||||
9
XMLParser.Contract/ICalculate.cs
Normal file
9
XMLParser.Contract/ICalculate.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace XMLParser.Contract
|
||||
{
|
||||
public interface ICalculate
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
10
XMLParser.Contract/IUmsatzCalculator.cs
Normal file
10
XMLParser.Contract/IUmsatzCalculator.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLParser.Contract
|
||||
{
|
||||
public interface IUmsatzCalculator
|
||||
{
|
||||
void Calculate(ICSVWriter csvWriter,List<KanalObjekt> objekte);
|
||||
}
|
||||
}
|
||||
11
XMLParser.Contract/XMLParser.Contract.csproj
Normal file
11
XMLParser.Contract/XMLParser.Contract.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\XMLParser.Model\XMLParser.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -4,12 +4,13 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using XMLParser;
|
||||
using XMLParser.Contract;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLProgramm
|
||||
{
|
||||
[DebuggerDisplay("{" + nameof(GetDebuggerDisplay) + "(),nq}")]
|
||||
class CSVWriter
|
||||
public class CSVWriter : ICSVWriter
|
||||
{
|
||||
FileStream handle = null;
|
||||
void writeToFile(string content)
|
||||
@@ -31,7 +32,13 @@ namespace XMLProgramm
|
||||
handle.Close();
|
||||
}
|
||||
|
||||
internal void WriteDay(Dictionary<ECalculatedResult, decimal> calculated, List<KanalObjekt> inspektionenAmTag)
|
||||
private string GetDebuggerDisplay()
|
||||
{
|
||||
return ToString();
|
||||
}
|
||||
|
||||
|
||||
public void WriteEntry(Dictionary<ECalculatedResult, decimal> calculated, List<KanalObjekt> inspektionenAmTag)
|
||||
{
|
||||
int anzahlStraßenablaufe = (int)calculated[ECalculatedResult.STRASSENABLAUFANZAHL];
|
||||
int sonstigeLeitungen = (int)calculated[ECalculatedResult.SONSTIGEANZAHL];
|
||||
@@ -45,9 +52,5 @@ namespace XMLProgramm
|
||||
writeToFile(entry);
|
||||
}
|
||||
|
||||
private string GetDebuggerDisplay()
|
||||
{
|
||||
return ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Functions
|
||||
{
|
||||
public static class Calculate
|
||||
{
|
||||
16
XMLParser.Functions/UmsatzCalculator/Strassenumsatz.cs
Normal file
16
XMLParser.Functions/UmsatzCalculator/Strassenumsatz.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using XMLParser.Contract;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLParser.Functions.UmsatzCalculator
|
||||
{
|
||||
public class StrassenUmsatz : IUmsatzCalculator
|
||||
{
|
||||
public void Calculate(ICSVWriter csvWriter, List<KanalObjekt> objekte)
|
||||
{
|
||||
XMLParse ser = new XMLParse("2021-07-29_KR_H_L_Oldenburg_Eichenstraße.xml");
|
||||
objekte.AddRange(ser.KanalObjekte);
|
||||
Dictionary<ECalculatedResult,decimal> d = XMLParser.Functions.Calculate.CalculateStreet(objekte);
|
||||
}
|
||||
}
|
||||
}
|
||||
38
XMLParser.Functions/UmsatzCalculator/Tagesumsatz.cs
Normal file
38
XMLParser.Functions/UmsatzCalculator/Tagesumsatz.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using XMLParser.Contract;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLParser.Functions.UmsatzCalculator
|
||||
{
|
||||
public class TagesUmsatz : IUmsatzCalculator
|
||||
{
|
||||
public void Calculate(ICSVWriter csvWriter, List<KanalObjekt> objekte)
|
||||
{
|
||||
DirectoryInfo info = new DirectoryInfo("./");
|
||||
FileInfo[] daten = info.GetFiles("*.xml");
|
||||
foreach(FileInfo aktuell in daten) {
|
||||
XMLParse ser = new XMLParse(aktuell.FullName);
|
||||
objekte.AddRange(ser.KanalObjekte);
|
||||
}
|
||||
IEnumerable<string> datums = objekte.OrderBy(d => d.Inspektionsdaten.OptischeInspektion.Inspektionstime).Select(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum).Distinct();
|
||||
|
||||
decimal gesamt = 0.0m;
|
||||
//Dictionary<string,decimal> s = CalculateDay(objekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals("05.08.2021")));
|
||||
foreach(string datum in datums) {
|
||||
List<KanalObjekt> InspektionenAmTag = objekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals(datum));
|
||||
Dictionary<ECalculatedResult,decimal> s = XMLParser.Functions.Calculate.CalculateDay(InspektionenAmTag);
|
||||
csvWriter.WriteEntry(s,InspektionenAmTag);
|
||||
Console.WriteLine("Umsatz am : "+datum + " " + s[ECalculatedResult.GESAMTUMSATZ]);
|
||||
gesamt +=s[ECalculatedResult.GESAMTUMSATZ];
|
||||
//if(datum.Equals("05.08.2021")) Debugger.Break();
|
||||
}
|
||||
int anzahlTage = datums.Count();
|
||||
decimal Durchschnitt = gesamt / anzahlTage;
|
||||
int prognosedays = 63;
|
||||
Console.WriteLine(string.Format("Tage : {0} \nGesamt umsatz: {1}\nDurchschnitt : {2}\nPrognose für {3} tage {4}",anzahlTage,gesamt,Durchschnitt,prognosedays,prognosedays*Durchschnitt));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLParser
|
||||
{
|
||||
12
XMLParser.Functions/XMLParser.Functions.csproj
Normal file
12
XMLParser.Functions/XMLParser.Functions.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\XMLParser.Model\XMLParser.Model.csproj" />
|
||||
<ProjectReference Include="..\XMLParser.Contract\XMLParser.Contract.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class AbwassertechnischeAnlage
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Anschlussdaten
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Anschlusspunkt
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public enum EAnlagetyp
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Geometrie
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Geometriedaten
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public sealed class InspizierteAbwassertechnischeAnlage
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class KanalObjekt
|
||||
{
|
||||
public string XmlFileName {get;set;}
|
||||
public AbwassertechnischeAnlage Stammdaten { get; internal set; }
|
||||
public InspizierteAbwassertechnischeAnlage Inspektionsdaten { get; internal set; }
|
||||
public AbwassertechnischeAnlage Stammdaten { get; set; }
|
||||
public InspizierteAbwassertechnischeAnlage Inspektionsdaten { get; set; }
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} ({1})",Stammdaten.Objektbezeichnung,Inspektionsdaten.OptischeInspektion.Rohrleitung.Grunddaten.Profilbreite);
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Kante
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Knoten
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Lage
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class OptischeInspektion
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class PolyKante
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Profil
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class RGrunddaten
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public struct Quantifizierung
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Rohrleitung
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace XMLParser
|
||||
namespace XMLParser.Model
|
||||
{
|
||||
public class Schacht
|
||||
{
|
||||
@@ -3,12 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.6.30114.105
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLParser", "XMLParser\XMLParser.csproj", "{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLParserTest", "XMLParserTest\XMLParserTest.csproj", "{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLProgramm", "XMLProgramm\XMLProgramm.csproj", "{641D9B83-D358-4015-9873-E5787DFC70D1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLParser.Contract", "XMLParser.Contract\XMLParser.Contract.csproj", "{E32C7894-5512-46A4-A868-49A834291056}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLParser.Model", "XMLParser.Model\XMLParser.Model.csproj", "{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -58,5 +60,29 @@ Global
|
||||
{641D9B83-D358-4015-9873-E5787DFC70D1}.Release|x64.Build.0 = Release|Any CPU
|
||||
{641D9B83-D358-4015-9873-E5787DFC70D1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{641D9B83-D358-4015-9873-E5787DFC70D1}.Release|x86.Build.0 = Release|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Release|x64.Build.0 = Release|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E32C7894-5512-46A4-A868-49A834291056}.Release|x86.Build.0 = Release|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{4EC6DA2E-EF68-4E9E-8471-B0B59BBD96AD}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using XMLParser;
|
||||
//using XMLParser;
|
||||
|
||||
namespace XMLParserTest
|
||||
{
|
||||
@@ -12,7 +12,7 @@ namespace XMLParserTest
|
||||
[TestMethod]
|
||||
public void TestCalculate()
|
||||
{
|
||||
|
||||
/*
|
||||
List<KanalObjekt> kanalObjekts = new XMLParse("input.xml").KanalObjekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals("20.07.2021"));
|
||||
Assert.AreEqual(35,kanalObjekts.Count);
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace XMLParserTest
|
||||
Assert.AreEqual(102.00m,umsatz[ECalculatedResult.STRASSENABLAUFUMSATZ]);
|
||||
Assert.AreEqual(1305.00m,umsatz[ECalculatedResult.SONSTIGEUMSATZ]);
|
||||
Assert.AreEqual(27.50m,umsatz[ECalculatedResult.LAENGEZULAGEUMSATZ]);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,13 @@ namespace XMLParserTest
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
{
|
||||
XMLParser.XMLParse xml = new XMLParser.XMLParse("input.xml");
|
||||
/*XMLParser.XMLParse xml = new XMLParser.XMLParse("input.xml");
|
||||
IEnumerable<string> datumsDistinct = xml.KanalObjekte.Select(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum).Distinct();
|
||||
foreach(string aktuellDatum in datumsDistinct) {
|
||||
var m = xml.KanalObjekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals(aktuellDatum));
|
||||
Debugger.Break();
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,4 @@
|
||||
<PackageReference Include="coverlet.collector" Version="1.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\XMLParser\XMLParser.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,7 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using XMLParser;
|
||||
using XMLParser.Contract;
|
||||
using XMLParser.Model;
|
||||
|
||||
namespace XMLProgramm
|
||||
{
|
||||
@@ -11,46 +12,16 @@ namespace XMLProgramm
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
CSVWriter csvWriter = new CSVWriter();
|
||||
|
||||
ICSVWriter csvWriter = new CSVWriter();
|
||||
//CSVWriter csvWriter = new CSVWriter();
|
||||
List<KanalObjekt> objekte = new List<KanalObjekt>();
|
||||
IUmsatzCalculator calculator = new XMLParser.Functions.UmsatzCalculator.TagesUmsatz();
|
||||
calculator.Calculate(csvWriter,objekte);
|
||||
|
||||
StrassenUmsatz(csvWriter,objekte);
|
||||
//StrassenUmsatz(csvWriter,objekte);
|
||||
//TagesUmsatz(csvWriter,objekte);
|
||||
}
|
||||
|
||||
private static void StrassenUmsatz(CSVWriter csvWriter, List<KanalObjekt> objekte)
|
||||
{
|
||||
// KS_Oldenburg_Lönsweg.xml
|
||||
XMLParse ser = new XMLParse("2021-07-29_KR_H_L_Oldenburg_Eichenstraße.xml");
|
||||
objekte.AddRange(ser.KanalObjekte);
|
||||
Dictionary<ECalculatedResult,decimal> d = Calculate.CalculateStreet(objekte);
|
||||
|
||||
}
|
||||
|
||||
static void TagesUmsatz(CSVWriter csvWriter, List<KanalObjekt> objekte)
|
||||
{
|
||||
DirectoryInfo info = new DirectoryInfo("./");
|
||||
FileInfo[] daten = info.GetFiles("*.xml");
|
||||
foreach(FileInfo aktuell in daten) {
|
||||
XMLParse ser = new XMLParse(aktuell.FullName);
|
||||
objekte.AddRange(ser.KanalObjekte);
|
||||
}
|
||||
IEnumerable<string> datums = objekte.OrderBy(d => d.Inspektionsdaten.OptischeInspektion.Inspektionstime).Select(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum).Distinct();
|
||||
|
||||
decimal gesamt = 0.0m;
|
||||
//Dictionary<string,decimal> s = CalculateDay(objekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals("05.08.2021")));
|
||||
foreach(string datum in datums) {
|
||||
List<KanalObjekt> InspektionenAmTag = objekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals(datum));
|
||||
Dictionary<ECalculatedResult,decimal> s = Calculate.CalculateDay(InspektionenAmTag);
|
||||
csvWriter.WriteDay(s,InspektionenAmTag);
|
||||
Console.WriteLine("Umsatz am : "+datum + " " + s[ECalculatedResult.GESAMTUMSATZ]);
|
||||
gesamt +=s[ECalculatedResult.GESAMTUMSATZ];
|
||||
//if(datum.Equals("05.08.2021")) Debugger.Break();
|
||||
}
|
||||
int anzahlTage = datums.Count();
|
||||
decimal Durchschnitt = gesamt / anzahlTage;
|
||||
int prognosedays = 63;
|
||||
Console.WriteLine(string.Format("Tage : {0} \nGesamt umsatz: {1}\nDurchschnitt : {2}\nPrognose für {3} tage {4}",anzahlTage,gesamt,Durchschnitt,prognosedays,prognosedays*Durchschnitt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\XMLParser\XMLParser.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="input.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\XMLParser.Contract\XMLParser.Contract.csproj" />
|
||||
<ProjectReference Include="..\XMLParser.Model\XMLParser.Model.csproj" />
|
||||
<ProjectReference Include="..\XMLParser.Functions\XMLParser.Functions.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
|
||||
Reference in New Issue
Block a user