+
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.cs
index a9d1c8e..71523ca 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.cs
@@ -15,6 +15,67 @@ namespace PROJ_ETS.WebUserControls
{
public partial class mod_menuBottomFullpage : System.Web.UI.UserControl
{
+ #region Protected Fields
+
+ protected Logger lg = LogManager.GetCurrentClassLogger();
+
+ #endregion Protected Fields
+
+ #region Public Fields
+
+ ///
+ /// nome della pagina correntemente caricata
+ ///
+ public string _paginaCorrente;
+
+ ///
+ /// memorizza la pagina precedente (ovvero la corrente ma non da page-object ma in session...
+ ///
+ public string _paginaPrecedente;
+
+ #endregion Public Fields
+
+ #region Private Methods
+
+ private void setClock()
+ {
+ lblDateTime.Text = DateTime.Now.ToString("dddd dd/MM/yyyy, HH:mm:ss");
+ }
+
+ ///
+ /// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
+ ///
+ private void setTimer()
+ {
+ Timer1.Interval = Convert.ToInt32(ConfigurationManager.AppSettings.Get("intUpdatePagina_ms"));
+ }
+
+ #endregion Private Methods
+
+ #region Protected Methods
+
+ ///
+ /// salva in variabile pagina il nome della pagina corrente
+ ///
+ protected void PagCorrente()
+ {
+ Uri MyUrl = Request.Url;
+ string delimStr = "/";
+ char[] delimiter = delimStr.ToCharArray();
+ string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
+ int n = finalUrl.Length;
+ _paginaCorrente = finalUrl[n - 1].ToString();
+ if (_paginaPrecedente == "")
+ {
+ _paginaPrecedente = _paginaCorrente;
+ utils.obj.setSessionVal("_paginaPrecedente", _paginaPrecedente);
+ }
+ if (_paginaCorrente != _paginaPrecedente)
+ {
+ _paginaPrecedente = _paginaCorrente;
+ utils.obj.setSessionVal("_paginaPrecedente", _paginaPrecedente);
+ }
+ }
///
/// caricamento pagina
@@ -25,27 +86,46 @@ namespace PROJ_ETS.WebUserControls
{
// sistemo le stringhe...
//lblApp.Text = string.Format("{0} v.{1}.{2}", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"), ConfigurationManager.AppSettings.Get("minRev"));
-
+ if (!Page.IsPostBack)
+ {
+ SetUpByUserRight();
+ }
lblApp.Text = string.Format("{0} v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
+ lblUser.Text = string.Format("{0} ({1})", utils.obj.currUserCognomeNome, utils.obj.currUserId);
+ lblPostazione.Text = Request.UserHostName;
setTimer();
setClock();
}
+
///
- /// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
+ /// verifica che l'utente abbia almeno un permesso per la pagina corrente altrimenti redirect ad unauthorized
///
- private void setTimer()
+ protected virtual void SetUpByUserRight()
{
- Timer1.Interval = Convert.ToInt32(ConfigurationManager.AppSettings.Get("intUpdatePagina_ms"));
+ PagCorrente();
+ // verifica la pagina NON sia di quelle "libere"
+ if (utils.obj.confReadString("_safePages").IndexOf(_paginaCorrente) == -1)
+ {
+ // verifica l'utente sia autorizzato (in session...)
+ if (!user_std.UtSn.isAuth)
+ {
+ Session["nextPage"] = _paginaCorrente;
+ Response.Redirect("login.aspx");
+ }
+ // verifica i permessi dell'utente per almeno vedere la pagina corrente SSE non è una common page...
+ if (!user_std.UtSn.isPageEnabled(_paginaCorrente.Replace(".aspx", "")) && utils.obj.confReadString("_commonPages").IndexOf(_paginaCorrente) == -1)
+ {
+ lg.Info(string.Format("Errore in SetUpByUserRight: utente {0} non autorizzato per la pagina {1}", user_std.UtSn.utente, _paginaCorrente));
+ Response.Redirect("unauthorized.aspx");
+ }
+ }
}
+
protected void Timer1_Tick(object sender, EventArgs e)
{
setClock();
}
- private void setClock()
- {
- lblDateTime.Text = DateTime.Now.ToString("dddd dd/MM/yyyy, HH:mm:ss");
- }
-
+ #endregion Protected Methods
}
}
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.designer.cs
index 1135e97..3cbb6ad 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.designer.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuBottomFullpage.ascx.designer.cs
@@ -7,11 +7,31 @@
//
//------------------------------------------------------------------------------
-namespace PROJ_ETS.WebUserControls {
-
-
- public partial class mod_menuBottomFullpage {
-
+namespace PROJ_ETS.WebUserControls
+{
+
+
+ public partial class mod_menuBottomFullpage
+ {
+
+ ///
+ /// lblUser control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblUser;
+
+ ///
+ /// lblPostazione control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblPostazione;
+
///
/// lblDateTime control.
///
@@ -20,7 +40,7 @@ namespace PROJ_ETS.WebUserControls {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Label lblDateTime;
-
+
///
/// lblApp control.
///
@@ -29,7 +49,7 @@ namespace PROJ_ETS.WebUserControls {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Label lblApp;
-
+
///
/// lblrev control.
///
@@ -38,7 +58,7 @@ namespace PROJ_ETS.WebUserControls {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Label lblrev;
-
+
///
/// Timer1 control.
///
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx
index 146fef6..32e968a 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx
@@ -1,49 +1,48 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_testata.ascx.cs" Inherits="PROJ_ETS.WebUserControls.mod_testata" %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.cs
index c9dcc4f..28b394b 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.cs
@@ -11,39 +11,8 @@ namespace PROJ_ETS.WebUserControls
{
public partial class mod_testata : System.Web.UI.UserControl
{
- protected Logger lg = LogManager.GetCurrentClassLogger();
- ///
- /// nome della pagina correntemente caricata
- ///
- public string _paginaCorrente;
- ///
- /// memorizza la pagina precedente (ovvero la corrente ma non da page-object ma in session...
- ///
- public string _paginaPrecedente;
+ #region Private Methods
- ///
- /// caricamento pagina
- ///
- ///
- ///
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- SetUpByUserRight();
- }
- lblUser.Text = string.Format("{0} ({1})", utils.obj.currUserCognomeNome, utils.obj.currUserId);
- lblPostazione.Text = Request.UserHostName;
- }
- ///
- /// richiesta update
- ///
- ///
- ///
- protected void btnUpdate_Click(object sender, EventArgs e)
- {
- doFullDataUpdate();
- }
///
/// svuota session!
///
@@ -54,57 +23,29 @@ namespace PROJ_ETS.WebUserControls
Response.Redirect(Request.Url.ToString());
}
+ #endregion Private Methods
-
- #region area gestione auth
+ #region Protected Methods
///
- /// verifica che l'utente abbia almeno un permesso per la pagina corrente altrimenti redirect ad unauthorized
+ /// richiesta update
///
- protected virtual void SetUpByUserRight()
+ ///
+ ///
+ protected void btnUpdate_Click(object sender, EventArgs e)
{
- PagCorrente();
- // verifica la pagina NON sia di quelle "libere"
- if (utils.obj.confReadString("_safePages").IndexOf(_paginaCorrente) == -1)
- {
- // verifica l'utente sia autorizzato (in session...)
- if (!user_std.UtSn.isAuth)
- {
- Session["nextPage"] = _paginaCorrente;
- Response.Redirect("login.aspx");
- }
- // verifica i permessi dell'utente per almeno vedere la pagina corrente SSE non è una common page...
- if (!user_std.UtSn.isPageEnabled(_paginaCorrente.Replace(".aspx","")) && utils.obj.confReadString("_commonPages").IndexOf(_paginaCorrente) == -1)
- {
- lg.Info(string.Format("Errore in SetUpByUserRight: utente {0} non autorizzato per la pagina {1}", user_std.UtSn.utente, _paginaCorrente));
- Response.Redirect("unauthorized.aspx");
- }
-
- }
+ doFullDataUpdate();
}
+
///
- /// salva in variabile pagina il nome della pagina corrente
+ /// caricamento pagina
///
- protected void PagCorrente()
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
{
- Uri MyUrl = Request.Url;
- string delimStr = "/";
- char[] delimiter = delimStr.ToCharArray();
- string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
- int n = finalUrl.Length;
- _paginaCorrente = finalUrl[n - 1].ToString();
- if (_paginaPrecedente == "")
- {
- _paginaPrecedente = _paginaCorrente;
- utils.obj.setSessionVal("_paginaPrecedente", _paginaPrecedente);
- }
- if (_paginaCorrente != _paginaPrecedente)
- {
- _paginaPrecedente = _paginaCorrente;
- utils.obj.setSessionVal("_paginaPrecedente", _paginaPrecedente);
- }
}
- #endregion
+ #endregion Protected Methods
}
}
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.designer.cs
index d5cc5c8..1b181cf 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.designer.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_testata.ascx.designer.cs
@@ -1,96 +1,44 @@
//------------------------------------------------------------------------------
-//
-// Codice generato da uno strumento.
+//
+// This code was generated by a tool.
//
-// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
-// il codice viene rigenerato.
-//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
//------------------------------------------------------------------------------
-namespace PROJ_ETS.WebUserControls {
-
-
- public partial class mod_testata {
-
+namespace PROJ_ETS.WebUserControls
+{
+
+
+ public partial class mod_testata
+ {
+
///
- /// Controllo lblUser.
+ /// updPnlGears control.
///
///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
- ///
- protected global::System.Web.UI.WebControls.Label lblUser;
-
- ///
- /// Controllo lblPostazione.
- ///
- ///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
- ///
- protected global::System.Web.UI.WebControls.Label lblPostazione;
-
- ///
- /// Controllo updPnlGears.
- ///
- ///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.UpdatePanel updPnlGears;
-
+
///
- /// Controllo UpdateProgress1.
+ /// UpdateProgress1 control.
///
///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.UpdateProgress UpdateProgress1;
-
+
///
- /// Controllo Image1.
+ /// lbtRefresh control.
///
///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.Image Image1;
-
- ///
- /// Controllo Image2.
- ///
- ///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
- ///
- protected global::System.Web.UI.WebControls.Image Image2;
-
- ///
- /// Controllo Image3.
- ///
- ///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
- ///
- protected global::System.Web.UI.WebControls.Image Image3;
-
- ///
- /// Controllo Image5.
- ///
- ///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
- ///
- protected global::System.Web.UI.WebControls.Image Image5;
-
- ///
- /// Controllo btnUpdate.
- ///
- ///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
- ///
- protected global::System.Web.UI.WebControls.LinkButton btnUpdate;
+ protected global::System.Web.UI.WebControls.LinkButton lbtRefresh;
}
}