diff --git a/C2P/Scripts/jSteamware.js b/C2P/Scripts/jSteamware.js index cc9f6f0..ec0f631 100644 --- a/C2P/Scripts/jSteamware.js +++ b/C2P/Scripts/jSteamware.js @@ -6,29 +6,59 @@ */ -// Gestione oggetti datepicker (globale) -function fixDatePicker() -{ - $.datepicker.setDefaults($.datepicker.regional["it"]); - $(".datepicker").datepicker({ - //showOtherMonths: true, - //selectOtherMonths: true, - showButtonPanel: true, - changeMonth: true, - changeYear: true, - dateFormat: "dd/mm/yy" - }); -} +//// Gestione oggetti datepicker (globale) +//function fixDatePicker() { +// $.datepicker.setDefaults($.datepicker.regional["it"]); +// $(".datepicker").datepicker({ +// //showOtherMonths: true, +// //selectOtherMonths: true, +// showButtonPanel: true, +// changeMonth: true, +// changeYear: true, +// dateFormat: "dd/mm/yy" +// }); +//} -// richiamo quando il DOM della pagina è ok... -$(function () { - fixDatePicker(); -}); +//// richiamo quando il DOM della pagina è ok... +//$(function () { +// fixDatePicker(); +//}); -// oggetto da legare all'update parziale ajax x sistemare script vari -var prm = Sys.WebForms.PageRequestManager.getInstance(); -prm.add_endRequest(function () { - // re-bind post eventi here - fixDatePicker(); -}); \ No newline at end of file +//// oggetto da legare all'update parziale ajax x sistemare script vari +//var prm = Sys.WebForms.PageRequestManager.getInstance(); +//prm.add_endRequest(function () { +// // re-bind your jQuery events here +// $(function () { +// fixDatePicker(); +// }); +//}); + +//$(function () { +// $.datepicker.setDefaults($.datepicker.regional["it"]); +// $(".datepicker").datepicker({ +// //showOtherMonths: true, +// //selectOtherMonths: true, +// showButtonPanel: true, +// changeMonth: true, +// changeYear: true, +// dateFormat: "dd/mm/yy" +// }); +//}); + +//// oggetto da legare all'update parziale ajax x sistemare btns & co +//var prm = Sys.WebForms.PageRequestManager.getInstance(); +//prm.add_endRequest(function () { +// // re-bind your jQuery events here +// $(function () { +// $.datepicker.setDefaults($.datepicker.regional["it"]); +// $(".datepicker").datepicker({ +// //showOtherMonths: true, +// //selectOtherMonths: true, +// showButtonPanel: true, +// changeMonth: true, +// changeYear: true, +// dateFormat: "dd/mm/yy" +// }); +// }); +//}); \ No newline at end of file diff --git a/C2P/WebUserControls/mod_OffersArchive.ascx b/C2P/WebUserControls/mod_OffersArchive.ascx index f39d1dc..d5819e8 100644 --- a/C2P/WebUserControls/mod_OffersArchive.ascx +++ b/C2P/WebUserControls/mod_OffersArchive.ascx @@ -9,7 +9,7 @@
- +
diff --git a/C2P/WebUserControls/mod_selPeriodo.ascx b/C2P/WebUserControls/mod_selPeriodo.ascx index afa2a2a..65cc091 100644 --- a/C2P/WebUserControls/mod_selPeriodo.ascx +++ b/C2P/WebUserControls/mod_selPeriodo.ascx @@ -1,7 +1,11 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_selPeriodo.ascx.cs" Inherits="C2P.WebUserControls.mod_selPeriodo" %> - -<%----%> -
- -    - - - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - + +
+
+ + <%: traduci("Date") %> + + + <%-- + 00 + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 08 + 09 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + --%> +
+
+ + <%: traduci("Date") %> + + <%-- → --%> + + <%-- + 00 + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 08 + 09 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + --%> + + + selezione + oggi + ieri + questa sett. + ultimi 7gg + questo mese + ultimi 30gg + 1 anno + + -  →  - - - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - -    - - selezione - oggi - ieri - questa settimana - ultimi 7gg - questo mese - ultimi 30gg - 1 anno - -     - -     - -    - + + + + +
diff --git a/C2P/WebUserControls/mod_selPeriodo.ascx.cs b/C2P/WebUserControls/mod_selPeriodo.ascx.cs index f160d35..c29a0d8 100644 --- a/C2P/WebUserControls/mod_selPeriodo.ascx.cs +++ b/C2P/WebUserControls/mod_selPeriodo.ascx.cs @@ -11,10 +11,21 @@ namespace C2P.WebUserControls { public partial class mod_selPeriodo : System.Web.UI.UserControl { - #region area protected - protected intervalloDate _intervallo; - + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + 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"; + } + } /// /// avvio componente /// @@ -22,6 +33,9 @@ namespace C2P.WebUserControls protected override void OnInit(EventArgs e) { base.OnInit(e); + 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"; setIntervallo(); setDurataMin(); } @@ -63,10 +77,12 @@ namespace C2P.WebUserControls datario _datario = new datario(); switch (ddlSelPeriodo.SelectedValue) { - case "oggi": + case "1": // selezione libera + break; + case "2": // oggi _intervallo = _datario.giornata(DateTime.Now); break; - case "ieri": + case "3": // ieri _intervallo = _datario.giornata(DateTime.Now.AddDays(-1)); break; case "ultimi 7gg": @@ -93,6 +109,10 @@ namespace C2P.WebUserControls aggiornaDateMostrate(false); // mostro btn update btnUpdate.Visible = true; + if (autoUpdate) + { + forceUpdate(); + } } } /// @@ -118,8 +138,9 @@ namespace C2P.WebUserControls _intervallo = intervalloAnalisi; } txtInizio.Text = _intervallo.inizio.ToShortDateString(); - ddlOraInizio.SelectedValue = _intervallo.inizio.Hour.ToString("00"); txtFine.Text = _intervallo.fine.ToShortDateString(); +#if false + ddlOraInizio.SelectedValue = _intervallo.inizio.Hour.ToString("00"); ddlOraFine.SelectedValue = _intervallo.fine.Hour.ToString("00"); if (mostraSelOra) { @@ -131,6 +152,8 @@ namespace C2P.WebUserControls ddlOraInizio.Visible = false; ddlOraFine.Visible = false; } + +#endif } /// /// imposta intervallo da sessione o di default @@ -171,27 +194,20 @@ namespace C2P.WebUserControls txtDurataMin.Text = _durataMin.ToString(); } /// - /// caricamento pagina + /// update periodo /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - lblPeriodo.Text = "Periodo di riferimento: "; - 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 +#if false int oraInizio = Convert.ToInt32(ddlOraInizio.SelectedValue); int oraFine = Convert.ToInt32(ddlOraFine.SelectedValue); _intervallo.inizio = Convert.ToDateTime(txtInizio.Text).AddHours(oraInizio); - _intervallo.fine = Convert.ToDateTime(txtFine.Text).AddHours(oraFine); + _intervallo.fine = Convert.ToDateTime(txtFine.Text).AddHours(oraFine); +#endif + _intervallo.inizio = Convert.ToDateTime(txtInizio.Text); + _intervallo.fine = Convert.ToDateTime(txtFine.Text); verificaCoerenzaDate(); int _durataMin; _durataMin = Convert.ToInt32(txtDurataMin.Text); @@ -223,11 +239,22 @@ namespace C2P.WebUserControls /// /// protected void txtInizio_TextChanged(object sender, EventArgs e) + { + procDateMod(); + } + /// + /// verifica la modifica delle date.. + /// + private void procDateMod() { // imposto il selettore a discesa... setPeriodoFree(); // mostro btn update btnUpdate.Visible = true; + if (autoUpdate) + { + forceUpdate(); + } } /// /// evento cambio testo data fine @@ -236,10 +263,7 @@ namespace C2P.WebUserControls /// protected void txtFine_TextChanged(object sender, EventArgs e) { - // imposto il selettore a discesa... - setPeriodoFree(); - // mostro btn update - btnUpdate.Visible = true; + procDateMod(); } /// /// in questo caso faccio udpate periodo mostrato @@ -247,6 +271,13 @@ namespace C2P.WebUserControls /// /// protected void btnUpdate_Click(object sender, EventArgs e) + { + forceUpdate(); + } + /// + /// forza update + /// + private void forceUpdate() { aggiornaPeriodo(); // nascondo btn update @@ -265,10 +296,6 @@ namespace C2P.WebUserControls } } - #endregion - - #region area public - public intervalloDate intervalloAnalisi { get @@ -300,6 +327,19 @@ namespace C2P.WebUserControls { ddlSelPeriodo.SelectedIndex = 0; } + /// + /// indica se il controllo debba fare update in automatico o attendere pressione button update da utente + /// + public bool autoUpdate { get; set; } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } #region gestione eventi @@ -308,6 +348,5 @@ namespace C2P.WebUserControls #endregion - #endregion } } \ No newline at end of file diff --git a/C2P/WebUserControls/mod_selPeriodo.ascx.designer.cs b/C2P/WebUserControls/mod_selPeriodo.ascx.designer.cs index efe24cb..ea6b1f5 100644 --- a/C2P/WebUserControls/mod_selPeriodo.ascx.designer.cs +++ b/C2P/WebUserControls/mod_selPeriodo.ascx.designer.cs @@ -12,6 +12,15 @@ namespace C2P.WebUserControls { public partial class mod_selPeriodo { + /// + /// BundleReference1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference1; + /// /// lblPeriodo control. /// @@ -31,13 +40,13 @@ namespace C2P.WebUserControls { protected global::System.Web.UI.WebControls.TextBox txtInizio; /// - /// ddlOraInizio control. + /// Label1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.DropDownList ddlOraInizio; + protected global::System.Web.UI.WebControls.Label Label1; /// /// txtFine control. @@ -48,15 +57,6 @@ namespace C2P.WebUserControls { /// protected global::System.Web.UI.WebControls.TextBox txtFine; - /// - /// ddlOraFine control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlOraFine; - /// /// ddlSelPeriodo control. /// diff --git a/C2P/bin/C2P.dll b/C2P/bin/C2P.dll index 9caa401..e929d9b 100644 Binary files a/C2P/bin/C2P.dll and b/C2P/bin/C2P.dll differ