50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
using Hochbaustatistik.Business;
|
|
using Hochbaustatistik.Database;
|
|
using Hochbaustatistik.Utilities;
|
|
using NLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace Hochbaustatistik
|
|
{
|
|
static class Program
|
|
{
|
|
private static readonly Logger _logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
static string pathUser = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
string[] config = File.ReadLines(@".\config\config.txt").ToArray();
|
|
string pathDownloadedList = Path.Combine(pathUser, "Downloads", config[3]);
|
|
|
|
//Download Liste, falls nicht vorhanden
|
|
if (!File.Exists(pathDownloadedList))
|
|
VariousHelper.DownloadList(config[2]);
|
|
|
|
string resultFile = Path.Combine(pathUser, "Downloads", "result.csv");
|
|
|
|
DatabaseOperations.conString = config[0];
|
|
|
|
Console.WriteLine("Erstelle Hochbaustatistik... Bitte warten.");
|
|
_logger.Info("Beginne Hochbaustatistik");
|
|
|
|
List<VorgangItnrw> hochbauListe = FileOperations.GenerateHochbauVorgangFromCSV(pathDownloadedList);
|
|
|
|
DataOpsSingleton instance = DataOpsSingleton.Instance;
|
|
instance.MergeInproWithITNRW(resultFile, hochbauListe);
|
|
|
|
Console.WriteLine("{0} erstellt.", resultFile);
|
|
|
|
Console.WriteLine("Fehler: {0}", instance.CountErrors);
|
|
Console.WriteLine("Fehler NICHT korrigiert: {0}", instance.CountErrorsNotCorrected);
|
|
|
|
Console.ForegroundColor = ConsoleColor.Green;
|
|
Console.WriteLine("Fertig. Das Fenster kann geschlossen werden.");
|
|
Console.ReadLine();
|
|
}
|
|
}
|
|
}
|