diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx new file mode 100644 index 0000000..b56b495 --- /dev/null +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx @@ -0,0 +1,22 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_navigaWeek.ascx.cs" Inherits="PROJ_ETS.WebUserControls.mod_navigaWeek" %> +
+ Anno:  + + + +
+
+ Settimana:  + + + +
+
+ +
+
+ +
+
+ +
\ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx.cs new file mode 100644 index 0000000..6f0d7b1 --- /dev/null +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using ETS_Data; +using NLog; + +namespace PROJ_ETS.WebUserControls +{ + public partial class mod_navigaWeek : System.Web.UI.UserControl + { + /// + /// evento nuovi valori selezionati + /// + public event EventHandler eh_newWeekSelected; + /// + /// istante corrente + /// + public DateTime adesso + { + set + { + utils.obj.setSessionVal("timeImpiego", value); + } + get + { + DateTime answ = DateTime.Now; + try + { + answ = (DateTime)utils.obj.objSessionObj("timeImpiego"); + } + catch + { } + return answ; + } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + setDdlPeriodo(); + //importo sett corrente + lnkW.Text = string.Format("W{0:0#}", datario.WeekOfYearISO8601(DateTime.Now)); + } + } + /// + /// imposta DDL del periodo + /// + public void setDdlPeriodo() + { + ddlAnno.SelectedValue = adesso.Year.ToString(); + ddlWeek.SelectedValue = (datario.WeekOfYearISO8601(adesso)).ToString(); + // ricalcolo periodo! + DataProxy_ProjEts.DP.taIR.importSettimana(anno, settimana); + } + /// + /// anno selezionato + /// + public int anno + { + get + { + int answ = adesso.Year; + try + { + answ = Convert.ToInt32(ddlAnno.SelectedValue); + } + catch + { } + return answ; + } + } + /// + /// settimana selezionato + /// + public int settimana + { + get + { + int answ = datario.WeekOfYearISO8601(adesso); + try + { + answ = Convert.ToInt32(ddlWeek.SelectedValue); + } + catch + { } + return answ; + } + } + protected void ddlAnno_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo nuovo anno & nuova week! + int currWeek = datario.WeekOfYearISO8601(adesso); + int currYear = adesso.Year; + adesso = adesso.AddYears(anno - currYear).AddDays(7 * (settimana - currWeek)); + if (eh_newWeekSelected != null) + { + eh_newWeekSelected(this, new EventArgs()); + } + //doUpdate(); + } + + protected void ddlWeek_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo nuovo anno & nuova week! + int currWeek = datario.WeekOfYearISO8601(adesso); + int currYear = adesso.Year; + adesso = adesso.AddYears(anno - currYear).AddDays(7 * (settimana - currWeek)); + if (eh_newWeekSelected != null) + { + eh_newWeekSelected(this, new EventArgs()); + } + //doUpdate(); + } + /// + /// effettua selezione periodo rapida: 0 = corrente (ovvero la PROSSIMA), +1 = successiva (a seleizonata), -1 = precedente (a selezionata) + /// + /// + /// + protected void lnkW_Click(object sender, EventArgs e) + { + // sposto! + LinkButton lnk = (LinkButton)sender; + if (lnk.CommandArgument == "Curr") + { + adesso = DateTime.Now; + } + else if (lnk.CommandArgument == "Prev") + { + adesso = adesso.AddDays(-7); + } + else if (lnk.CommandArgument == "Next") + { + adesso = adesso.AddDays(7); + } + setDdlPeriodo(); + if (eh_newWeekSelected != null) + { + eh_newWeekSelected(this, new EventArgs()); + } + //doUpdate(); + } + } +} \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx.designer.cs new file mode 100644 index 0000000..8f9396b --- /dev/null +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navigaWeek.ascx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// 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_navigaWeek { + + /// + /// ddlAnno control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlAnno; + + /// + /// odsYear control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsYear; + + /// + /// ddlWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlWeek; + + /// + /// odsWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsWeek; + + /// + /// lnkWPrev control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkWPrev; + + /// + /// lnkW control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkW; + + /// + /// lnkWNext control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkWNext; + } +} diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx index 4fe9abc..09508ab 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx @@ -1,7 +1,9 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_weekRA.ascx.cs" Inherits="PROJ_ETS.WebUserControls.mod_weekRA" %> +<%@ Register src="mod_navigaWeek.ascx" tagname="mod_navigaWeek" tagprefix="uc1" %> +
-
+ <%--
Anno:  @@ -21,7 +23,8 @@
-
+
--%> +
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs index 7539282..6144c40 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs @@ -29,6 +29,7 @@ namespace PROJ_ETS.WebUserControls protected Ds_ProjEts.ImpiegoRisorseRow rigaIR; protected Ds_ProjEts.DipendentiRow rigaDip; protected DS_utilsProjEts.v_selCommesseRow rigaComm; +#if true /// /// istante corrente /// @@ -49,7 +50,8 @@ namespace PROJ_ETS.WebUserControls { } return answ; } - } + } +#endif /// /// caricamento pagina /// @@ -57,12 +59,14 @@ namespace PROJ_ETS.WebUserControls /// protected void Page_Load(object sender, EventArgs e) { +#if false if (!Page.IsPostBack) { setDdlPeriodo(); //importo sett corrente lnkW.Text = string.Format("W{0:0#}", datario.WeekOfYearISO8601(DateTime.Now)); - } + } +#endif // carico tabelle: elenco dipendenti (raggruppato x tipo) ed elenco dip in Impiego... tabDip = DataProxy_ProjEts.DP.taDip.GetData(); tabD2ATR = DataProxy_ProjEts.DP.taD2ATR.getBazOrd(); @@ -71,7 +75,18 @@ namespace PROJ_ETS.WebUserControls // faccio update! doUpdate(); } + mod_navigaWeek1.eh_newWeekSelected += mod_navigaWeek1_eh_newWeekSelected; } + /// + /// selezioanta nuova sett --> faccio udpate!!! + /// + /// + /// + void mod_navigaWeek1_eh_newWeekSelected(object sender, EventArgs e) + { + doUpdate(); + } +#if false /// /// imposta DDL del periodo /// @@ -81,7 +96,8 @@ namespace PROJ_ETS.WebUserControls ddlWeek.SelectedValue = (datario.WeekOfYearISO8601(adesso)).ToString(); // ricalcolo periodo! DataProxy_ProjEts.DP.taIR.importSettimana(anno, settimana); - } + } +#endif /// /// esegue update controllo /// @@ -90,6 +106,7 @@ namespace PROJ_ETS.WebUserControls caricaDatiBlocco(); disegnaTabella(); } +#if true /// /// anno selezionato /// @@ -97,14 +114,7 @@ namespace PROJ_ETS.WebUserControls { get { - int answ = adesso.Year; - try - { - answ = Convert.ToInt32(ddlAnno.SelectedValue); - } - catch - { } - return answ; + return mod_navigaWeek1.anno; } } /// @@ -114,16 +124,10 @@ namespace PROJ_ETS.WebUserControls { get { - int answ = datario.WeekOfYearISO8601(adesso); - try - { - answ = Convert.ToInt32(ddlWeek.SelectedValue); - } - catch - { } - return answ; + return mod_navigaWeek1.settimana; } - } + } +#endif /// /// carica i dati del blocco in un oggetto BlockMap (compreso attive/inattive) @@ -349,6 +353,7 @@ namespace PROJ_ETS.WebUserControls return answ; } +#if false protected void ddlAnno_SelectedIndexChanged(object sender, EventArgs e) { // salvo nuovo anno & nuova week! @@ -389,6 +394,7 @@ namespace PROJ_ETS.WebUserControls } setDdlPeriodo(); doUpdate(); - } + } +#endif } } \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.designer.cs index 039b39c..329d663 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.designer.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.designer.cs @@ -13,67 +13,13 @@ namespace PROJ_ETS.WebUserControls { public partial class mod_weekRA { /// - /// ddlAnno control. + /// mod_navigaWeek1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.DropDownList ddlAnno; - - /// - /// odsYear control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ObjectDataSource odsYear; - - /// - /// ddlWeek control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlWeek; - - /// - /// odsWeek control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ObjectDataSource odsWeek; - - /// - /// lnkWPrev control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton lnkWPrev; - - /// - /// lnkW control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton lnkW; - - /// - /// lnkWNext control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton lnkWNext; + protected global::PROJ_ETS.WebUserControls.mod_navigaWeek mod_navigaWeek1; /// /// tblBlocco control. diff --git a/PROJ-ETS/PROJ-ETS/bin/DocumentFormat.OpenXml.dll b/PROJ-ETS/PROJ-ETS/bin/DocumentFormat.OpenXml.dll new file mode 100644 index 0000000..a3249c1 Binary files /dev/null and b/PROJ-ETS/PROJ-ETS/bin/DocumentFormat.OpenXml.dll differ diff --git a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll index 8a9b0fa..e847c44 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ