diff --git a/ETS_Data/DS_utilsProjEts.Designer.cs b/ETS_Data/DS_utilsProjEts.Designer.cs index 7467b71..62c7afb 100644 --- a/ETS_Data/DS_utilsProjEts.Designer.cs +++ b/ETS_Data/DS_utilsProjEts.Designer.cs @@ -9064,7 +9064,7 @@ namespace ETS_Data.DS_utilsProjEtsTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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 value, label, conditio FROM dbo.v_selCommesse"; @@ -9109,6 +9109,13 @@ namespace ETS_Data.DS_utilsProjEtsTableAdapters { 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[7] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[7].Connection = this.Connection; + this._commandCollection[7].CommandText = "dbo.stp_VSCom_getShortByIrWeek"; + 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, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -9260,6 +9267,29 @@ namespace ETS_Data.DS_utilsProjEtsTableAdapters { this.Adapter.Fill(dataTable); return dataTable; } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_utilsProjEts.v_selCommesseDataTable getShortByWeekIR(global::System.Nullable Anno, global::System.Nullable Sett) { + this.Adapter.SelectCommand = this.CommandCollection[7]; + 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; + } + DS_utilsProjEts.v_selCommesseDataTable dataTable = new DS_utilsProjEts.v_selCommesseDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } } /// diff --git a/ETS_Data/DS_utilsProjEts.xsd b/ETS_Data/DS_utilsProjEts.xsd index f109bb9..fba5a27 100644 --- a/ETS_Data/DS_utilsProjEts.xsd +++ b/ETS_Data/DS_utilsProjEts.xsd @@ -188,6 +188,18 @@ + + + + dbo.stp_VSCom_getShortByIrWeek + + + + + + + + diff --git a/ETS_Data/SQL/ETS_PROJ/ETS_PROJ_2110.sql b/ETS_Data/SQL/ETS_PROJ/ETS_PROJ_2110.sql index e7064ce..4331cea 100644 --- a/ETS_Data/SQL/ETS_PROJ/ETS_PROJ_2110.sql +++ b/ETS_Data/SQL/ETS_PROJ/ETS_PROJ_2110.sql @@ -445,4 +445,37 @@ SELECT vsc.* FROM v_selCommesseShort vsc INNER JOIN cteFasi cte ON vsc.value = cte.idxFase +GO + + +/************************************* +* STORED PROCEDURE stp_VSCom_getShortByIrWeek +* +* elenco commesse con IMPIEGO RISORSE nel periodo +* +* mod : 2021.10.19 +* aut : S.E. Locatelli +**************************************/ +CREATE PROCEDURE [dbo].[stp_VSCom_getShortByIrWeek] +( + @Anno INT = 0, + @Sett INT = 0 +) +AS + +SET NOCOUNT ON; + +;WITH cteFasi AS +( + SELECT DISTINCT idxFase + FROM ImpiegoRisorse + WHERE Anno = @Anno + AND Sett = @Sett +) + +SELECT vsc.* +FROM v_selCommesseShort vsc +INNER JOIN cteFasi cte ON vsc.value = cte.idxFase + + GO \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs index f9aa0a0..ca90fb4 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs @@ -200,6 +200,31 @@ namespace PROJ_ETS.WebUserControls } } + protected List ListIdxLocked + { + get + { + List answ = new List(); + //cero in redis + var rawData = utils.obj.getRSV(userLockTable); + if (!string.IsNullOrEmpty(rawData)) + { + answ = JsonConvert.DeserializeObject>(rawData); + } + else + { + var tabDati = DataProxy_ProjEts.DP.taTLB.GetData(); + answ = tabDati + .Select(x => x.idxDipendente) + .ToList(); + rawData = JsonConvert.SerializeObject(answ); + utils.obj.setRSV(userLockTable, rawData, 10); + } + //restituisco... + return answ; + } + } + /// /// settimana selezionato (wrapper) /// @@ -985,6 +1010,7 @@ namespace PROJ_ETS.WebUserControls protected bool userIsLocked(int IdxDipendente) { bool answ = false; +#if false Ds_ProjEts.TLockBazRADataTable tabDati = null; // cerco in cache var rawData = utils.obj.getRSV(userLockTable); @@ -1006,6 +1032,11 @@ namespace PROJ_ETS.WebUserControls .Where(x => x.idxDipendente == IdxDipendente) .Count() > 0; } +#endif + if (ListIdxLocked.Count > 0) + { + answ = (ListIdxLocked.Contains(IdxDipendente)); + } return answ; //cerco il lock nella tab... //return DataProxy_ProjEts.DP.taTLB.getByDip(IdxDipendente).Rows.Count > 0; diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs index e43c11c..7c94136 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs @@ -87,7 +87,7 @@ namespace PROJ_ETS.WebUserControls // carico TUTTE le celle del Impiego... tabIR = DataProxy_ProjEts.DP.taIR.getFullWeek(anno, settimana); tabComm = DataProxy_ProjEts.DP.taSelCom.GetData(); // leggo tutte commesse... - tabCommShort = DataProxy_ProjEts.DP.taSelCom.getCommShort(anno, settimana); // leggo tutte commesse formato short (nickname...) + tabCommShort = DataProxy_ProjEts.DP.taSelCom.getShortByWeekIR(anno, settimana); // leggo tutte commesse formato short (nickname...) // calcolo il primo dip idxDip = tabIR[0].idxDipendente; // calcolo num celle totali diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll index b7aa9d2..379f147 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 dcd6f98..e434cb6 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ