Files
GPW/GPW_Admin/WebUserControls/cmp_footer.ascx.cs
T
Samuele E. Locatelli 9153c32f79 ok menu TOP sticky
2021-01-07 22:55:43 +01:00

63 lines
1.7 KiB
C#

using SteamWare;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
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})";
}
/// <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)
{
setLabel();
setTimer();
setClock();
}
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;
}
protected void Timer1_Tick(object sender, EventArgs e)
{
setClock();
// se qualcuno ascolta sollevo evento nuovo valore...
raiseEvent();
}
#endregion Protected Methods
}
}