41 lines
1.7 KiB
C#
41 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using XMLParser;
|
|
|
|
namespace XMLProgramm
|
|
{
|
|
class Program
|
|
{
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
List<KanalObjekt> objekte = new List<KanalObjekt>();
|
|
DirectoryInfo info = new DirectoryInfo("./");
|
|
FileInfo[] daten = info.GetFiles("*.xml");
|
|
foreach(FileInfo aktuell in daten) {
|
|
XMLParse ser = new XMLParse(aktuell.FullName);
|
|
objekte.AddRange(ser.KanalObjekte);
|
|
}
|
|
|
|
//XMLParse ser = new XMLParse("KS_Oldenburg_Heideweg.xml");
|
|
//objekte.AddRange(ser.KanalObjekte);
|
|
//objekte = objekte.OrderBy(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum);
|
|
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) {
|
|
Dictionary<string,decimal> s = Calculate.CalculateDay(objekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals(datum)));
|
|
Console.WriteLine("Umsatz am : "+datum + " " + s["Umsatz"]);
|
|
gesamt +=s["Umsatz"];
|
|
//if(datum.Equals("05.08.2021")) Debugger.Break();
|
|
}
|
|
Console.WriteLine(gesamt + " Durchschnitt : "+gesamt / datums.Count());
|
|
|
|
}
|
|
}
|
|
}
|