From 250c4a44d3a2e6e200ce72e8882bd422c94d524d Mon Sep 17 00:00:00 2001 From: Gianmarco Mucciariello Date: Mon, 23 Jun 2025 15:13:01 +0200 Subject: [PATCH] aggiunti log --- .../NLog.config | 12 ++++++++++-- .../BusinessLayer/UtilityBusinessLayer.cs | 5 +++++ root/ContrattoSEI/PDFGenerator/DocumentPDF.cs | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/root/ContrattoSEI/GestoreTrimestrale_branch_applyingMVVM/NLog.config b/root/ContrattoSEI/GestoreTrimestrale_branch_applyingMVVM/NLog.config index 86068d5..7ef6b7f 100644 --- a/root/ContrattoSEI/GestoreTrimestrale_branch_applyingMVVM/NLog.config +++ b/root/ContrattoSEI/GestoreTrimestrale_branch_applyingMVVM/NLog.config @@ -9,7 +9,15 @@ - + + + + + + + + \ No newline at end of file diff --git a/root/ContrattoSEI/PDFGenerator/BusinessLayer/UtilityBusinessLayer.cs b/root/ContrattoSEI/PDFGenerator/BusinessLayer/UtilityBusinessLayer.cs index c139a65..cc1c763 100644 --- a/root/ContrattoSEI/PDFGenerator/BusinessLayer/UtilityBusinessLayer.cs +++ b/root/ContrattoSEI/PDFGenerator/BusinessLayer/UtilityBusinessLayer.cs @@ -216,6 +216,7 @@ namespace PDFGenerator.BusinessLayer var DataThreadsDT = (new SQLServer()).GetDataTableFromProcedure(CACHE.QueryContratti, pars); if (DataThreadsDT != null && DataThreadsDT.Rows.Count > 0) { + logger.Info($"Query contratti completata con successo. Trovate {DataThreadsDT.Rows.Count} righe"); ret = new List(); foreach (DataRow r in DataThreadsDT.Rows) { @@ -225,6 +226,10 @@ namespace PDFGenerator.BusinessLayer ); } } + else + { + logger.Warn($"Nessun dato trovato dalla query contratti: {CACHE.QueryContratti}"); + } } catch (Exception ex) { diff --git a/root/ContrattoSEI/PDFGenerator/DocumentPDF.cs b/root/ContrattoSEI/PDFGenerator/DocumentPDF.cs index 3caf58a..9fe9f85 100644 --- a/root/ContrattoSEI/PDFGenerator/DocumentPDF.cs +++ b/root/ContrattoSEI/PDFGenerator/DocumentPDF.cs @@ -796,7 +796,6 @@ namespace PDFGenerator if (string.IsNullOrWhiteSpace(_dataThread.NomeFilePdf)) { logger.Info("_dataThread.NomeFilePdf è vuoto"); - Console.WriteLine("_dataThread.NomeFilePdf è vuoto"); _dataThread.NomeFilePdf = "Test"; } @@ -809,7 +808,8 @@ namespace PDFGenerator int counter = 1; while (File.Exists(filePath)) { - filePath = System.IO.Path.Combine(folder, $"{fileNameBase}_{counter}.pdf"); + _dataThread.NomeFilePdf = $"{fileNameBase}_{counter}"; + filePath = System.IO.Path.Combine(folder, $"{_dataThread.NomeFilePdf}.pdf"); counter++; }