Files
2022-02-03 07:29:11 +01:00

77 lines
2.1 KiB
C#

using GPW_data;
using SteamWare;
using System;
using System.Configuration;
using System.Web.UI;
namespace GPW_Admin.WebUserControls
{
public partial class cmp_footer : BaseUserControl
{
#region Private Methods
private void setClock()
{
lblDateTime.Text = DateTime.Now.ToString("ddd dd.MM.yyyy, HH:mm:ss");
lblCodOperatore.Text = $"{user_std.UtSn.CognomeNome} ({Page.User.Identity.Name})";
}
private void setCss()
{
divFooter.Attributes.Clear();
string cssClass = "row";
var payloadOk = licenzeGPW.checkPayload;
if (!payloadOk)
{
cssClass += " text-warning bg-danger";
}
lblCheckLic.Visible = !payloadOk;
divFooter.Attributes.Add("class", cssClass);
}
private void setLabel()
{
string appInfo = "";
try
{
// sistemo le stringhe...
appInfo = $"<b>{ConfigurationManager.AppSettings.Get("appName")}</b> v.{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}";
}
catch
{ }
lblApp.Text = appInfo;
}
/// <summary>
/// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
/// </summary>
private void setTimer()
{
Timer1.Interval = SteamWare.memLayer.ML.confReadInt("intUpdatePagina_ms");
}
#endregion Private Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
setCss();
setLabel();
}
setTimer();
setClock();
}
protected void Timer1_Tick(object sender, EventArgs e)
{
setClock();
// se qualcuno ascolta sollevo evento nuovo valore...
raiseEvent();
}
#endregion Protected Methods
}
}