diff --git a/ETS_Data/Ds_ProjEts.xsd b/ETS_Data/Ds_ProjEts.xsd index 9bfcb5c..cc340a8 100644 --- a/ETS_Data/Ds_ProjEts.xsd +++ b/ETS_Data/Ds_ProjEts.xsd @@ -1113,6 +1113,18 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM + + + + dbo.stp_BAZ_clonePrevWeek + + + + + + + + @@ -1303,7 +1315,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1346,7 +1358,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1396,7 +1408,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1485,7 +1497,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1529,7 +1541,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1574,7 +1586,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1654,7 +1666,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1702,7 +1714,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1719,7 +1731,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1740,7 +1752,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1761,7 +1773,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1896,7 +1908,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1915,7 +1927,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1991,12 +2003,12 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - - - - - - + + + + + + \ No newline at end of file diff --git a/ETS_Data/Ds_ProjEts.xss b/ETS_Data/Ds_ProjEts.xss index 8c21742..d4aa9f5 100644 --- a/ETS_Data/Ds_ProjEts.xss +++ b/ETS_Data/Ds_ProjEts.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -17,7 +17,7 @@ - + diff --git a/ETS_Data/Ds_ProjEts1.Designer.cs b/ETS_Data/Ds_ProjEts1.Designer.cs index b92640e..38a4653 100644 --- a/ETS_Data/Ds_ProjEts1.Designer.cs +++ b/ETS_Data/Ds_ProjEts1.Designer.cs @@ -15922,7 +15922,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[7]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM d" + @@ -15930,15 +15930,14 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; - this._commandCollection[1].CommandText = "dbo.stp_BAZ_creaBulkByIdxFase"; + this._commandCollection[1].CommandText = "dbo.stp_BAZ_clonePrevWeek"; this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Anno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Sett", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxFase", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_BAZ_deleteByIdxFase"; + this._commandCollection[2].CommandText = "dbo.stp_BAZ_creaBulkByIdxFase"; this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Anno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); @@ -15946,29 +15945,37 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxFase", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; - this._commandCollection[3].CommandText = "dbo.stp_BAZ_getByAnnoSett"; + this._commandCollection[3].CommandText = "dbo.stp_BAZ_deleteByIdxFase"; this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Anno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Sett", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxFase", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[4].Connection = this.Connection; - this._commandCollection[4].CommandText = "dbo.stp_BAZ_getByAnnoSettDip"; + this._commandCollection[4].CommandText = "dbo.stp_BAZ_getByAnnoSett"; this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Anno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Sett", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxDipendente", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; - this._commandCollection[5].CommandText = "dbo.stp_BAZ_updateQuery"; + this._commandCollection[5].CommandText = "dbo.stp_BAZ_getByAnnoSettDip"; this._commandCollection[5].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Anno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Sett", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxDipendente", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxFase", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Allocazione", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[6].Connection = this.Connection; + this._commandCollection[6].CommandText = "dbo.stp_BAZ_updateQuery"; + this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Anno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Sett", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxDipendente", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxFase", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Allocazione", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -16000,7 +16007,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual Ds_ProjEts.BazaarRisorseDataTable getByAnnoSett(global::System.Nullable Anno, global::System.Nullable Sett) { - this.Adapter.SelectCommand = this.CommandCollection[3]; + this.Adapter.SelectCommand = this.CommandCollection[4]; if ((Anno.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Anno.Value)); } @@ -16023,7 +16030,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual Ds_ProjEts.BazaarRisorseDataTable getByAnnoSettDip(global::System.Nullable Anno, global::System.Nullable Sett, global::System.Nullable idxDipendente) { - this.Adapter.SelectCommand = this.CommandCollection[4]; + this.Adapter.SelectCommand = this.CommandCollection[5]; if ((Anno.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Anno.Value)); } @@ -16226,7 +16233,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int creaBulkByIdxFase(global::System.Nullable Anno, global::System.Nullable Sett, global::System.Nullable idxFase) { + public virtual int clonePrevWeek(global::System.Nullable Anno, global::System.Nullable Sett) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; if ((Anno.HasValue == true)) { command.Parameters[1].Value = ((int)(Anno.Value)); @@ -16240,12 +16247,6 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM else { command.Parameters[2].Value = global::System.DBNull.Value; } - if ((idxFase.HasValue == true)) { - command.Parameters[3].Value = ((int)(idxFase.Value)); - } - else { - command.Parameters[3].Value = global::System.DBNull.Value; - } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { @@ -16266,7 +16267,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int deleteByIdxFase(global::System.Nullable Anno, global::System.Nullable Sett, global::System.Nullable idxFase) { + public virtual int creaBulkByIdxFase(global::System.Nullable Anno, global::System.Nullable Sett, global::System.Nullable idxFase) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; if ((Anno.HasValue == true)) { command.Parameters[1].Value = ((int)(Anno.Value)); @@ -16303,11 +16304,51 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM return returnValue; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int deleteByIdxFase(global::System.Nullable Anno, global::System.Nullable Sett, global::System.Nullable idxFase) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + if ((Anno.HasValue == true)) { + command.Parameters[1].Value = ((int)(Anno.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((Sett.HasValue == true)) { + command.Parameters[2].Value = ((int)(Sett.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((idxFase.HasValue == true)) { + command.Parameters[3].Value = ((int)(idxFase.Value)); + } + else { + command.Parameters[3].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateQuery(global::System.Nullable Anno, global::System.Nullable Sett, global::System.Nullable idxDipendente, global::System.Nullable idxFase, global::System.Nullable Allocazione) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; if ((Anno.HasValue == true)) { command.Parameters[1].Value = ((int)(Anno.Value)); } diff --git a/ETS_Data/bin/ETS/ETS_Data.dll b/ETS_Data/bin/ETS/ETS_Data.dll index ea95e12..db7e7b6 100644 Binary files a/ETS_Data/bin/ETS/ETS_Data.dll and b/ETS_Data/bin/ETS/ETS_Data.dll differ diff --git a/ETS_Data/obj/ETS/DesignTimeResolveAssemblyReferencesInput.cache b/ETS_Data/obj/ETS/DesignTimeResolveAssemblyReferencesInput.cache index 6999eb1..df0218b 100644 Binary files a/ETS_Data/obj/ETS/DesignTimeResolveAssemblyReferencesInput.cache and b/ETS_Data/obj/ETS/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ETS_Data/obj/ETS/ETS_Data.dll b/ETS_Data/obj/ETS/ETS_Data.dll index ea95e12..db7e7b6 100644 Binary files a/ETS_Data/obj/ETS/ETS_Data.dll and b/ETS_Data/obj/ETS/ETS_Data.dll differ diff --git a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user index 1637e80..aeaf85a 100644 --- a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user +++ b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user @@ -2,7 +2,7 @@ ShowAllFiles - 218 + ETS diff --git a/PROJ-ETS/PROJ-ETS/Web.config b/PROJ-ETS/PROJ-ETS/Web.config index 1dd3ce8..b5f1920 100644 --- a/PROJ-ETS/PROJ-ETS/Web.config +++ b/PROJ-ETS/PROJ-ETS/Web.config @@ -26,7 +26,7 @@ - + diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx index 4d33664..6ffcd6d 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx @@ -4,8 +4,11 @@
-  
- +
+ +
+
+
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs index bb931c8..a620ac4 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs @@ -121,6 +121,9 @@ namespace PROJ_ETS.WebUserControls public void doUpdate() { btnAddNew.Enabled = cudEnabled; + btnCloneWeek.Enabled = cudEnabled; + btnAddNew.Visible = isWritable(); + btnCloneWeek.Visible = isWritable(); fixBtnAddNewComm(); if (!cudEnabled) { @@ -159,7 +162,7 @@ namespace PROJ_ETS.WebUserControls { // controllo le condizioni: in primis se in web config è abilitato edit passato è ok... bool answ = utils.obj.confReadBool("bazCudPastEnabled"); - // se non globalmente permesso controllo se sia anno/sett successiva a quelal corrente + // se non globalmente permesso controllo se sia anno/sett successiva a quella corrente if (!answ) { DateTime ora = DateTime.Now; @@ -317,24 +320,24 @@ namespace PROJ_ETS.WebUserControls rigaComm = (DS_utilsProjEts.v_selCommesseRow)tabComm.Select(string.Format("value = {0}", tabBazSingle[pos_y].idxFase))[0]; if (showOre) { - // aggiungo button x fare elemento cliccabile - LinkButton lnkbDel = new LinkButton(); // controllo se CUD è abilitato - if (cudEnabled) + if (cudEnabled && isWritable()) { + // aggiungo button x fare elemento cliccabile + LinkButton lnkbDel = new LinkButton(); lnkbDel.Click += new EventHandler(lnkbDel_Click); lnkbDel.CommandArgument = rigaComm.value.ToString(); lnkbDel.Text = string.Format("{0:0##} h [elimina]", oreTotComm[pos_y]); lnkbDel.ToolTip = string.Format("Click per eliminare commessa {0}", rigaComm.label.Substring(0, 9)); lnkbDel.OnClientClick = "return confirm('Confermi eliminazione record?')"; + lnkbDel.Enabled = cudEnabled; + cell.Controls.Add(lnkbDel); } else { - lnkbDel.Text = string.Format("{0:0##} h", oreTotComm[pos_y]); - lnkbDel.ToolTip = string.Format("Commessa {0} (non modificabile)", rigaComm.label.Substring(0, 9)); + cell.Text = string.Format("{0:0##} h", oreTotComm[pos_y]); + cell.ToolTip = string.Format("Commessa {0} (non modificabile)", rigaComm.label.Substring(0, 9)); } - lnkbDel.Enabled = cudEnabled; - cell.Controls.Add(lnkbDel); } else { @@ -364,7 +367,7 @@ namespace PROJ_ETS.WebUserControls } catch { } - doUpdate(); + Response.Redirect("Bazaar"); } } /// @@ -409,24 +412,29 @@ namespace PROJ_ETS.WebUserControls { cell = new TableCell(); cell.CssClass = TabellaRisorse[pos_x, pos_y].Css; - // aggiungo button x fare elemento cliccabile - LinkButton lnkb = new LinkButton(); - lnkb.ToolTip = TabellaRisorse[pos_x, pos_y].ToolTip; - lnkb.Text = TabellaRisorse[pos_x, pos_y].Label; - lnkb.CssClass = "openDiag"; // server x far si che apra il dialog modale... - // controllo se CUD è abilitato - if (cudEnabled) + // controllo SE devo emttere link o meno: se CUD è abilitato e se è WRITABLE + if (cudEnabled && isWritable()) { + // aggiungo button x fare elemento cliccabile + LinkButton lnkb = new LinkButton(); + lnkb.ToolTip = TabellaRisorse[pos_x, pos_y].ToolTip; + lnkb.Text = TabellaRisorse[pos_x, pos_y].Label; + lnkb.CssClass = "openDiag"; // server x far si che apra il dialog modale... lnkb.Click += new EventHandler(lnkb_Click); lnkb.CommandArgument = string.Format("{0}#{1}", TabellaRisorse[pos_x, pos_y].IdxDipendente, TabellaRisorse[pos_x, pos_y].IdxFase); + lnkb.Enabled = cudEnabled && isWritable(); + cell.Controls.Add(lnkb); + } + else + { + cell.ToolTip = TabellaRisorse[pos_x, pos_y].ToolTip; + cell.Text = TabellaRisorse[pos_x, pos_y].Label; } - lnkb.Enabled = cudEnabled; // controllo se la cella è selezionata, nel caso BOLD! if (TabellaRisorse[pos_x, pos_y].IdxDipendente == IdxDipSel && TabellaRisorse[pos_x, pos_y].IdxFase == IdxFaseSel) { cell.CssClass = "selCel"; } - cell.Controls.Add(lnkb); // carico in cella di tabella il linkButton riga.Cells.Add(cell); } @@ -447,6 +455,17 @@ namespace PROJ_ETS.WebUserControls showPnlAddNewComm(!pnlAddNew.Visible); } /// + /// gestione visualizzaizone pannello elenco commesse da inserire + /// + /// + /// + protected void btnCloneWeek_Click(object sender, EventArgs e) + { + // clono dalal week precedente (con valori a zero...), se valori ci sono NON li sovrascrivo... + DataProxy_ProjEts.DP.taBaz.clonePrevWeek(anno, settimana); + Response.Redirect("Bazaar"); + } + /// /// controllo visibilità pannello /// /// @@ -589,5 +608,69 @@ namespace PROJ_ETS.WebUserControls } } + + /// + /// pagina corrente (URL finale) + /// + public string _paginaCorrente { get; set; } + /// + /// 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(); + } + /// + /// risponde alla domanda se l'utente abbia permesso tipo writable (S) nel permessi2funzione + /// + /// + public bool isWritable() + { + bool answ = false; + if (_paginaCorrente == null) + { + PagCorrente(); + } + answ = user_std.UtSn.isPageWriteEnabled(_paginaCorrente); + return answ; + } + /// + /// risponde alla domanda se l'utente sia PowerUser + /// + /// + public bool isPowerUser + { + get + { + return user_std.UtSn.userHasRight("PowerUser"); + } + } + /// + /// risponde alla domanda se l'utente sia PowerReader + /// + /// + public bool isPowerReader + { + get + { + return user_std.UtSn.userHasRight("PowerReader"); + } + } + /// + /// risponde alla domanda se l'utente sia User + /// + /// + public bool isUser + { + get + { + return user_std.UtSn.userHasRight("User"); + } + } } } \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs index a4fb600..9133f53 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs @@ -30,6 +30,15 @@ namespace PROJ_ETS.WebUserControls { /// protected global::System.Web.UI.WebControls.Button btnAddNew; + /// + /// btnCloneWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCloneWeek; + /// /// pnlAddNew control. /// diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll index cb8d219..0219681 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll and b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll differ diff --git a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll index dde6fdb..8cac704 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ diff --git a/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip b/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip index 404457c..bf1109f 100644 Binary files a/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip and b/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip differ