From 9f8cd7ea62ede2f761524be94983fb0adaa01bc0 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 21 Dec 2018 09:09:23 +0100 Subject: [PATCH] =?UTF-8?q?fIX=20BUG=20VISIBILIT=C3=A0=20DELETE=20IN=20SCH?= =?UTF-8?q?EDA=20SINGOLA=20KIT=20ANIME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mod_storicoAzioniOperatore.ascx | 2 +- .../mod_storicoAzioniOperatore.ascx.cs | 35 +++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx b/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx index e7bc986b..ab2a128e 100644 --- a/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx +++ b/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx @@ -14,7 +14,7 @@ - + diff --git a/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx.cs b/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx.cs index ea3ed64d..8a844e95 100644 --- a/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx.cs +++ b/GMW/WebUserControls/mod_storicoAzioniOperatore.ascx.cs @@ -87,18 +87,47 @@ namespace GMW.WebUserControls /// private void setBtnState() { - btnElimina.Visible = memLayer.ML.confReadBool("userCanDelUdc") && showDelete; + bool showDelUdc = memLayer.ML.confReadBool("userCanDelUdc") && showDelete; + btnElimina.Visible = false; bool abilita = false; string css = "btn btn-default disabled"; + // se ho udc selezionato verifico se sia eliminabile + if (udcSel != "" && showDelUdc) + { + // controllo con stored SE sia possibile cancellare UDC: + // inizio stringa può essere OK --> mostro delete (e POTREI aggiungere nota su cosa sia e che posso cancellare) + // ERR --> NON mostro delete ma solo errore + + string answ = ""; + MagClass.magazzino.taUdcChk4Del.GetData(udcSel, ref answ); + // controllo esito + if (answ.StartsWith("OK")) + { + showDelUdc = true; + } + else + { + showDelUdc = false; + } + btnElimina.Visible = showDelUdc; + } if (idxEvento > 0 && udcSel != "") { - abilita = true; - css = "btn btn-default"; + if (MagClass.magazzino.checkUDC(udcSel) || (MagClass.magazzino.checkAL(udcSel) && udcSel.StartsWith("A"))) + { + abilita = true; + css = "btn btn-default"; + } } btnStampa.Enabled = abilita; btnElimina.Enabled = abilita; btnStampa.CssClass = css; btnElimina.CssClass = css; + // se è AL NON permetto ristampa (SE consumato) + if (udcSel.StartsWith("A")) + { + btnStampa.Visible = showDelUdc; + } } /// /// indica name della postazione corrente