diff --git a/MP/Controllers/HomeController.cs b/MP/Controllers/HomeController.cs index d3a70ec3..f2b07b97 100644 --- a/MP/Controllers/HomeController.cs +++ b/MP/Controllers/HomeController.cs @@ -65,13 +65,73 @@ namespace MP.Controllers { ViewBag.Title = "MoonPro"; ViewBag.Message = "Ultime release applicazioni"; - // Recupero ultime versioni applicazioni... - ViewBag.VersMpAdmin = "x.x.x.a"; - ViewBag.VersMpIO = "x.x.x.b"; - ViewBag.VersMpLand = "x.x.x.c"; - ViewBag.VersMpMon = "x.x.x.d"; - ViewBag.VersMpSite = "x.x.x.e"; - ViewBag.VersMpTab = "x.x.x.f"; + UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs(); + // Recupero info ADM... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("ADM")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpAdmin = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpAdmin = "ND"; + ViewBag.AdmDisabled = "disabled"; + } + // Recupero info IO... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("IO")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpIO = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpIO = "ND"; + ViewBag.IODisabled = "disabled"; + } + // Recupero info LAND... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("LAND")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpLand = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpLand = "ND"; + ViewBag.LandDisabled = "disabled"; + } + // Recupero info MON... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("MON")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpMon = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpMon = "ND"; + ViewBag.MonDisabled = "disabled"; + } + // Recupero info SITE... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("SITE")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpSite = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpSite = "ND"; + ViewBag.SiteDisabled = "disabled"; + } + // Recupero info TAB... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("TAB")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpTab = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpTab = "ND"; + ViewBag.TabDisabled = "disabled"; + } // salvo risultati... ViewBag.Results = results; // VIEW! @@ -95,17 +155,18 @@ namespace MP.Controllers { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); + int done = 0; // scarico TUTTI... - UpdateMan.obj.downloadLatest(updateUrl("ADM"), localDownloadPath("ADM")); - UpdateMan.obj.downloadLatest(updateUrl("IO"), localDownloadPath("IO")); - UpdateMan.obj.downloadLatest(updateUrl("LAND"), localDownloadPath("LAND")); - UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON")); - UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE")); - UpdateMan.obj.downloadLatest(updateUrl("TAB"), localDownloadPath("TAB")); + done += UpdateMan.obj.downloadLatest(updateUrl("ADM"), localDownloadPath("ADM")); + done += UpdateMan.obj.downloadLatest(updateUrl("IO"), localDownloadPath("IO")); + done += UpdateMan.obj.downloadLatest(updateUrl("LAND"), localDownloadPath("LAND")); + done += UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON")); + done += UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE")); + done += UpdateMan.obj.downloadLatest(updateUrl("TAB"), localDownloadPath("TAB")); stopWatch.Stop(); // calcolo elapsed time come TimeSpan value. TimeSpan ts = stopWatch.Elapsed; - resultsMsg = string.Format("OK: {0} DOWNLOADED, {1:0.000} sec", caller, ts.TotalSeconds); + resultsMsg = string.Format("OK: {0} Package downloaded, {1:0.000} sec", done, ts.TotalSeconds); } else { diff --git a/MP/Views/Home/Packages.cshtml b/MP/Views/Home/Packages.cshtml index 8e52cf8e..341649db 100644 --- a/MP/Views/Home/Packages.cshtml +++ b/MP/Views/Home/Packages.cshtml @@ -15,8 +15,8 @@

MP-ADMIN

- - v. @ViewBag.VersMpAdmin + + @ViewBag.VersMpAdmin
@@ -24,8 +24,8 @@ MP-IO - - v. @ViewBag.VersMpIO + + @ViewBag.VersMpIO
@@ -33,8 +33,8 @@ MP-LAND - - v. @ViewBag.VersMpLand + + @ViewBag.VersMpLand
@@ -42,8 +42,8 @@ MP-MON - - v. @ViewBag.VersMpMon + + @ViewBag.VersMpMon
@@ -51,8 +51,8 @@ MP-SITE - - v. @ViewBag.VersMpSite + + @ViewBag.VersMpSite
@@ -60,8 +60,8 @@ MP-TAB - - v. @ViewBag.VersMpTab + + @ViewBag.VersMpTab