diff --git a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs index 10b55ed2..5676381b 100644 --- a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs +++ b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs @@ -360,6 +360,19 @@ namespace MoonPro_site.WebUserControls if (idxOdlSel > 0) { DataLayerObj.taODL.updateQta(numPz, pzPallet, idxOdlSel); + // se abilitata modifica numPzPallet --> chiamo stored update! + if (numPzEditable) + { + // recupero da config il max... + int numPzMaxFix = 50; + try + { + numPzMaxFix = memLayer.ML.cdvi("numPzMaxFix"); + } + catch + { } + DataLayerObj.taTempiCicloRilevati.TC_fixFromODL(idxOdlSel, numPzMaxFix); + } } updateCtrl(); } @@ -369,6 +382,7 @@ namespace MoonPro_site.WebUserControls divEditQta.Visible = false; grView.SelectedIndex = -1; grView.DataBind(); + idxMaccEdit = ""; } /// /// idxOdl selezionato @@ -408,6 +422,25 @@ namespace MoonPro_site.WebUserControls txtNewQta.Text = value.ToString(); } } + protected bool numPzEditable + { + get + { + bool answ = false; + try + { + DS_ProdTempi.DatiMacchineDataTable tabDatiMacc = DataLayerObj.taDatiMacchine.getByIdx(idxMaccEdit); + if (tabDatiMacc != null && tabDatiMacc.Count > 0) + { + DS_ProdTempi.DatiMacchineRow rigaMacc = tabDatiMacc[0]; + answ = !rigaMacc.hasCounter; + } + } + catch + { } + return answ; + } + } /// /// Nuovo num pz per pallet /// @@ -433,20 +466,8 @@ namespace MoonPro_site.WebUserControls set { txtNewPzPallet.Text = value.ToString(); - // verifico SE sia editabile... - bool nPzEnab = false; - try - { - DS_ProdTempi.DatiMacchineDataTable tabDatiMacc = DataLayerObj.taDatiMacchine.getByIdx(idxMaccEdit); - if (tabDatiMacc != null && tabDatiMacc.Count > 0) - { - DS_ProdTempi.DatiMacchineRow rigaMacc = tabDatiMacc[0]; - nPzEnab = !rigaMacc.hasCounter; - } - } - catch - { } - txtNewPzPallet.Enabled = nPzEnab; + // verifico SE sia editabile... e visualizzo di conseguenza + txtNewPzPallet.Enabled = numPzEditable; } } protected void btnCancel_Click(object sender, EventArgs e) diff --git a/MapoDb/DS_ProdTempi.xsd b/MapoDb/DS_ProdTempi.xsd index 8200018e..31631391 100644 --- a/MapoDb/DS_ProdTempi.xsd +++ b/MapoDb/DS_ProdTempi.xsd @@ -192,6 +192,18 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile + + + + dbo.stp_TC_fixFromODL + + + + + + + + diff --git a/MapoDb/DS_ProdTempi.xss b/MapoDb/DS_ProdTempi.xss index 3da72408..17698765 100644 --- a/MapoDb/DS_ProdTempi.xss +++ b/MapoDb/DS_ProdTempi.xss @@ -6,29 +6,29 @@ --> - - - + + + - + - - + + - + - - - - - + + + + + - - - + + + - + \ No newline at end of file diff --git a/MapoDb/DS_ProdTempi1.Designer.cs b/MapoDb/DS_ProdTempi1.Designer.cs index f7ab1876..5d3ebed0 100644 --- a/MapoDb/DS_ProdTempi1.Designer.cs +++ b/MapoDb/DS_ProdTempi1.Designer.cs @@ -16284,7 +16284,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [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[10]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[11]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM dbo.TempiCicloR" + @@ -16368,6 +16368,13 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Inizio", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Fine", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[10] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[10].Connection = this.Connection; + this._commandCollection[10].CommandText = "dbo.stp_TC_fixFromODL"; + this._commandCollection[10].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[10].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[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxODL", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PzMaxFix", 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()] @@ -16867,6 +16874,40 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile return ((object)(returnValue)); } } + + [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")] + public virtual int TC_fixFromODL(global::System.Nullable IdxODL, global::System.Nullable PzMaxFix) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[10]; + if ((IdxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(IdxODL.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((PzMaxFix.HasValue == true)) { + command.Parameters[2].Value = ((int)(PzMaxFix.Value)); + } + else { + command.Parameters[2].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; + } } ///