From fecc8ea6cf27bab4f4d6928d9a7556efc3666401 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 21 Sep 2018 18:10:49 +0200 Subject: [PATCH] Fix riselezione fasi aperte operatore... --- AppData/DS_App.Designer.cs | 67 +++++++++++++------ AppData/DS_App.xsd | 11 +++ AppData/DS_App.xss | 2 +- .../WebUserControls/mod_btnComandi.ascx.cs | 28 +++++++- 4 files changed, 84 insertions(+), 24 deletions(-) diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 7d0b52d..d34b524 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -6402,7 +6402,7 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[8]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[9]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT *\r\nFROM v_TaskRec"; @@ -6419,41 +6419,47 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; 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[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; - this._commandCollection[3].CommandText = "dbo.stp_TR_GetByNumTask"; + this._commandCollection[3].CommandText = "dbo.stp_TR_GetAttiveByOpr"; 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("@NumTask", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodOpr", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_TR_GetByOpr"; + this._commandCollection[4].CommandText = "dbo.stp_TR_GetByNumTask"; 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("@CodOpr", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumTask", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_TR_GetByPost"; + this._commandCollection[5].CommandText = "dbo.stp_TR_GetByOpr"; 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("@CodPost", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showAll", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodOpr", 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_TR_insertQuery"; + this._commandCollection[6].CommandText = "dbo.stp_TR_GetByPost"; 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("@CodOpr", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodPost", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumTask", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodFase", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtStart", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showAll", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 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_TR_updateQuery"; + this._commandCollection[7].CommandText = "dbo.stp_TR_insertQuery"; 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("@IdxRec", 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("@DtEnd", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaEv", 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("@CodOpr", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodPost", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumTask", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodFase", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtStart", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[8].Connection = this.Connection; + this._commandCollection[8].CommandText = "dbo.stp_TR_updateQuery"; + this._commandCollection[8].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[8].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[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxRec", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtEnd", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaEv", 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()] @@ -6495,8 +6501,25 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_App.TaskRecDataTable getByNumTask(string NumTask) { + public virtual DS_App.TaskRecDataTable getAttiveByOpr(string CodOpr) { this.Adapter.SelectCommand = this.CommandCollection[3]; + if ((CodOpr == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodOpr)); + } + DS_App.TaskRecDataTable dataTable = new DS_App.TaskRecDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_App.TaskRecDataTable getByNumTask(string NumTask) { + this.Adapter.SelectCommand = this.CommandCollection[4]; if ((NumTask == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -6513,7 +6536,7 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.TaskRecDataTable getByOpr(string CodOpr) { - this.Adapter.SelectCommand = this.CommandCollection[4]; + this.Adapter.SelectCommand = this.CommandCollection[5]; if ((CodOpr == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -6530,7 +6553,7 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.TaskRecDataTable getByPost(string CodPost, global::System.Nullable showAll) { - this.Adapter.SelectCommand = this.CommandCollection[5]; + this.Adapter.SelectCommand = this.CommandCollection[6]; if ((CodPost == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -6574,7 +6597,7 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int insertQuery(string CodOpr, string CodPost, string NumTask, string CodFase, global::System.Nullable DtStart) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; if ((CodOpr == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -6626,7 +6649,7 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateQuery(global::System.Nullable IdxRec, global::System.Nullable DtEnd, global::System.Nullable QtaEv) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[8]; if ((IdxRec.HasValue == true)) { command.Parameters[1].Value = ((int)(IdxRec.Value)); } diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index c652b11..da320c3 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -353,6 +353,17 @@ FROM v_TaskRec + + + + dbo.stp_TR_GetAttiveByOpr + + + + + + + diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss index 3c34117..21275c5 100644 --- a/AppData/DS_App.xss +++ b/AppData/DS_App.xss @@ -9,7 +9,7 @@ - + diff --git a/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs b/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs index e767a39..369ea42 100644 --- a/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs +++ b/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs @@ -16,6 +16,10 @@ namespace C_TRACK.WebUserControls { return memLayer.ML.StringSessionObj("CurrNumTask"); } + set + { + memLayer.ML.setSessionVal("CurrNumTask", value); + } } /// /// evento comando clicked @@ -46,7 +50,19 @@ namespace C_TRACK.WebUserControls public void updateBtn() { - // verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA) !!!FARE!!! + // verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA) + if (CodOpr != "") + { + var tabTR = dataLayer.man.taTR.getAttiveByOpr(CodOpr); + if (tabTR.Rows.Count > 0) + { + // se NON HO una commessa attiva, SELEZIONO la PRIMA commessa aperta... + if (CurrNumTask == "") + { + CurrNumTask = tabTR[0].NumTask; + } + } + } // controllo se HO una fase corrente... repComandi.Visible = !hasVeto; @@ -57,6 +73,16 @@ namespace C_TRACK.WebUserControls } } /// + /// Codice postazione di lavoro + /// + public string CodOpr + { + get + { + return memLayer.ML.StringSessionObj("CodOpr"); + } + } + /// /// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED /// - ho una commessa /// - la commessa NON E' chiusa...