diff --git a/.editorconfig b/.editorconfig index 73e79f3..770d280 100644 --- a/.editorconfig +++ b/.editorconfig @@ -35,3 +35,9 @@ dotnet_diagnostic.CA1806.severity = none # Default severity for analyzer diagnostics with category 'Design' dotnet_analyzer_diagnostic.category-Design.severity = none + +# CA1716: Gli identificatori non devono corrispondere a parole chiave +dotnet_diagnostic.CA1716.severity = none + +# CA2227: Le proprietà delle raccolte devono essere di sola lettura +dotnet_diagnostic.CA2227.severity = none diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 91861b8..0f66f66 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -162,7 +162,7 @@ namespace AppData // fatto! answ = true; } - catch (Exception exc) + catch { } return answ; } @@ -590,7 +590,7 @@ namespace AppData memLayer.ML.setRSV(currBatchReqKey, nextEnv); answ = true; } - catch (Exception exc) + catch { } // restituisco ok return answ; @@ -1275,7 +1275,7 @@ namespace AppData answ = convertSheetWorkList(sheetList); } } - catch (Exception exc) + catch { } return answ; } diff --git a/NKC_WF/Controllers/AliveController.cs b/NKC_WF/Controllers/AliveController.cs index 730fd50..994272c 100644 --- a/NKC_WF/Controllers/AliveController.cs +++ b/NKC_WF/Controllers/AliveController.cs @@ -19,7 +19,7 @@ namespace NKC_WF.Controllers [HttpGet] public string Get(int id) { - return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + return DateTime.Now.ToString($"yyyy-MM-dd HH:mm:ss.fff - ID: {id}"); } } diff --git a/NKC_WF/Web.Debug-LELE.config b/NKC_WF/Web.Debug-LELE.config index f81b060..96d5c14 100644 --- a/NKC_WF/Web.Debug-LELE.config +++ b/NKC_WF/Web.Debug-LELE.config @@ -4,9 +4,6 @@ - - - diff --git a/NKC_WF/Web.Debug.config b/NKC_WF/Web.Debug.config index 8531823..36d7d98 100644 --- a/NKC_WF/Web.Debug.config +++ b/NKC_WF/Web.Debug.config @@ -4,10 +4,6 @@ - - - - diff --git a/NKC_WF/WebUserControls/cmp_barcode.ascx.cs b/NKC_WF/WebUserControls/cmp_barcode.ascx.cs index 237df94..bc8d7bc 100644 --- a/NKC_WF/WebUserControls/cmp_barcode.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_barcode.ascx.cs @@ -92,7 +92,7 @@ namespace NKC_WF.WebUserControls public void showOutput(string cssClass, string messaggio) { // In primis: mostro qualcosa SOLO SE ho del testo - lblOutput.Visible = (messaggio != ""); + lblOutput.Visible = !string.IsNullOrEmpty(messaggio); lblOutput.Text = messaggio; lblOutput.Attributes.Remove("class"); lblOutput.Attributes.Add("class", cssClass); diff --git a/NKC_WF/WebUserControls/cmp_batchDetail.ascx b/NKC_WF/WebUserControls/cmp_batchDetail.ascx index 67fea31..362a8c0 100644 --- a/NKC_WF/WebUserControls/cmp_batchDetail.ascx +++ b/NKC_WF/WebUserControls/cmp_batchDetail.ascx @@ -8,9 +8,9 @@

Batch Detail

- Send to Estimation + Send to Estimation Stop Estimation - Send to Nesting + Send to Nesting Stop Nesting Accept Nesting
diff --git a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs index be1c7ac..f82f7ae 100644 --- a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs @@ -229,7 +229,7 @@ namespace NKC_WF.WebUserControls answ = (status == (int)statusReq); return answ; } - public bool canStartNew(object _status) + public bool canStartNew() { bool answ = false; // in primis controllo SE ci siano task running, nel qual caso è false e basta... diff --git a/NKC_WF/WebUserControls/cmp_kittingCart.ascx.cs b/NKC_WF/WebUserControls/cmp_kittingCart.ascx.cs index af4aae8..dc9459f 100644 --- a/NKC_WF/WebUserControls/cmp_kittingCart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_kittingCart.ascx.cs @@ -28,9 +28,5 @@ namespace NKC_WF.WebUserControls } return answ; } - public string getTitle(object val) - { - return ""; - } } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs index 4728b9f..70d351a 100644 --- a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs @@ -176,7 +176,7 @@ namespace NKC_WF.WebUserControls set { // solo se è !="" - if (value != "") + if (!string.IsNullOrEmpty(value)) { hfLastValidBCode.Value = value; } @@ -202,7 +202,7 @@ namespace NKC_WF.WebUserControls private bool processLastCmd(bool doRaiseEv) { - if (lastCmd == "") doRaiseEv = true; + if (string.IsNullOrEmpty(lastCmd)) doRaiseEv = true; // processiamo barcode letto decodedData decoData = DataLayer.man.decodeBcode(lastCmd); switch (decoData.codeType) @@ -442,10 +442,10 @@ namespace NKC_WF.WebUserControls // salvo che è in STATO 2 (picked up) DataLayer.man.taIL.updateStatus(itemRow.ItemID, 2, PlaceId); // verifico cosa devo mostrare come PROX passaggio... - showCart = itemRow.ProcessesReq == ""; + showCart = string.IsNullOrEmpty(itemRow.ProcessesReq); showBin = (itemRow.ProcessesReq.Contains("PaintFlag")); secOp = itemRow.PostProcList; - showSecOp = (secOp != ""); + showSecOp = (!string.IsNullOrEmpty(secOp)); doUpdate(); break; case 3: diff --git a/NKC_WF/WebUserControls/cmp_menuTop.ascx.cs b/NKC_WF/WebUserControls/cmp_menuTop.ascx.cs index ee9d359..d697cd7 100644 --- a/NKC_WF/WebUserControls/cmp_menuTop.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_menuTop.ascx.cs @@ -40,7 +40,7 @@ namespace NKC_WF.WebUserControls private void doSearch() { // se searchVal !="" - if (searchVal != "") + if (!string.IsNullOrEmpty(searchVal)) { memLayer.ML.setSessionVal("valoreSearch", searchVal); } diff --git a/NKC_WF/WebUserControls/cmp_offOrderDetail.ascx.cs b/NKC_WF/WebUserControls/cmp_offOrderDetail.ascx.cs index 1ac5939..712e652 100644 --- a/NKC_WF/WebUserControls/cmp_offOrderDetail.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_offOrderDetail.ascx.cs @@ -41,7 +41,7 @@ namespace NKC_WF.WebUserControls { Label filePath = (Label)frmView.FindControl("DrawFilePathLabel"); // se ho una stringa valida mostro svg, altrimenti NOT PROCESSED... - if (filePath.Text != "") + if (!string.IsNullOrEmpty(filePath.Text)) { string filename = Server.MapPath(filePath.Text); string svgRawData = File.ReadAllText(filename); diff --git a/NKC_WF/WebUserControls/cmp_offlineOrders.ascx.cs b/NKC_WF/WebUserControls/cmp_offlineOrders.ascx.cs index 6bb8c85..491a087 100644 --- a/NKC_WF/WebUserControls/cmp_offlineOrders.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_offlineOrders.ascx.cs @@ -68,7 +68,7 @@ namespace NKC_WF.WebUserControls { if (currOrd.Count == 1) { - if (currOrd[0].OrdStatus == 1 && currOrd[0].DrawFilePath == "") + if (currOrd[0].OrdStatus == 1 && string.IsNullOrEmpty(currOrd[0].DrawFilePath)) { fatto = ComLib.checkOfflineOrderReq(selOrdId); } diff --git a/NKC_WF/WebUserControls/cmp_painting.ascx.cs b/NKC_WF/WebUserControls/cmp_painting.ascx.cs index de2aa08..e4dd9cc 100644 --- a/NKC_WF/WebUserControls/cmp_painting.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_painting.ascx.cs @@ -33,7 +33,7 @@ namespace NKC_WF.WebUserControls set { // solo se è !="" - if (value != "") + if (!string.IsNullOrEmpty(value)) { hfLastValidBCode.Value = value; } @@ -76,7 +76,7 @@ namespace NKC_WF.WebUserControls private bool processLastCmd(bool doRaiseEv) { // verifico il datamatrix dei BIN da pitturare - if (lastCmd == "") doRaiseEv = true; + if (string.IsNullOrEmpty(lastCmd)) doRaiseEv = true; // processiamo barcode letto decodedData decoData = DataLayer.man.decodeBcode(lastCmd); switch (decoData.codeType) diff --git a/NKC_WF/WebUserControls/cmp_stackBuilding.ascx.cs b/NKC_WF/WebUserControls/cmp_stackBuilding.ascx.cs index f685012..d41c458 100644 --- a/NKC_WF/WebUserControls/cmp_stackBuilding.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackBuilding.ascx.cs @@ -141,7 +141,7 @@ namespace NKC_WF.WebUserControls } else { - if (_prepared.ToString() != "") + if (!string.IsNullOrEmpty(_prepared.ToString())) { answ = "table-success border border-success border-thick rounded"; } diff --git a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs index 2610210..62d76e6 100644 --- a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs @@ -76,7 +76,7 @@ namespace NKC_WF.WebUserControls bool doRaiseEv = false; // processo evento.. lastCmd = cmp_barcode.inputAcquired.ToUpper(); - if (lastCmd == "") + if (string.IsNullOrEmpty(lastCmd)) { doRaiseEv = true; } diff --git a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs index 785d47c..bc878bc 100644 --- a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs @@ -176,7 +176,7 @@ namespace NKC_WF.WebUserControls set { // solo se è !="" - if (value != "") + if (!string.IsNullOrEmpty(value)) { hfLastValidBCode.Value = value; } @@ -202,7 +202,7 @@ namespace NKC_WF.WebUserControls private bool processLastCmd(bool doRaiseEv) { - if (lastCmd == "") doRaiseEv = true; + if (string.IsNullOrEmpty(lastCmd)) doRaiseEv = true; // processiamo barcode letto decodedData decoData = DataLayer.man.decodeBcode(lastCmd); switch (decoData.codeType) @@ -445,10 +445,10 @@ namespace NKC_WF.WebUserControls // salvo che è in STATO 2 (picked up) DataLayer.man.taIL.updateStatus(itemRow.ItemID, 2, PlaceId); // verifico cosa devo mostrare come PROX passaggio... - showCart = itemRow.ProcessesReq == ""; + showCart = string.IsNullOrEmpty(itemRow.ProcessesReq); showBin = (itemRow.ProcessesReq.Contains("PaintFlag")); secOp = itemRow.PostProcList; - showSecOp = (secOp != ""); + showSecOp = (!string.IsNullOrEmpty(secOp)); doUpdate(); break; case 3: diff --git a/NKC_WF/WebUserControls/mod_ricercaGenerica.ascx.cs b/NKC_WF/WebUserControls/mod_ricercaGenerica.ascx.cs index 524bf16..71fab86 100644 --- a/NKC_WF/WebUserControls/mod_ricercaGenerica.ascx.cs +++ b/NKC_WF/WebUserControls/mod_ricercaGenerica.ascx.cs @@ -148,7 +148,7 @@ namespace NKC_WF.WebUserControls /// public void updateText() { - if (SteamWare.memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack) + if (!string.IsNullOrEmpty(memLayer.ML.StringSessionObj("valoreCercato")) && !Page.IsPostBack) { testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercato"); } diff --git a/NKC_WF/WebUserControls/mod_vocabolario.ascx.cs b/NKC_WF/WebUserControls/mod_vocabolario.ascx.cs index 1ea7c66..6f17de4 100644 --- a/NKC_WF/WebUserControls/mod_vocabolario.ascx.cs +++ b/NKC_WF/WebUserControls/mod_vocabolario.ascx.cs @@ -39,7 +39,7 @@ namespace NKC_WF.WebUserControls /// private void creaNuovoLemma() { - if (txtNewLemma.Text != "") + if (!string.IsNullOrEmpty(txtNewLemma.Text)) { // inserisco DataWrap.DW.creaNuovoLemmaVoc(txtNewLemma.Text.Trim());