69 lines
1.7 KiB
C#
69 lines
1.7 KiB
C#
// See https://aka.ms/new-console-template for more information
|
|
|
|
// ExcImport: Excel Importer, per IobWin in logica lettura Giacenze
|
|
// parametri:
|
|
// $0: Path ConfigFile file per esecuzione
|
|
|
|
using EgwCApp.ExcImport;
|
|
using System.Diagnostics;
|
|
|
|
string separator = "--------------------------------------";
|
|
string fileName = "";
|
|
// controllo args, se mancassero o incompleti mostro help
|
|
if (args.Length < 1)
|
|
{
|
|
Console.WriteLine(separator);
|
|
Console.WriteLine("- ExcelFileImporter - Core 6.0");
|
|
Console.WriteLine("- v.0.0.0.0 | @Egalware 2022+");
|
|
Console.WriteLine(separator);
|
|
Console.WriteLine();
|
|
// provo a processare testConf...
|
|
fileName = "testConf.json";
|
|
Console.WriteLine("Mancano parametri per esecuzione:");
|
|
Console.WriteLine("$0: ConfigFile da impiegare");
|
|
Console.WriteLine("");
|
|
Console.WriteLine($"verrà usato {fileName}");
|
|
}
|
|
else
|
|
{
|
|
fileName = args[0];
|
|
}
|
|
|
|
#if DEBUG
|
|
Stopwatch sw = new Stopwatch();
|
|
sw.Start();
|
|
#endif
|
|
// ora processo se ho filename valido...
|
|
if (!string.IsNullOrEmpty(fileName))
|
|
{
|
|
// verifico se ho file...
|
|
if (File.Exists(fileName))
|
|
{
|
|
ImportProc importObj = new ImportProc(fileName);
|
|
bool stepOk = importObj.decodeConfig();
|
|
if (stepOk)
|
|
{
|
|
stepOk = importObj.doProcess();
|
|
if (!stepOk)
|
|
{
|
|
Console.WriteLine("Errore in processing file");
|
|
}
|
|
else
|
|
{
|
|
importObj.doReturn();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("Errore in processing config file");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("Errore file non trovato!");
|
|
}
|
|
}
|
|
#if DEBUG
|
|
sw.Stop();
|
|
Console.WriteLine($"Proc time: {sw.ElapsedMilliseconds}ms");
|
|
#endif |