From e88e90edd80a7d384f2794deb806e56f2e44a64e Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 15 Jul 2020 18:41:04 +0200 Subject: [PATCH] Ancora fix livello segnalazioni --- .editorconfig | 21 ++++ NKC_WF/site/DBG_QRCode_Unload.aspx.cs | 6 +- NKC_WF/site/GlobalSearch.aspx.cs | 8 +- NKC_WF/site/Home.aspx.cs | 6 +- NKC_WF/site/KitRequestImporter.aspx.cs | 136 ++++++++++++------------- 5 files changed, 93 insertions(+), 84 deletions(-) diff --git a/.editorconfig b/.editorconfig index 063703e..2d73c79 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,24 @@ dotnet_diagnostic.CA5368.severity = none # CA1707: Gli identificatori non devono contenere caratteri di sottolineatura dotnet_diagnostic.CA1707.severity = none + +# CA1822: Contrassegnare i membri come static +dotnet_diagnostic.CA1822.severity = none + +# CA1051: Non dichiarare campi di istanza visibili +dotnet_diagnostic.CA1051.severity = none + +# IDE0055: Correggi formattazione +dotnet_diagnostic.IDE0055.severity = none + +# CA1305: Specificare IFormatProvider +dotnet_diagnostic.CA1305.severity = none + +# IDE0071: Semplifica l'interpolazione +dotnet_style_prefer_simplified_interpolation = true:none + +# Default severity for analyzer diagnostics with category 'Globalization' +dotnet_analyzer_diagnostic.category-Globalization.severity = none + +# CA1806: Non ignorare i risultati del metodo +dotnet_diagnostic.CA1806.severity = none diff --git a/NKC_WF/site/DBG_QRCode_Unload.aspx.cs b/NKC_WF/site/DBG_QRCode_Unload.aspx.cs index f43c3b9..ad52442 100644 --- a/NKC_WF/site/DBG_QRCode_Unload.aspx.cs +++ b/NKC_WF/site/DBG_QRCode_Unload.aspx.cs @@ -1,15 +1,11 @@ using AppData; using SteamWare; using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; namespace NKC_WF.site { - public partial class DBG_QRCode_Unload : System.Web.UI.Page + public partial class DBG_QRCode_Unload : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { diff --git a/NKC_WF/site/GlobalSearch.aspx.cs b/NKC_WF/site/GlobalSearch.aspx.cs index dbeb82f..4be9e43 100644 --- a/NKC_WF/site/GlobalSearch.aspx.cs +++ b/NKC_WF/site/GlobalSearch.aspx.cs @@ -1,11 +1,7 @@ using AppData; using NKC_SDK; using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; namespace NKC_WF.site { @@ -38,7 +34,7 @@ namespace NKC_WF.site set { // solo se è !="" - if (value != "") + if (!string.IsNullOrEmpty(value)) { hfLastValidBCode.Value = value; } @@ -125,7 +121,7 @@ namespace NKC_WF.site cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action"); doShowResults = false; break; - } + } return doShowResults; } diff --git a/NKC_WF/site/Home.aspx.cs b/NKC_WF/site/Home.aspx.cs index 7779564..9163a9f 100644 --- a/NKC_WF/site/Home.aspx.cs +++ b/NKC_WF/site/Home.aspx.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; namespace NKC_WF { - public partial class Home : BasePage + public partial class Home : BasePage { protected void Page_Load(object sender, EventArgs e) { diff --git a/NKC_WF/site/KitRequestImporter.aspx.cs b/NKC_WF/site/KitRequestImporter.aspx.cs index 493dfda..6007e13 100644 --- a/NKC_WF/site/KitRequestImporter.aspx.cs +++ b/NKC_WF/site/KitRequestImporter.aspx.cs @@ -5,74 +5,74 @@ using System.Web.UI; namespace NKC_WF { - public partial class KitRequestImporter : BasePage - { - /// - /// Folder REMOTA x copia verso SQL - /// - protected string _SqlCopyDir = memLayer.ML.CRS("_SqlCopyDir"); - /// - /// Folder x SQL import - /// - protected string _SqlImportDir = memLayer.ML.CRS("_SqlImportDir"); - - protected void Page_Load(object sender, EventArgs e) + public partial class KitRequestImporter : BasePage { - if (!Page.IsPostBack) - { - ((SiteContent)this.Master).showSearch = false; - doUpdate(); - cmp_kitImpCheck.Visible = false; - } - cmp_kitImpCheck.eh_doRefresh += Cmp_kitImpCheck_eh_doRefresh; - cmp_fileUpload.eh_doRefresh += Cmp_fileUpload_eh_doRefresh; - cmp_fileUpload.eh_FileUploaded += Cmp_fileUpload_eh_FileUploaded; + /// + /// Folder REMOTA x copia verso SQL + /// + protected string _SqlCopyDir = memLayer.ML.CRS("_SqlCopyDir"); + /// + /// Folder x SQL import + /// + protected string _SqlImportDir = memLayer.ML.CRS("_SqlImportDir"); + + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + ((SiteContent)this.Master).showSearch = false; + doUpdate(); + cmp_kitImpCheck.Visible = false; + } + cmp_kitImpCheck.eh_doRefresh += Cmp_kitImpCheck_eh_doRefresh; + cmp_fileUpload.eh_doRefresh += Cmp_fileUpload_eh_doRefresh; + cmp_fileUpload.eh_FileUploaded += Cmp_fileUpload_eh_FileUploaded; + } + + private void Cmp_kitImpCheck_eh_doRefresh(object sender, EventArgs e) + { + doUpdate(); + } + + /// + /// Ora continuo processing + /// + /// + /// + private void Cmp_fileUpload_eh_FileUploaded(object sender, WebUserContols.FileUploadEventArgs e) + { + cmp_kitImpCheck.Visible = true; + DateTime adesso = DateTime.Now; + string dirFrom = e.LocalPath; + string dirTo = $"{_SqlCopyDir}{adesso.ToString("yyyy-MM")}\\"; + string dirImport = $"{_SqlImportDir}{adesso.ToString("yyyy-MM")}\\"; + // copio su server SQL + try + { + // copio su SQL... + fileMover.obj.copiaFile(dirFrom, dirTo, e.FileName); + } + catch (Exception exc) + { + logger.lg.scriviLog($"KitCsvMan: Eccezione in Copia SQL file:{Environment.NewLine}{exc}"); + } + // salvo dati + cmp_kitImpCheck.fileName = e.FileName; + cmp_kitImpCheck.batchName = e.BatchName; + // chiamo procedure check... + cmp_kitImpCheck.tryImport(true); + doUpdate(); + } + + private void Cmp_fileUpload_eh_doRefresh(object sender, EventArgs e) + { + doUpdate(); + } + + + public void doUpdate() + { + + } } - - private void Cmp_kitImpCheck_eh_doRefresh(object sender, EventArgs e) - { - doUpdate(); - } - - /// - /// Ora continuo processing - /// - /// - /// - private void Cmp_fileUpload_eh_FileUploaded(object sender, WebUserContols.FileUploadEventArgs e) - { - cmp_kitImpCheck.Visible = true; - DateTime adesso = DateTime.Now; - string dirFrom = e.LocalPath; - string dirTo = $"{_SqlCopyDir}{adesso.ToString("yyyy-MM")}\\"; - string dirImport = $"{_SqlImportDir}{adesso.ToString("yyyy-MM")}\\"; - // copio su server SQL - try - { - // copio su SQL... - fileMover.obj.copiaFile(dirFrom, dirTo, e.FileName); - } - catch (Exception exc) - { - logger.lg.scriviLog($"KitCsvMan: Eccezione in Copia SQL file:{Environment.NewLine}{exc}"); - } - // salvo dati - cmp_kitImpCheck.fileName = e.FileName; - cmp_kitImpCheck.batchName = e.BatchName; - // chiamo procedure check... - cmp_kitImpCheck.tryImport(true); - doUpdate(); - } - - private void Cmp_fileUpload_eh_doRefresh(object sender, EventArgs e) - { - doUpdate(); - } - - - public void doUpdate() - { - - } - } } \ No newline at end of file