87 lines
3.1 KiB
C#
87 lines
3.1 KiB
C#
using GPW_data;
|
|
using System;
|
|
|
|
namespace GPW_Admin
|
|
{
|
|
public partial class About : BasePage
|
|
{
|
|
#region Private Methods
|
|
|
|
/// <summary>
|
|
/// mostr ai pannelli setup/dati install
|
|
/// </summary>
|
|
/// <param name="showInstall"></param>
|
|
private void setupPanels(bool showInstall)
|
|
{
|
|
if (showInstall)
|
|
{
|
|
var serverStatus = licenzeGPW.checkLimanServer();
|
|
bool okScadenza = licenzeGPW.scadenzaLicenza >= DateTime.Now;
|
|
bool okRemoteSrv = serverStatus == "OK";
|
|
bool okNumLic = ((licenzeGPW.licenzeAttive <= licenzeGPW.licenzeDb) && (licenzeGPW.licenzeDb <= licenzeGPW.licenzeOnline));
|
|
|
|
// mostro dati base
|
|
lblInstallation.Text = licenzeGPW.installazione;
|
|
lblInstallation.ToolTip = "Cliente / Installazione";
|
|
lblApplication.Text = licenzeGPW.applicazione;
|
|
lblApplication.ToolTip = "Applicazione corrente";
|
|
lblNumLic.Text = $"{licenzeGPW.licenzeAttive} / {licenzeGPW.licenzeDb} / {licenzeGPW.licenzeOnline}";
|
|
lblNumLic.ToolTip = "# licenze Attive / # licenze DB / # licenze Online";
|
|
lblExpiryDate.Text = licenzeGPW.scadenzaLicenza.ToShortDateString();
|
|
lblExpiryDate.ToolTip = "Scadenza licenza";
|
|
lblAuthKey.Text = licenzeGPW.authKey;
|
|
lblAuthKey.ToolTip = "Chiave licenza attiva";
|
|
lblLimanServer.Text = serverStatus;
|
|
lblLimanServer.ToolTip = "Status del server lienze online";
|
|
|
|
// mostro dati secondo status colore da check
|
|
divCheck.Attributes.Remove("class");
|
|
if (okScadenza && okNumLic)
|
|
{
|
|
divCheck.Attributes.Add("class", "alert alert-success shadowBox");
|
|
}
|
|
else
|
|
{
|
|
divCheck.Attributes.Add("class", "alert alert-warning shadowBox");
|
|
}
|
|
|
|
divExpiry.Attributes.Remove("class");
|
|
if (okScadenza)
|
|
{
|
|
divExpiry.Attributes.Add("class", "d-flex justify-content-between");
|
|
}
|
|
else
|
|
{
|
|
divExpiry.Attributes.Add("class", "d-flex justify-content-between bg-danger text-warning");
|
|
}
|
|
divServer.Attributes.Remove("class");
|
|
if (okRemoteSrv)
|
|
{
|
|
divServer.Attributes.Add("class", "d-flex justify-content-between");
|
|
}
|
|
else
|
|
{
|
|
divServer.Attributes.Add("class", "d-flex justify-content-between bg-danger text-warning");
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion Private Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (licenzeGPW.modApp == "runtime")
|
|
{
|
|
setupPanels(true);
|
|
}
|
|
else
|
|
{
|
|
setupPanels(false);
|
|
}
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |