diff --git a/ETS_Data/Ds_ProjEts.xsd b/ETS_Data/Ds_ProjEts.xsd index cc340a8..a3646b3 100644 --- a/ETS_Data/Ds_ProjEts.xsd +++ b/ETS_Data/Ds_ProjEts.xsd @@ -1113,7 +1113,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM - + dbo.stp_BAZ_clonePrevWeek @@ -1125,7 +1125,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM - + dbo.stp_BAZ_creaBulkByIdxFase @@ -1138,7 +1138,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM - + dbo.stp_BAZ_deleteByIdxFase @@ -1163,6 +1163,20 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM + + + + dbo.stp_BAZ_getByAnnoSettCC + + + + + + + + + + @@ -1176,7 +1190,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM - + dbo.stp_BAZ_updateQuery @@ -1315,7 +1329,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1358,7 +1372,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1408,7 +1422,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1497,7 +1511,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1541,7 +1555,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1586,7 +1600,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1666,7 +1680,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1714,7 +1728,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1731,7 +1745,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1752,7 +1766,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1773,7 +1787,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1908,7 +1922,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -1927,7 +1941,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, OreTot FROM ImpiegoRisorse WHERE (Ann - + @@ -2003,12 +2017,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 d4aa9f5..cc17b39 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 38a4653..e17a302 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[7]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[8]; 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" + @@ -15960,22 +15960,31 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM 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[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; - this._commandCollection[5].CommandText = "dbo.stp_BAZ_getByAnnoSettDip"; + this._commandCollection[5].CommandText = "dbo.stp_BAZ_getByAnnoSettCC"; 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("@CapoCommessa", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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].CommandText = "dbo.stp_BAZ_getByAnnoSettDip"; 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, "", "", "")); + this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[7].Connection = this.Connection; + this._commandCollection[7].CommandText = "dbo.stp_BAZ_updateQuery"; + this._commandCollection[7].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[7].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[7].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[7].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[7].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[7].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[7].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()] @@ -16029,7 +16038,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [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) { + public virtual Ds_ProjEts.BazaarRisorseDataTable getByAnnoSettCC(global::System.Nullable Anno, global::System.Nullable Sett, global::System.Nullable idxDipendente, string CapoCommessa) { this.Adapter.SelectCommand = this.CommandCollection[5]; if ((Anno.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Anno.Value)); @@ -16049,6 +16058,41 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM else { this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; } + if ((CapoCommessa == null)) { + this.Adapter.SelectCommand.Parameters[4].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[4].Value = ((string)(CapoCommessa)); + } + Ds_ProjEts.BazaarRisorseDataTable dataTable = new Ds_ProjEts.BazaarRisorseDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [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")] + [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[6]; + if ((Anno.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Anno.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + if ((Sett.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[2].Value = ((int)(Sett.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + if ((idxDipendente.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[3].Value = ((int)(idxDipendente.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; + } Ds_ProjEts.BazaarRisorseDataTable dataTable = new Ds_ProjEts.BazaarRisorseDataTable(); this.Adapter.Fill(dataTable); return dataTable; @@ -16348,7 +16392,7 @@ SELECT Anno, Sett, idxDipendente, idxFase, Allocazione, SchemaWeek, OreTot FROM [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[6]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; if ((Anno.HasValue == true)) { command.Parameters[1].Value = ((int)(Anno.Value)); } diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx index 6ffcd6d..0e3dc56 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx @@ -5,10 +5,10 @@
- +
- +
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs index a620ac4..02b990d 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs @@ -122,8 +122,8 @@ namespace PROJ_ETS.WebUserControls { btnAddNew.Enabled = cudEnabled; btnCloneWeek.Enabled = cudEnabled; - btnAddNew.Visible = isWritable(); - btnCloneWeek.Visible = isWritable(); + btnAddNew.Visible = isWritable() && isPowerUser; + btnCloneWeek.Visible = isWritable() && isPowerUser; fixBtnAddNewComm(); if (!cudEnabled) { @@ -194,8 +194,16 @@ namespace PROJ_ETS.WebUserControls idxDip = tabBaz[0].idxDipendente; // calcolo num celel totali totCelle = tabBaz.Rows.Count; + // a secondo del ruolo utente (PowerUser|PowerReader oppure CC) determino quali commesse siano visibili + if (isCC && !(isPowerReader || isPowerUser)) + { + tabBazSingle = DataProxy_ProjEts.DP.taBaz.getByAnnoSettCC(anno, settimana, idxDip, user_std.UtSn.currUserNomeCognome); // qui filtro le commesse, se è CC o meno + } + else + { + tabBazSingle = DataProxy_ProjEts.DP.taBaz.getByAnnoSettDip(anno, settimana, idxDip); // qui filtro le commesse, se è CC o meno + } // calcolo numero commesse! - tabBazSingle = DataProxy_ProjEts.DP.taBaz.getByAnnoSettDip(anno, settimana, idxDip); numComm = tabBazSingle.Rows.Count; numDip = tabD2ATR.Rows.Count; //numDip = totCelle / numComm; @@ -672,5 +680,16 @@ namespace PROJ_ETS.WebUserControls return user_std.UtSn.userHasRight("User"); } } + /// + /// risponde alla domanda se l'utente sia CapoCommessa + /// + /// + public bool isCC + { + get + { + return user_std.UtSn.userHasRight("CC"); + } + } } } \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll index 0219681..7967c68 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 8cac704..6eab589 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ