From 3123dbbd1b828bc285819e971e703019fa4a1c73 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 7 Nov 2017 16:41:48 +0100 Subject: [PATCH] inizio ad inserire gestione update e download in title di TAB... --- MP-Tablet/Web.config | 3 +- MP-Tablet/WebUserControls/mod_title.ascx | 37 +++++---- MP-Tablet/WebUserControls/mod_title.ascx.cs | 48 ++++++++++- .../mod_title.ascx.designer.cs | 80 ++++++++++++------- 4 files changed, 124 insertions(+), 44 deletions(-) diff --git a/MP-Tablet/Web.config b/MP-Tablet/Web.config index b0db1a58..9340a198 100644 --- a/MP-Tablet/Web.config +++ b/MP-Tablet/Web.config @@ -37,13 +37,14 @@ - + + diff --git a/MP-Tablet/WebUserControls/mod_title.ascx b/MP-Tablet/WebUserControls/mod_title.ascx index 5b7560db..e623a229 100644 --- a/MP-Tablet/WebUserControls/mod_title.ascx +++ b/MP-Tablet/WebUserControls/mod_title.ascx @@ -1,23 +1,30 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_title.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_title" %>
-
-
- - MoonProTablet -
+
+
+ + MoonProTablet
-
-
- - | +
+
+
+ + | -
-
- - | - -
+
+ + | + + +
+ + + + +
+
+
diff --git a/MP-Tablet/WebUserControls/mod_title.ascx.cs b/MP-Tablet/WebUserControls/mod_title.ascx.cs index 94b22968..d6601153 100644 --- a/MP-Tablet/WebUserControls/mod_title.ascx.cs +++ b/MP-Tablet/WebUserControls/mod_title.ascx.cs @@ -16,6 +16,16 @@ namespace MoonProTablet.WebUserControls /// protected string postazione_IP = ""; /// + /// Versione corrente sw + /// + protected Version currVersion + { + get + { + return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + } + } + /// /// caricamento pagina /// /// @@ -57,7 +67,7 @@ namespace MoonProTablet.WebUserControls } lblSwData.Text = swData; //lblVers.Text = string.Format("{0}.{1}", memLayer.ML.CRS("mainRev"), memLayer.ML.CRS("minRev")); - lblVers.Text = string.Format("v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version); + lblVers.Text = string.Format("v.{0}", currVersion);// System.Reflection.Assembly.GetExecutingAssembly().GetName().Version); } /// /// verifica al presenza di un cookie VALIDO per autorizzare il device @@ -138,5 +148,41 @@ namespace MoonProTablet.WebUserControls { lblData.Text = string.Format("{0:dd/MM/yyyy - HH:mm:ss}", DateTime.Now); } + /// + /// Effettua verifica versione... + /// + /// + /// + protected void lbtCheckUpdate_Click(object sender, EventArgs e) + { + // controllo versione + Version remoteVersion = UpdateMan.obj.lastVers(updateUrl).CurrentVersion; + // se c'è update mostro download... + if (remoteVersion > currVersion) + { + lbtDownloadUpdate.Text = string.Format("DOWNLOAD --> {0}", remoteVersion); + lbtDownloadUpdate.Visible = true; + lbtCheckUpdate.Visible = false; + } + } + + protected void lbtDownloadUpdate_Click(object sender, EventArgs e) + { + // scarico... + + // nascondo button download + lbtDownloadUpdate.Visible = false; + lbtCheckUpdate.Visible = true; + } + /// + /// URLK stringa di UPDATE... + /// + protected string updateUrl + { + get + { + return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/TAB/{0}/manifest.xml", memLayer.ML.CRS("appVers")); + } + } } } \ No newline at end of file diff --git a/MP-Tablet/WebUserControls/mod_title.ascx.designer.cs b/MP-Tablet/WebUserControls/mod_title.ascx.designer.cs index c4c791aa..c98a60fb 100644 --- a/MP-Tablet/WebUserControls/mod_title.ascx.designer.cs +++ b/MP-Tablet/WebUserControls/mod_title.ascx.designer.cs @@ -1,69 +1,95 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -namespace MoonProTablet.WebUserControls -{ - - +namespace MoonProTablet.WebUserControls { + + public partial class mod_title { /// - /// logoSW control. + /// Controllo logoSW. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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 logoSW; /// - /// lblSwData control. + /// Controllo lblSwData. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblSwData; /// - /// lblData control. + /// Controllo lblData. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblData; /// - /// lblIpData control. + /// Controllo lblIpData. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblIpData; /// - /// lblVers control. + /// Controllo lblVers. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblVers; /// - /// Timer1 control. + /// Controllo divCheckVers. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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 divCheckVers; + + /// + /// Controllo lbtCheckUpdate. + /// + /// + /// 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.LinkButton lbtCheckUpdate; + + /// + /// Controllo lbtDownloadUpdate. + /// + /// + /// 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.LinkButton lbtDownloadUpdate; + + /// + /// Controllo Timer1. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.Timer Timer1; }