From ba76c08962940bf788e587db11f7d5205384adcf Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 25 Jan 2022 17:27:51 +0100 Subject: [PATCH] Typo fix admin fasi --- GPW_Admin/WebUserControls/mod_adminFasi.ascx.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GPW_Admin/WebUserControls/mod_adminFasi.ascx.cs b/GPW_Admin/WebUserControls/mod_adminFasi.ascx.cs index 132e5bb..1f6a5c8 100644 --- a/GPW_Admin/WebUserControls/mod_adminFasi.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_adminFasi.ascx.cs @@ -533,16 +533,18 @@ namespace GPW_Admin.WebUserControls public bool delEnabled(object _totOre, object _idxFase, object _idxFaseAncest) { bool answ = isWritable(); + int idxFase = 0; + int idxFaseAnc = 0; // solo se ha diritti scrittura controllo if (answ && _totOre != null && _idxFase != null && _idxFaseAncest != null) { // se รจ una fase master (ancestor == 0 ) e ha child --> false... - int idxFaseAnc = 0; _ = int.TryParse($"{_idxFaseAncest}", out idxFaseAnc); + _ = int.TryParse($"{_idxFase}", out idxFase); if (idxFaseAnc == 0) { // verifico: se ha child --> NON eliminabile - int numFasiChild = DataProxy.DP.taAF.getByAncest(idxFaseAnc).Count; + int numFasiChild = DataProxy.DP.taAF.getByAncest(idxFase).Count; answ = numFasiChild == 0; } else @@ -553,8 +555,6 @@ namespace GPW_Admin.WebUserControls // se fosse true --> procedo con controllo fasi if (answ) { - int idxFase = 0; - _ = int.TryParse($"{_idxFase}", out idxFase); answ = !hasChildObj(idxFase); } }