From 15f431f3ef086c98b60b4bc0d0d80897db6ec173 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 28 Jul 2020 16:58:26 +0200 Subject: [PATCH] Refresh QRCode gen --- NKC_WF/NKC_WF.csproj | 2 +- NKC_WF/WebUserControls/cmp_secScreen.ascx | 17 ++++--- NKC_WF/WebUserControls/cmp_secScreen.ascx.cs | 44 +++--------------- .../cmp_secScreen.ascx.designer.cs | 31 +----------- NKC_WF/site/SecondScreen.aspx.cs | 1 - NKC_WF/temp/{119752.pdf => none.pdf} | Bin 6 files changed, 18 insertions(+), 77 deletions(-) rename NKC_WF/temp/{119752.pdf => none.pdf} (100%) diff --git a/NKC_WF/NKC_WF.csproj b/NKC_WF/NKC_WF.csproj index f34cebf..efde2b9 100644 --- a/NKC_WF/NKC_WF.csproj +++ b/NKC_WF/NKC_WF.csproj @@ -1369,7 +1369,7 @@ Always - + Web.config diff --git a/NKC_WF/WebUserControls/cmp_secScreen.ascx b/NKC_WF/WebUserControls/cmp_secScreen.ascx index 9c2733a..a01cbef 100644 --- a/NKC_WF/WebUserControls/cmp_secScreen.ascx +++ b/NKC_WF/WebUserControls/cmp_secScreen.ascx @@ -4,15 +4,13 @@
-
<%--Scambia--%> - SHOW SHEET - OPEN PDF +
<%: traduci("ShowCurrSheet") %>

<%: traduci("SecScreen") %> - @@ -20,17 +18,18 @@

- + +
<%: traduci("ShowPDF") %>
- +
-
- <%-- + <%--
+ --%> + -
+
--%>
diff --git a/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs b/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs index 5ece240..b317fab 100644 --- a/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs @@ -18,11 +18,10 @@ namespace NKC_WF.WebUserControls { if (!Page.IsPostBack) { - showMode = true; // recupero numero currNum = ComLib.getSecScreenCode(); doUpdate(); - pdfPath = "../temp/119752.pdf"; + pdfPath = "../temp/none.pdf"; SheetId = 999999999; } } @@ -54,19 +53,6 @@ namespace NKC_WF.WebUserControls hlShowCurrSheet.NavigateUrl = $"~/site/SvgFull?sheetId={value}"; } } - public bool showMode - { - get - { - bool answ = false; - bool.TryParse(hfShowMode.Value, out answ); - return answ; - } - set - { - hfShowMode.Value = value.ToString(); - } - } public string pdfPath { get @@ -76,7 +62,6 @@ namespace NKC_WF.WebUserControls set { // FIXME TODO necessario copiare in locale il pdf? - lblPdf.Text = value.Trim(); hlPdfOpener.NavigateUrl = value.Trim(); } @@ -104,32 +89,17 @@ namespace NKC_WF.WebUserControls /// Aggiorna componente principale e child components /// public void doUpdate() - { - // genero nuovo QR - string qrUrl = getImageUrl(); - divImg.Visible = showMode; - canvasPdf.Visible = !showMode; - imgQrSmall.Visible = !showMode; - // fix img! - if (showMode) - { - imgQrMain.ImageUrl = qrUrl; - } - else - { - imgQrSmall.ImageUrl = qrUrl; - } - } - - protected void lbtScambia_Click(object sender, EventArgs e) { // valutato ma non usato pdf.js: // https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples - pdfPath = ComLib.getSecScreenRequest(codSSC); - showMode = !showMode; - doUpdate(); + string newPath = ComLib.getSecScreenRequest(codSSC); + pdfPath = string.IsNullOrEmpty(newPath) ? "../temp/none.pdf" : newPath; + // genero nuovo QR + string qrUrl = getImageUrl(); + imgQrMain.ImageUrl = qrUrl; } + } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs index 3a1b1d5..b999108 100644 --- a/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs @@ -23,15 +23,6 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.HiddenField hfNum; - /// - /// Controllo hfShowMode. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.HiddenField hfShowMode; - /// /// Controllo hfBatchId. /// @@ -59,15 +50,6 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.HyperLink hlShowCurrSheet; - /// - /// Controllo hlPdfOpener. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.HyperLink hlPdfOpener; - /// /// Controllo lblNum. /// @@ -87,13 +69,13 @@ namespace NKC_WF.WebUserControls protected global::System.Web.UI.WebControls.Label lblPdf; /// - /// Controllo imgQrSmall. + /// Controllo hlPdfOpener. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.Image imgQrSmall; + protected global::System.Web.UI.WebControls.HyperLink hlPdfOpener; /// /// Controllo divImg. @@ -112,14 +94,5 @@ namespace NKC_WF.WebUserControls /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Image imgQrMain; - - /// - /// Controllo canvasPdf. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl canvasPdf; } } diff --git a/NKC_WF/site/SecondScreen.aspx.cs b/NKC_WF/site/SecondScreen.aspx.cs index ffb25f7..18fa833 100644 --- a/NKC_WF/site/SecondScreen.aspx.cs +++ b/NKC_WF/site/SecondScreen.aspx.cs @@ -15,7 +15,6 @@ namespace NKC_WF protected void timerSecScreen_Tick(object sender, EventArgs e) { - cmp_secScreen.showMode = !cmp_secScreen.showMode; cmp_secScreen.doUpdate(); } } diff --git a/NKC_WF/temp/119752.pdf b/NKC_WF/temp/none.pdf similarity index 100% rename from NKC_WF/temp/119752.pdf rename to NKC_WF/temp/none.pdf