diff --git a/GPW_Admin/Properties/PublishProfiles/ETS.pubxml b/GPW_Admin/Properties/PublishProfiles/ETS.pubxml index 90176e4..c896d62 100644 --- a/GPW_Admin/Properties/PublishProfiles/ETS.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/ETS.pubxml @@ -1,39 +1,39 @@  - - Package - - C:\Users\samuele\Documents\Visual Studio 2012\Projects\GestionePresenze\GPW\ReleasesClienti\ETS\GPW.zip - true - Default Web Site/GPW/Smart - - - - - - - - - - - - - - - ETS - Any CPU - True - True - True - True - False - DonotMerge - - - - + + Package + + C:\Users\samuele\Documents\Visual Studio 2012\Projects\GestionePresenze\GPW\ReleasesClienti\ETS\GPW.zip + true + Default Web Site/GPW/Smart + + + + + + + + + + + + + + + ETS + Any CPU + True + True + True + True + False + DonotMerge + + + + \ No newline at end of file diff --git a/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml b/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml index ec8edf6..e6fea6d 100644 --- a/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml @@ -1,7 +1,7 @@  @@ -20,11 +20,11 @@ by editing this MSBuild file. In order to learn more about this please visit htt - + - + diff --git a/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml b/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml index 1da7320..9bbb2eb 100644 --- a/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml @@ -1,7 +1,7 @@  @@ -20,11 +20,11 @@ by editing this MSBuild file. In order to learn more about this please visit htt - + - + diff --git a/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml b/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml index dfe6e05..6b84290 100644 --- a/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml @@ -1,7 +1,7 @@  @@ -20,11 +20,11 @@ by editing this MSBuild file. In order to learn more about this please visit htt - + - + diff --git a/GPW_Admin/Web.SPS.config b/GPW_Admin/Web.SPS.config index 92fccfa..193f4b6 100644 --- a/GPW_Admin/Web.SPS.config +++ b/GPW_Admin/Web.SPS.config @@ -4,55 +4,55 @@ - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - + + + + - + diff --git a/GPW_Admin/Web.config b/GPW_Admin/Web.config index 66e222a..0bf10c7 100644 --- a/GPW_Admin/Web.config +++ b/GPW_Admin/Web.config @@ -133,15 +133,15 @@ - - - - - + + + + + - + diff --git a/GPW_Admin/WebUserControls/cmp_menuTop.ascx b/GPW_Admin/WebUserControls/cmp_menuTop.ascx index e3ed486..3f366da 100644 --- a/GPW_Admin/WebUserControls/cmp_menuTop.ascx +++ b/GPW_Admin/WebUserControls/cmp_menuTop.ascx @@ -3,7 +3,7 @@ <%--Sauder NKC --%> - GPW + GPW diff --git a/GPW_Admin/WebUserControls/cmp_menuTop.ascx.designer.cs b/GPW_Admin/WebUserControls/cmp_menuTop.ascx.designer.cs index 3e3523c..3b78f89 100644 --- a/GPW_Admin/WebUserControls/cmp_menuTop.ascx.designer.cs +++ b/GPW_Admin/WebUserControls/cmp_menuTop.ascx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// 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 GPW_Admin.WebUserControls @@ -15,56 +15,56 @@ namespace GPW_Admin.WebUserControls { /// - /// Controllo hfAnonym. + /// hfAnonym 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.HiddenField hfAnonym; /// - /// Controllo menu. + /// menu 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.Repeater menu; /// - /// Controllo XmlMenu. + /// XmlMenu 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.XmlDataSource XmlMenu; /// - /// Controllo divSearch. + /// divSearch 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.HtmlControls.HtmlGenericControl divSearch; /// - /// Controllo txtSearch. + /// txtSearch 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.TextBox txtSearch; /// - /// Controllo lbtSearch. + /// lbtSearch 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.LinkButton lbtSearch; } diff --git a/GPW_Admin/WebUserControls/cmp_vocabolario.ascx.cs b/GPW_Admin/WebUserControls/cmp_vocabolario.ascx.cs index b69517a..fc510c5 100644 --- a/GPW_Admin/WebUserControls/cmp_vocabolario.ascx.cs +++ b/GPW_Admin/WebUserControls/cmp_vocabolario.ascx.cs @@ -143,7 +143,7 @@ namespace GPW_Admin.WebUserControls protected override void traduciObj() { base.traduciObj(); - btnNewLemma.Text = user_std.UtSn.Traduci("btnNewLemma"); + btnNewLemma.Text = traduci("btnNewLemma"); txtNewLemma.Text = ""; } diff --git a/GPW_Admin/WebUserControls/mod_approvaTimbr.ascx b/GPW_Admin/WebUserControls/mod_approvaTimbr.ascx index 5db6738..d4a5d44 100644 --- a/GPW_Admin/WebUserControls/mod_approvaTimbr.ascx +++ b/GPW_Admin/WebUserControls/mod_approvaTimbr.ascx @@ -35,7 +35,7 @@ - + diff --git a/GPW_Admin/WebUserControls/mod_filtro.ascx b/GPW_Admin/WebUserControls/mod_filtro.ascx index 04b84e8..9e40d31 100644 --- a/GPW_Admin/WebUserControls/mod_filtro.ascx +++ b/GPW_Admin/WebUserControls/mod_filtro.ascx @@ -3,7 +3,7 @@ - + diff --git a/GPW_Admin/WebUserControls/mod_filtro.ascx.cs b/GPW_Admin/WebUserControls/mod_filtro.ascx.cs index 3d16030..393e304 100644 --- a/GPW_Admin/WebUserControls/mod_filtro.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_filtro.ascx.cs @@ -47,7 +47,10 @@ public partial class mod_filtro : ApplicationUserControl set { hfShowAll.Value = value; - traduciObj(); + if (!string.IsNullOrEmpty(value)) + { + traduciObj(); + } } } @@ -60,7 +63,10 @@ public partial class mod_filtro : ApplicationUserControl set { hfShowFiltered.Value = value; - traduciObj(); + if (!string.IsNullOrEmpty(value)) + { + traduciObj(); + } } } @@ -447,11 +453,17 @@ public partial class mod_filtro : ApplicationUserControl { if (!chkFilt.Checked) { - chkFilt.Text = traduci(_showFiltered); + if (!string.IsNullOrEmpty(_showFiltered)) + { + chkFilt.Text = traduci(_showFiltered); + } } else { - chkFilt.Text = traduci(_showAll); + if (!string.IsNullOrEmpty(_showAll)) + { + chkFilt.Text = traduci(_showAll); + } } } } diff --git a/GPW_Admin/WebUserControls/mod_filtro.ascx.designer.cs b/GPW_Admin/WebUserControls/mod_filtro.ascx.designer.cs index 4fd8942..90cf0ec 100644 --- a/GPW_Admin/WebUserControls/mod_filtro.ascx.designer.cs +++ b/GPW_Admin/WebUserControls/mod_filtro.ascx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// 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. +// //------------------------------------------------------------------------------ @@ -13,47 +13,47 @@ public partial class mod_filtro { /// - /// Controllo chkFilt. + /// chkFilt 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.CheckBox chkFilt; /// - /// Controllo dlFilt. + /// dlFilt 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::AjaxControlToolkit.ComboBox dlFilt; /// - /// Controllo where. + /// where 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.Label where; /// - /// Controllo hfShowAll. + /// hfShowAll 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.HiddenField hfShowAll; /// - /// Controllo hfShowFiltered. + /// hfShowFiltered 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.HiddenField hfShowFiltered; } diff --git a/GPW_Admin/WebUserControls/mod_login.ascx.cs b/GPW_Admin/WebUserControls/mod_login.ascx.cs index 661be6c..62d6688 100644 --- a/GPW_Admin/WebUserControls/mod_login.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_login.ascx.cs @@ -7,44 +7,40 @@ using System.Web.UI; /// public partial class mod_login : ApplicationUserControl { - #region area protected/private - - #region area proprietà + #region Private Fields private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale; - #endregion + #endregion Private Fields - #region area metodi + #region Public Events + + public event EventHandler Login_Error; + + public event EventHandler Login_ok; + + #endregion Public Events + + #region Public Properties /// - /// imposta la modalità di login tra normale / forceUser + /// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser /// - private void setLoginMode() + public SteamWare.loginMode modoLogin { - if (_isForceUser == SteamWare.loginMode.forceUser) + get { - pnlForceUser.Visible = true; + return _isForceUser; } - else + set { - pnlForceUser.Visible = false; + _isForceUser = value; } } - protected override void traduciObj() - { - try - { - lblPwd.Text = user_std.UtSn.Traduci("lblPwd"); - lblUser.Text = user_std.UtSn.Traduci("lblUser"); - lblDominio.Text = user_std.UtSn.Traduci("lblDominio"); - lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente"); - btnOk.Text = user_std.UtSn.Traduci("btnCommit"); - } - catch - { } - } + #endregion Public Properties + + #region Private Methods /// /// prova a verificare se l'utente sia ok x AD credentials @@ -75,7 +71,7 @@ public partial class mod_login : ApplicationUserControl } else { - lblMessage.Text = String.Format("{0}There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); + lblMessage.Text = String.Format("{0}There are some problems instatiating user: {1}/{2}", traduci("AccessFail"), dom_user[0], dom_user[1]); logger.lg.scriviLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), tipoLog.ERROR); if (Login_Error != null) { @@ -92,7 +88,7 @@ public partial class mod_login : ApplicationUserControl } else { - lblMessage.Text = String.Format("{0}user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); + lblMessage.Text = String.Format("{0}user not allowed: {1}/{2}", traduci("AccessFail"), dom_user[0], dom_user[1]); logger.lg.scriviLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), tipoLog.WARNING); if (Login_Error != null) { @@ -103,7 +99,7 @@ public partial class mod_login : ApplicationUserControl } else { - lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth"); + lblMessage.Text = traduci("AccessFail") + traduci("UsrNotAuth"); logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), tipoLog.WARNING); if (Login_Error != null) { @@ -147,8 +143,8 @@ public partial class mod_login : ApplicationUserControl } else { - lblMessage.Text = String.Format("{0}key not allowed for operation!!! operation logged!!!", user_std.UtSn.Traduci("AccessFail")); - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp")))); + lblMessage.Text = String.Format("{0}key not allowed for operation!!! operation logged!!!", traduci("AccessFail")); + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, traduci(SteamWare.memLayer.ML.confReadString("defaultApp")))); string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); SteamWare.logger.lg.scriviLog(_rigaLog, tipoLog.WARNING); if (Login_Error != null) @@ -159,7 +155,7 @@ public partial class mod_login : ApplicationUserControl } else { - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp")))); + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, traduci(SteamWare.memLayer.ML.confReadString("defaultApp")))); string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); SteamWare.logger.lg.scriviLog(_rigaLog, tipoLog.WARNING); if (Login_Error != null) @@ -170,7 +166,7 @@ public partial class mod_login : ApplicationUserControl } else { - lblMessage.Text = string.Format("{0}user not authenticated!", user_std.UtSn.Traduci("AccessFail")); + lblMessage.Text = string.Format("{0}user not authenticated!", traduci("AccessFail")); if (Login_Error != null) { Login_Error(this, new EventArgs()); @@ -180,44 +176,30 @@ public partial class mod_login : ApplicationUserControl } } + /// + /// imposta la modalità di login tra normale / forceUser + /// + private void setLoginMode() + { + if (_isForceUser == SteamWare.loginMode.forceUser) + { + pnlForceUser.Visible = true; + } + else + { + pnlForceUser.Visible = false; + } + } + + #endregion Private Methods + + #region Protected Methods + protected void btnOk_Click(object sender, EventArgs e) { ForceUserIdentity(); } - #endregion - - #endregion - - #region area public - - #region eventi pubblici esposti - - public event EventHandler Login_ok; - public event EventHandler Login_Error; - - #endregion - - #region area proprietà - - /// - /// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser - /// - public SteamWare.loginMode modoLogin - { - get - { - return _isForceUser; - } - set - { - _isForceUser = value; - } - } - - #endregion - - /// /// avvio pagina /// @@ -235,5 +217,19 @@ public partial class mod_login : ApplicationUserControl } } - #endregion -} + protected override void traduciObj() + { + try + { + lblPwd.Text = traduci("lblPwd"); + lblUser.Text = traduci("lblUser"); + lblDominio.Text = traduci("lblDominio"); + lblTitolo.Text = traduci("ForzaUtente"); + btnOk.Text = traduci("btnCommit"); + } + catch + { } + } + + #endregion Protected Methods +} \ No newline at end of file diff --git a/GPW_Admin/WebUserControls/mod_menuTop.ascx.cs b/GPW_Admin/WebUserControls/mod_menuTop.ascx.cs index de85e64..cd2ad28 100644 --- a/GPW_Admin/WebUserControls/mod_menuTop.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_menuTop.ascx.cs @@ -13,35 +13,21 @@ using SteamWare; public partial class mod_menuTop : ApplicationUserControl { + #region Private Fields + private string _titleString; - #region gestione eventi + #endregion Private Fields + + #region Public Events - public event EventHandler eh_toggleMenuSx; public event EventHandler eh_reqUpdateMenu; - #endregion + public event EventHandler eh_toggleMenuSx; - protected override void Page_Load(object sender, EventArgs e) - { - base.Page_Load(sender, e); - btnLogOut.Visible = user_std.UtSn.isForcedUser; - if(memLayer.ML.isInSessionObject("doUpdateNow")) - { - doFullDataUpdate(); - memLayer.ML.emptySessionVal("doUpdateNow"); - } - } + #endregion Public Events - protected void btnLogOut_Click(object sender, EventArgs e) - { - Session.Abandon(); - Response.Redirect("forceUser.aspx"); - } - protected void btnUpdate_Click(object sender, EventArgs e) - { - doFullDataUpdate(); - } + #region Private Methods private void doFullDataUpdate() { @@ -81,12 +67,31 @@ public partial class mod_menuTop : ApplicationUserControl Response.Redirect(_paginaCorrente); } - protected override void loadSessionData() + /// + /// redirect + /// + private void returnHome() { - base.loadSessionData(); - _titleString = SteamWare.memLayer.ML.StringSessionObj("_titleString"); + Response.Redirect(memLayer.ML.CRS("baseUrl")); } + private void setClock() + { + lblDateTime.Text = DateTime.Now.ToString("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 = SteamWare.memLayer.ML.confReadInt("intUpdatePagina_ms"); + } + + #endregion Private Methods + + #region Protected Methods + protected override void bindControlli() { if (!Page.IsPostBack) @@ -95,12 +100,12 @@ public partial class mod_menuTop : ApplicationUserControl // solo se user è auth... if (user_std.UtSn.isAuth) { - lnkShowHide.Text = user_std.UtSn.Traduci("lnkShowHide"); - lblTitle.Text = user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("titleApp")); + lnkShowHide.Text = traduci("lnkShowHide"); + lblTitle.Text = traduci(SteamWare.memLayer.ML.confReadString("titleApp")); if (!string.IsNullOrEmpty(_titleString)) { // traduzione di tutti i termini - lblMessUtente.Text = user_std.UtSn.Traduci(_titleString); + lblMessUtente.Text = traduci(_titleString); //doppio in english! _titleString = ""; Session["_titleString"] = _titleString; @@ -108,54 +113,30 @@ public partial class mod_menuTop : ApplicationUserControl } else { - string titolo = user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("welcomeApp")); + string titolo = traduci(SteamWare.memLayer.ML.confReadString("welcomeApp")); lblMessUtente.Text = string.Format("{0} - {1}", titolo, memLayer.ML.confReadString("SiteName")); Session["SessionUpdateMenu"] = false; } - btnLogOut.Text = user_std.UtSn.Traduci("LogOut"); - btnUpdate.Text = user_std.UtSn.Traduci("Update"); - lblUser.Text = String.Format("{0}: {1}", user_std.UtSn.Traduci("User"), user_std.UtSn.CognomeNome); + btnLogOut.Text = traduci("LogOut"); + btnUpdate.Text = traduci("Update"); + lblUser.Text = String.Format("{0}: {1}", traduci("User"), user_std.UtSn.CognomeNome); 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 - /// - private void setTimer() - { - Timer1.Interval = SteamWare.memLayer.ML.confReadInt("intUpdatePagina_ms"); - } - protected void lnkShowHide_Click(object sender, EventArgs e) - { - // cambio visibilità del menù laterale... - if (eh_toggleMenuSx != null) - { - eh_toggleMenuSx(this, new EventArgs()); - } - } - protected void Timer1_Tick(object sender, EventArgs e) + protected void btnLogOut_Click(object sender, EventArgs e) { - setClock(); + Session.Abandon(); + Response.Redirect("forceUser.aspx"); } - private void setClock() + protected void btnUpdate_Click(object sender, EventArgs e) { - lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss"); - } - protected void lblUser_Click(object sender, EventArgs e) - { - Response.Redirect("./chLang.aspx"); - } - /// - /// redirect - /// - private void returnHome() - { - Response.Redirect(memLayer.ML.CRS("baseUrl")); + doFullDataUpdate(); } + /// /// rimanda a pagina precedente /// @@ -165,4 +146,42 @@ public partial class mod_menuTop : ApplicationUserControl { returnHome(); } -} + + protected void lblUser_Click(object sender, EventArgs e) + { + Response.Redirect("./chLang.aspx"); + } + + protected void lnkShowHide_Click(object sender, EventArgs e) + { + // cambio visibilità del menù laterale... + if (eh_toggleMenuSx != null) + { + eh_toggleMenuSx(this, new EventArgs()); + } + } + + protected override void loadSessionData() + { + base.loadSessionData(); + _titleString = SteamWare.memLayer.ML.StringSessionObj("_titleString"); + } + + protected override void Page_Load(object sender, EventArgs e) + { + base.Page_Load(sender, e); + btnLogOut.Visible = user_std.UtSn.isForcedUser; + if (memLayer.ML.isInSessionObject("doUpdateNow")) + { + doFullDataUpdate(); + memLayer.ML.emptySessionVal("doUpdateNow"); + } + } + + protected void Timer1_Tick(object sender, EventArgs e) + { + setClock(); + } + + #endregion Protected Methods +} \ No newline at end of file diff --git a/GPW_Admin/WebUserControls/mod_periodoAnalisi.ascx.cs b/GPW_Admin/WebUserControls/mod_periodoAnalisi.ascx.cs index e8bae7b..90c8678 100644 --- a/GPW_Admin/WebUserControls/mod_periodoAnalisi.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_periodoAnalisi.ascx.cs @@ -10,31 +10,22 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using SteamWare; - public partial class mod_periodoAnalisi : System.Web.UI.UserControl { - #region area protected + #region Protected Fields protected intervalloDate _intervallo; - public string uid - { - get - { - return this.UniqueID.Replace("$", "_").Replace("-", "_"); - } - } + #endregion Protected Fields + + #region Public Events + + public event EventHandler eh_doUpdate; + + #endregion Public Events + + #region Protected Properties - /// - /// avvio componente - /// - /// - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - setIntervallo(); - setDurataMin(); - } /// /// definisce se sia da mostrare il selettore delle ore nel controllo /// @@ -62,62 +53,58 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl } } - /// - /// gestione del selettore rapido dell'intervallo temporale... - /// - /// - /// - protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) + #endregion Protected Properties + + #region Public Properties + + public intervalloDate intervalloAnalisi { - // verifico cosa sia cambiato ed imposto date... - datario _datario = new datario(); - switch (DropDownList1.SelectedValue) + get { - case "oggi": - _intervallo = _datario.giornata(DateTime.Now); - break; - case "ieri": - _intervallo = _datario.giornata(DateTime.Now.AddDays(-1)); - break; - case "ultimi 7gg": - _intervallo = _datario.ultimiGiorni(DateTime.Now, 7); - break; - case "questa settimana": - _intervallo = _datario.questaSett(DateTime.Now); - break; - case "ultimi 30gg": - _intervallo = _datario.ultimiGiorni(DateTime.Now, 30); - break; - case "questo mese": - _intervallo = _datario.questoMese(DateTime.Now); - break; - case "mese precedente": - _intervallo = _datario.mesePrecedente(DateTime.Now); - break; - case "questo anno": - _intervallo = _datario.estremiAnno(DateTime.Now); - break; - case "1 anno": - _intervallo = _datario.ultimiGiorni(DateTime.Now, 366); - break; - case "10 anni": - _intervallo = _datario.ultimiGiorni(DateTime.Now, 3660); - break; - case "2000 +": - DateTime anno2000 = new DateTime(2000, 1, 1); - _intervallo = _datario.setIntervallo(anno2000, DateTime.Now.AddDays(1)); - break; - default: - break; + var answ = new intervalloDate(); + if (memLayer.ML.isInSessionObject("_intervallo")) + { + answ = (intervalloDate)memLayer.ML.objSessionObj("_intervallo"); + } + return answ; } - if ((intervalloAnalisi.inizio != _intervallo.inizio) || (intervalloAnalisi.fine != _intervallo.fine)) + set { - verificaCoerenzaDate(); - aggiornaDateMostrate(realtimeUpdate); - // mostro btn update - btnUpdate.Visible = !realtimeUpdate; + intervalloDate interv = value; + Session["_intervallo"] = interv; + Session["_inizio"] = interv.inizio; + Session["_fine"] = interv.fine; + aggiornaDateMostrate(false); } } + + /// + /// imposta realtime update (non mostra button am fa subito update) + /// + public bool realtimeUpdate + { + get + { + return memLayer.ML.BoolSessionObj("rltUpdatePeriodo"); + } + set + { + memLayer.ML.setSessionVal("rltUpdatePeriodo", value); + } + } + + public string uid + { + get + { + return this.UniqueID.Replace("$", "_").Replace("-", "_"); + } + } + + #endregion Public Properties + + #region Private Methods + /// /// effettua update delle date mostrate da intervallo analisi (ed eventualmente riporta update...) /// @@ -130,6 +117,46 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl reportUpdate(); } } + + private void aggiornaPeriodo() + { + _intervallo = new intervalloDate(); + // calcolo tempi arrotondati + int oraInizio = 0; + int oraFine = 0; + if (mostraSelOra) + { + oraInizio = Convert.ToInt32(ddlOraInizio.SelectedValue); + oraFine = Convert.ToInt32(ddlOraFine.SelectedValue); + } + _intervallo.inizio = Convert.ToDateTime(txtInizio.Text).AddHours(oraInizio); + _intervallo.fine = Convert.ToDateTime(txtFine.Text).AddHours(oraFine); + verificaCoerenzaDate(); + int _durataMin; + _durataMin = Convert.ToInt32(txtDurataMin.Text); + Session["_durataMin"] = _durataMin; + reportUpdate(); + } + + /// + /// controlla se aggiornare subito o mostrare update (a seconda del valore di realtime update...) + /// + private void checkIfUpdate() + { + // se richiesto realtime + if (realtimeUpdate) + { + aggiornaPeriodo(); + // nascondo btn update + btnUpdate.Visible = false; + } + else + { + // altrimenti mostro btn update + btnUpdate.Visible = true; + } + } + /// /// scrive nuove date in controllo /// @@ -155,6 +182,25 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl ddlOraFine.Visible = false; } } + + /// + /// imposta durata minima + /// + private void setDurataMin() + { + int _durataMin; + if (memLayer.ML.isInSessionObject("_durataMin")) + { + _durataMin = memLayer.ML.IntSessionObj("_durataMin"); + } + else + { + _durataMin = 0; + memLayer.ML.setSessionVal("_durataMin", _durataMin); + } + txtDurataMin.Text = _durataMin.ToString(); + } + /// /// imposta intervallo da sessione o di default /// @@ -163,65 +209,23 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl intervalloDate _intervallo; try { - _intervallo = (intervalloDate)Session["_intervallo"]; + if (memLayer.ML.isInSessionObject("_intervallo")) + { + _intervallo = (intervalloDate)memLayer.ML.objSessionObj("_intervallo"); + } } catch { _intervallo = new intervalloDate(); _intervallo.inizio = DateTime.Now.AddDays(memLayer.ML.confReadInt("defDayFrom")); _intervallo.fine = DateTime.Now.AddDays(1); - Session["_intervallo"] = _intervallo; - Session["_inizio"] = _intervallo.inizio; - Session["_fine"] = _intervallo.fine; + memLayer.ML.setSessionVal("_intervallo", _intervallo); + memLayer.ML.setSessionVal("_inizio", _intervallo.inizio); + memLayer.ML.setSessionVal("_fine", _intervallo.fine); } scriviDate(); } - /// - /// imposta durata minima - /// - private void setDurataMin() - { - int _durataMin; - try - { - _durataMin = (int)Session["_durataMin"]; - } - catch - { - _durataMin = 0; - Session["_durataMin"] = _durataMin; - } - txtDurataMin.Text = _durataMin.ToString(); - } - protected void Page_Load(object sender, EventArgs e) - { - lblPeriodo.Text = "Periodo"; - txtInizio.ToolTip = "inizio periodo di riferimento per i dati mostrati"; - txtFine.ToolTip = "fine periodo di riferimento per i dati mostrati"; - lblDurataMin.Text = "Visualizza eventi con durata superiore a"; - } - - private void aggiornaPeriodo() - { - _intervallo = new intervalloDate(); - // calcolo tempi arrotondati - int oraInizio = 0; - int oraFine = 0; - if (mostraSelOra) - { - oraInizio = Convert.ToInt32(ddlOraInizio.SelectedValue); - oraFine = Convert.ToInt32(ddlOraFine.SelectedValue); - } - _intervallo.inizio = Convert.ToDateTime(txtInizio.Text).AddHours(oraInizio); - _intervallo.fine = Convert.ToDateTime(txtFine.Text).AddHours(oraFine); - verificaCoerenzaDate(); - int _durataMin; - _durataMin = Convert.ToInt32(txtDurataMin.Text); - Session["_durataMin"] = _durataMin; - reportUpdate(); - - } /// /// verifica che le date dell'intervallo siano coerenti (inizio < fine) /// @@ -240,46 +244,11 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl //intervalloAnalisi = _intervallo; aggiornaDateMostrate(false); } - /// - /// evento cambio testo data inizio - /// - /// - /// - protected void txtInizio_TextChanged(object sender, EventArgs e) - { - // imposto il selettore a discesa... - setPeriodoFree(); - checkIfUpdate(); - } - /// - /// evento cambio testo data fine - /// - /// - /// - protected void txtFine_TextChanged(object sender, EventArgs e) - { - // imposto il selettore a discesa... - setPeriodoFree(); - checkIfUpdate(); - } - /// - /// controlla se aggiornare subito o mostrare update (a seconda del valore di realtime update...) - /// - private void checkIfUpdate() - { - // se richiesto realtime - if (realtimeUpdate) - { - aggiornaPeriodo(); - // nascondo btn update - btnUpdate.Visible = false; - } - else - { - // altrimenti mostro btn update - btnUpdate.Visible = true; - } - } + + #endregion Private Methods + + #region Protected Methods + /// /// in questo caso faccio udpate periodo mostrato /// @@ -291,6 +260,94 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl // nascondo btn update btnUpdate.Visible = false; } + + /// + /// gestione del selettore rapido dell'intervallo temporale... + /// + /// + /// + protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) + { + // verifico cosa sia cambiato ed imposto date... + datario _datario = new datario(); + switch (DropDownList1.SelectedValue) + { + case "oggi": + _intervallo = _datario.giornata(DateTime.Now); + break; + + case "ieri": + _intervallo = _datario.giornata(DateTime.Now.AddDays(-1)); + break; + + case "ultimi 7gg": + _intervallo = _datario.ultimiGiorni(DateTime.Now, 7); + break; + + case "questa settimana": + _intervallo = _datario.questaSett(DateTime.Now); + break; + + case "ultimi 30gg": + _intervallo = _datario.ultimiGiorni(DateTime.Now, 30); + break; + + case "questo mese": + _intervallo = _datario.questoMese(DateTime.Now); + break; + + case "mese precedente": + _intervallo = _datario.mesePrecedente(DateTime.Now); + break; + + case "questo anno": + _intervallo = _datario.estremiAnno(DateTime.Now); + break; + + case "1 anno": + _intervallo = _datario.ultimiGiorni(DateTime.Now, 366); + break; + + case "10 anni": + _intervallo = _datario.ultimiGiorni(DateTime.Now, 3660); + break; + + case "2000 +": + DateTime anno2000 = new DateTime(2000, 1, 1); + _intervallo = _datario.setIntervallo(anno2000, DateTime.Now.AddDays(1)); + break; + + default: + break; + } + if ((intervalloAnalisi.inizio != _intervallo.inizio) || (intervalloAnalisi.fine != _intervallo.fine)) + { + verificaCoerenzaDate(); + aggiornaDateMostrate(realtimeUpdate); + // mostro btn update + btnUpdate.Visible = !realtimeUpdate; + } + } + + /// + /// avvio componente + /// + /// + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + setIntervallo(); + setDurataMin(); + } + + protected void Page_Load(object sender, EventArgs e) + { + lblPeriodo.Text = "Periodo"; + txtInizio.ToolTip = "inizio periodo di riferimento per i dati mostrati"; + txtFine.ToolTip = "fine periodo di riferimento per i dati mostrati"; + lblDurataMin.Text = "Visualizza eventi con durata superiore a"; + } + /// /// riporta aggiornamento a controller /// @@ -304,25 +361,34 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl } } - #endregion - - #region area public - - public intervalloDate intervalloAnalisi + /// + /// evento cambio testo data fine + /// + /// + /// + protected void txtFine_TextChanged(object sender, EventArgs e) { - get - { - return (intervalloDate)Session["_intervallo"]; - } - set - { - intervalloDate interv = value; - Session["_intervallo"] = interv; - Session["_inizio"] = interv.inizio; - Session["_fine"] = interv.fine; - aggiornaDateMostrate(false); - } + // imposto il selettore a discesa... + setPeriodoFree(); + checkIfUpdate(); } + + /// + /// evento cambio testo data inizio + /// + /// + /// + protected void txtInizio_TextChanged(object sender, EventArgs e) + { + // imposto il selettore a discesa... + setPeriodoFree(); + checkIfUpdate(); + } + + #endregion Protected Methods + + #region Public Methods + /// /// effettua update /// @@ -331,6 +397,7 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl { aggiornaDateMostrate(doReportUpdate); } + /// /// imposta periodo libero di selezione /// @@ -338,27 +405,6 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl { DropDownList1.SelectedIndex = 0; } - /// - /// imposta realtime update (non mostra button am fa subito update) - /// - public bool realtimeUpdate - { - get - { - return memLayer.ML.BoolSessionObj("rltUpdatePeriodo"); - } - set - { - memLayer.ML.setSessionVal("rltUpdatePeriodo", value); - } - } - #region gestione eventi - - public event EventHandler eh_doUpdate; - - #endregion - - - #endregion -} + #endregion Public Methods +} \ No newline at end of file diff --git a/GPW_Admin/WebUserControls/mod_unauthorized.ascx.cs b/GPW_Admin/WebUserControls/mod_unauthorized.ascx.cs index 578f402..09c498b 100644 --- a/GPW_Admin/WebUserControls/mod_unauthorized.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_unauthorized.ascx.cs @@ -12,9 +12,27 @@ using SteamWare; public partial class mod_unauthorized : System.Web.UI.UserControl { + #region Protected Methods + protected void Page_Load(object sender, EventArgs e) { - lblTitle.Text = user_std.UtSn.Traduci("NonDisponibile"); - lblMess.Text = user_std.UtSn.Traduci("NonAuth"); + lblTitle.Text = traduci("NonDisponibile"); + lblMess.Text = traduci("NonAuth"); } -} + + #endregion Protected Methods + + #region Public Methods + + /// + /// effettua traduzione del lemma + /// + /// + /// + public string traduci(string lemma) + { + return user_std.UtSn.Traduci(lemma); + } + + #endregion Public Methods +} \ No newline at end of file diff --git a/GPW_Admin/approvTimbrature.aspx.designer.cs b/GPW_Admin/approvTimbrature.aspx.designer.cs index 1739d40..465aa1f 100644 --- a/GPW_Admin/approvTimbrature.aspx.designer.cs +++ b/GPW_Admin/approvTimbrature.aspx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// 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 GPW_Admin @@ -15,20 +15,20 @@ namespace GPW_Admin { /// - /// Controllo mod_approvaTimbr1. + /// mod_approvaTimbr1 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::GPW_Admin.WebUserControls.mod_approvaTimbr mod_approvaTimbr1; /// - /// Controllo mod_pageSize. + /// mod_pageSize 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::GPW_Admin.WebUserControls.mod_pageSize mod_pageSize; } diff --git a/GPW_Data/licenzeGPW.cs b/GPW_Data/licenzeGPW.cs index c0c9d8d..504ec1a 100644 --- a/GPW_Data/licenzeGPW.cs +++ b/GPW_Data/licenzeGPW.cs @@ -10,6 +10,7 @@ using System.Web; using static GPW_data.LiManObj; using System.Text; using System.Security.Cryptography; +using System.Diagnostics; namespace GPW_data { @@ -33,6 +34,7 @@ namespace GPW_data protected static string rkeyAppInfo = memLayer.ML.redHash($"LiMan:AppInfo"); protected static string rkeyLicInfo = memLayer.ML.redHash($"LiMan:LicInfo"); protected static string rkeyPayload = memLayer.ML.redHash($"LiMan:Payload"); + protected static string rkeyVetoRefPayL = memLayer.ML.redHash($"LiMan:VetoRefPayL"); #endregion Protected Fields @@ -113,22 +115,34 @@ namespace GPW_data { bool answ = false; string currPayload = ""; - try + tryCheckPayloadOnline(ref answ, ref currPayload); + + // se OK resetto counter, altrimenti incremento + if (!answ) { - // cerco payload licenze locale... - currPayload = memLayer.ML.getRSV(rkeyPayload); - // se no ci fosse --> refresh online! - if (string.IsNullOrEmpty(currPayload)) + bool okRefreshPayload = string.IsNullOrEmpty(memLayer.ML.getRSV(rkeyVetoRefPayL)); + if (okRefreshPayload) { - currPayload = calcPayload(); - memLayer.ML.setRSV(rkeyPayload, currPayload, 3600); + Stopwatch sw = new Stopwatch(); + sw.Start(); + // richiedo update payload impostando TTL a 1 sec... + memLayer.ML.setRSV(rkeyPayload, "", 1); + var okApp = RefreshAppInfo().Result; + var okLic = RefreshActInfo().Result; + var okAct = RefreshLicInfo().Result; + var okPld = RefreshPayload().Result; + + memLayer.ML.setRSV(rkeyVetoRefPayL, "Veto", 5); + sw.Stop(); + logger.lg.scriviLog($"Trovato payload non valido, effettuato reset variabili in {sw.ElapsedMilliseconds} ms"); + + sw.Start(); + tryCheckPayloadOnline(ref answ, ref currPayload); + sw.Stop(); + logger.lg.scriviLog($"Rivalutato payload con esito {answ} in {sw.ElapsedMilliseconds} ms"); } - // confronto - answ = InfoApplicativo.Payload == currPayload; } - catch - { } - // confronto payload calc con quello della licenza + return answ; } } @@ -343,6 +357,29 @@ namespace GPW_data #endregion Public Properties + #region Private Methods + + private static void tryCheckPayloadOnline(ref bool answ, ref string currPayload) + { + try + { + // cerco payload licenze locale... + currPayload = memLayer.ML.getRSV(rkeyPayload); + // se no ci fosse --> refresh online! + if (string.IsNullOrEmpty(currPayload)) + { + currPayload = calcPayload(); + memLayer.ML.setRSV(rkeyPayload, currPayload, 3600); + } + // confronto payload calc con quello della licenza + answ = InfoApplicativo.Payload == currPayload; + } + catch + { } + } + + #endregion Private Methods + #region Protected Methods protected static string calcPayload()