UpdMan initial commit
This commit is contained in:
@@ -388,6 +388,7 @@
|
||||
<Content Include="site\StackManager.aspx" />
|
||||
<Content Include="site\SyncData.aspx" />
|
||||
<Content Include="site\Unauth.aspx" />
|
||||
<Content Include="site\UpdMan.aspx" />
|
||||
<Content Include="site\Utility.aspx" />
|
||||
<Content Include="WebUserControls\cmp_barcode.ascx" />
|
||||
<Content Include="WebUserControls\cmp_batchDetail.ascx" />
|
||||
@@ -838,6 +839,13 @@
|
||||
<Compile Include="site\UpdateVoc.aspx.designer.cs">
|
||||
<DependentUpon>UpdateVoc.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="site\UpdMan.aspx.cs">
|
||||
<DependentUpon>UpdMan.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="site\UpdMan.aspx.designer.cs">
|
||||
<DependentUpon>UpdMan.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="site\Utility.aspx.cs">
|
||||
<DependentUpon>Utility.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/SiteContent.master" AutoEventWireup="true" CodeBehind="UpdMan.aspx.cs" Inherits="NKC_WF.site.UpdMan" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row" style="margin: 2px 4px;">
|
||||
<h3 class="card-title text-uppercase">SteamWare's Updater</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p><b>Gestione Update pacchetti - Ultime release applicazioni.</b></p>
|
||||
</div>
|
||||
<div class="col-4 col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="text-center">ALL <i class="fa fa-download"></i></h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<asp:LinkButton runat="server" ID="lbtDownloadAll" class="btn btn-success btn-lg btn-block" OnClientClick='<%: SteamWare.jsUtils.getCBE("DownloadConfirm")%>' OnClick="lbtDownload_Click" CommandArgument="ALL"><strong>LATEST VERS</strong></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="text-center">NKC <i class="fa fa-download"></i></h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<asp:LinkButton runat="server" ID="lbtDownloadCMSSC" class="btn btn-info text-light btn-lg btn-block" OnClientClick='<%: SteamWare.jsUtils.getCBE("DownloadConfirm")%>' OnClick="lbtDownload_Click" CommandArgument="CMS_SC"><strong><%: Version("NKC") %></strong></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<asp:Label runat="server" ID="lblOut"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,91 @@
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
public partial class UpdMan : BasePage
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eseguo download pacchetti secondo richeista
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtDownload_Click(object sender, EventArgs e)
|
||||
{
|
||||
LinkButton lnk = (LinkButton)sender;
|
||||
string caller = lnk.CommandArgument;
|
||||
string resultsMsg = "";
|
||||
// in base al caller scarico il file installazione richiesto...
|
||||
if (caller == null)
|
||||
{
|
||||
caller = "ALL";
|
||||
}
|
||||
// ora verifico COSA devo scaricare...
|
||||
if (!string.IsNullOrEmpty(updateUrl(caller)))
|
||||
{
|
||||
// se è ALL scarico tutti...
|
||||
if (caller == "ALL")
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
int done = 0;
|
||||
// scarico TUTTI...
|
||||
done += UpdateMan.obj.downloadLatest(updateUrl("NKC"), localDownloadPath("NKC"), "NKC");
|
||||
stopWatch.Stop();
|
||||
// calcolo elapsed time come TimeSpan value.
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
resultsMsg = string.Format("OK: {0} Package downloaded, {1:0.000} sec", done, ts.TotalSeconds);
|
||||
}
|
||||
else
|
||||
{
|
||||
// scarico singolo target...
|
||||
UpdateMan.obj.downloadLatest(updateUrl(caller), localDownloadPath(caller), caller);
|
||||
resultsMsg = string.Format("OK: {0} DOWNLOADED | {1} --> {2}", caller, updateUrl(caller), localDownloadPath(caller));
|
||||
}
|
||||
}
|
||||
// aggiorno messaggio
|
||||
lblOut.Text = resultsMsg;
|
||||
}
|
||||
|
||||
public string Version(object package)
|
||||
{
|
||||
string answ = "a.b.c.d";
|
||||
UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs();
|
||||
// Recupero info ADM...
|
||||
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl(package.ToString()));
|
||||
if (updArgs.IsUpdateAvailable)
|
||||
{
|
||||
answ = updArgs.CurrentVersion.ToString();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URLK stringa di UPDATE...
|
||||
/// </summary>
|
||||
protected string updateUrl(string package)
|
||||
{
|
||||
return string.Format("http://seriate.steamware.net:8083/SWS/{0}/{1}/manifest.xml", package, memLayer.ML.CRS("appVers"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Path locale dove scaricare gli installer
|
||||
/// </summary>
|
||||
protected string localDownloadPath(string package)
|
||||
{
|
||||
return string.Format(@"{0}{1}\{2}", memLayer.ML.CRS("downloadPath"), package, memLayer.ML.CRS("appVers"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+44
@@ -0,0 +1,44 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
|
||||
|
||||
public partial class UpdMan
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtDownloadAll.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtDownloadAll;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtDownloadCMSSC.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtDownloadCMSSC;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblOut.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblOut;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user