diff --git a/MP-TAB/WebUserControls/mod_ODL.ascx.cs b/MP-TAB/WebUserControls/mod_ODL.ascx.cs index f2cd01f6..5405938a 100644 --- a/MP-TAB/WebUserControls/mod_ODL.ascx.cs +++ b/MP-TAB/WebUserControls/mod_ODL.ascx.cs @@ -314,41 +314,41 @@ namespace MoonProTablet.WebUserControls { confermaProdOdl(false); if (idxODLSel > 0) - { + { // se vedesse TCRich a zero lo reimposta a quello assegnato... + if (TCRichAttr == 0) + { + TCRichAttr = TCAssegnato(idxODLSel); + } + // splitto VECCHIO ODL (se è rimasto qualcosa da produrre e se ce ne è rimasto uno.......) + int idxODL = 0; + try + { + idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL; + DataLayer.obj.taODL.splitODL(idxODL, idxMacchina, TCAssegnato(idxODL), string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false); + } + catch + { } // 2018.07.24 verifico se devo lavorare come ODL classico o come RPO (Richiesta / Promessa / ODL) if (EnableRPO) { - + // creo nuovo ODL da promessa ed associo + DataLayer.obj.taODL.inizioSetupPromessa(idxODLSel, idxMacchina, TCRichAttr, txtNote.Text); } // ODL classico else { - // se vedesse TCRich a zero lo reimposta a quello assegnato... - if (TCRichAttr == 0) - { - TCRichAttr = TCAssegnato(idxODLSel); - } - // splitto VECCHIO ODL (se è rimasto qualcosa da produrre e se ce ne è rimasto uno.......) - int idxODL = 0; - try - { - idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL; - DataLayer.obj.taODL.splitODL(idxODL, idxMacchina, TCAssegnato(idxODL), string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false); - } - catch - { } // avvio NUOVO ODL DataLayer.obj.taODL.inizioSetup(idxODLSel, idxMacchina, TCRichAttr, txtNote.Text); - // process evento - int idxEvento = 2; // !!!HARD CODED - processaEvento(idxEvento, String.Format("Registrata inizio attrezzaggio per ODL {0}", idxODLSel), idxODLSel); - // resetto contapezzi redis... - DataLayer.saveCounter(idxMacchina, "0"); - // imposto ODL su redis... - DataLayer.saveCurrODL(idxMacchina, idxODLSel.ToString()); - // ricarico... - Response.Redirect("~/ODL.aspx"); } + // process evento + int idxEvento = 2; // !!!HARD CODED + processaEvento(idxEvento, String.Format("Registrata inizio attrezzaggio per ODL {0}", idxODLSel), idxODLSel); + // resetto contapezzi redis... + DataLayer.saveCounter(idxMacchina, "0"); + // imposto ODL su redis... + DataLayer.saveCurrODL(idxMacchina, idxODLSel.ToString()); + // ricarico... + Response.Redirect("~/ODL"); } else { diff --git a/MapoDb/DS_ProdTempi.Designer.cs b/MapoDb/DS_ProdTempi.Designer.cs index 40d83911..d490c7a4 100644 --- a/MapoDb/DS_ProdTempi.Designer.cs +++ b/MapoDb/DS_ProdTempi.Designer.cs @@ -15636,7 +15636,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [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[20]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[21]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT * FROM dbo.v_ODL_exp\r\nORDER BY idxODL DESC"; @@ -15726,73 +15726,82 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile this._commandCollection[12].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[13] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[13].Connection = this.Connection; - this._commandCollection[13].CommandText = "dbo.stp_ODL_insertProvv"; + this._commandCollection[13].CommandText = "dbo.stp_ODL_inizioSetupPromessa"; this._commandCollection[13].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[13].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[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxPromessa", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[13].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[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCAssegnato", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCRichAttr", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[14] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[14].Connection = this.Connection; - this._commandCollection[14].CommandText = "dbo.stp_ODL_insertQuery"; + this._commandCollection[14].CommandText = "dbo.stp_ODL_insertProvv"; this._commandCollection[14].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[14].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[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[14].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[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCAssegnato", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PzPallet", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ToAs400", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CommessaAs400", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[15] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[15].Connection = this.Connection; - this._commandCollection[15].CommandText = "dbo.stp_ODL_insPostumo"; + this._commandCollection[15].CommandText = "dbo.stp_ODL_insertQuery"; this._commandCollection[15].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[15].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[15].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[15].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[15].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[15].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[15].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCAssegnato", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[15].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PzPallet", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[15].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ToAs400", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[15].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CommessaAs400", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[16] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[16].Connection = this.Connection; - this._commandCollection[16].CommandText = "dbo.stp_ODL_split"; + this._commandCollection[16].CommandText = "dbo.stp_ODL_insPostumo"; this._commandCollection[16].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[16].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[16].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[16].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[16].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCRichAttr", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[16].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[16].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@StartNewOdl", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[17] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[17].Connection = this.Connection; - this._commandCollection[17].CommandText = "dbo.stp_ODL_updateQta"; + this._commandCollection[17].CommandText = "dbo.stp_ODL_split"; this._commandCollection[17].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[17].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[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PzPallet", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxODL", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[17].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[17].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[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCRichAttr", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@StartNewOdl", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[18] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[18].Connection = this.Connection; - this._commandCollection[18].CommandText = "dbo.stp_ODL_update"; + this._commandCollection[18].CommandText = "dbo.stp_ODL_updateQta"; this._commandCollection[18].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[18].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[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[18].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[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCAssegnato", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PzPallet", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DataInizio", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DataFine", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxODL", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[19] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[19].Connection = this.Connection; - this._commandCollection[19].CommandText = "dbo.stp_ODL_updateSetup"; + this._commandCollection[19].CommandText = "dbo.stp_ODL_update"; this._commandCollection[19].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[19].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[19].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[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCRichAttr", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].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[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCAssegnato", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PzPallet", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DataInizio", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DataFine", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxODL", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[20] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[20].Connection = this.Connection; + this._commandCollection[20].CommandText = "dbo.stp_ODL_updateSetup"; + this._commandCollection[20].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[20].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[20].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[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCRichAttr", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 8, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -16138,8 +16147,54 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [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")] - public virtual int insertProvv(string CodArticolo, string IdxMacchina, global::System.Nullable NumPezzi, global::System.Nullable TCAssegnato, string Note) { + public virtual int inizioSetupPromessa(global::System.Nullable idxPromessa, string IdxMacchina, global::System.Nullable TCRichAttr, string Note) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[13]; + if ((idxPromessa.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxPromessa.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((IdxMacchina == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(IdxMacchina)); + } + if ((TCRichAttr.HasValue == true)) { + command.Parameters[3].Value = ((decimal)(TCRichAttr.Value)); + } + else { + command.Parameters[3].Value = global::System.DBNull.Value; + } + if ((Note == null)) { + command.Parameters[4].Value = global::System.DBNull.Value; + } + else { + command.Parameters[4].Value = ((string)(Note)); + } + 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", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int insertProvv(string CodArticolo, string IdxMacchina, global::System.Nullable NumPezzi, global::System.Nullable TCAssegnato, string Note) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[14]; if ((CodArticolo == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -16192,7 +16247,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, false)] public virtual int InsertQuery(string CodArticolo, string IdxMacchina, global::System.Nullable NumPezzi, global::System.Nullable TCAssegnato, global::System.Nullable PzPallet, global::System.Nullable ToAs400, string CommessaAs400) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[14]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[15]; if ((CodArticolo == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -16256,7 +16311,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int insPostumo(global::System.Nullable idxODL, string IdxMacchina) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[15]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[16]; if ((idxODL.HasValue == true)) { command.Parameters[1].Value = ((int)(idxODL.Value)); } @@ -16290,7 +16345,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int splitODL(global::System.Nullable idxODL, string IdxMacchina, global::System.Nullable TCRichAttr, string Note, global::System.Nullable StartNewOdl) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[16]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[17]; if ((idxODL.HasValue == true)) { command.Parameters[1].Value = ((int)(idxODL.Value)); } @@ -16342,7 +16397,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateQta(global::System.Nullable NumPezzi, global::System.Nullable PzPallet, global::System.Nullable Original_IdxODL) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[17]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[18]; if ((NumPezzi.HasValue == true)) { command.Parameters[1].Value = ((int)(NumPezzi.Value)); } @@ -16383,7 +16438,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, false)] public virtual int UpdateQuery(string CodArticolo, string IdxMacchina, global::System.Nullable NumPezzi, global::System.Nullable TCAssegnato, global::System.Nullable PzPallet, global::System.Nullable DataInizio, global::System.Nullable DataFine, string Note, global::System.Nullable Original_IdxODL) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[18]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[19]; if ((CodArticolo == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -16459,7 +16514,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateSetup(global::System.Nullable idxODL, global::System.Nullable TCRichAttr, string Note) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[19]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[20]; if ((idxODL.HasValue == true)) { command.Parameters[1].Value = ((int)(idxODL.Value)); } diff --git a/MapoDb/DS_ProdTempi.xsd b/MapoDb/DS_ProdTempi.xsd index e78b34db..58f12241 100644 --- a/MapoDb/DS_ProdTempi.xsd +++ b/MapoDb/DS_ProdTempi.xsd @@ -326,6 +326,20 @@ ORDER BY idxODL DESC + + + + dbo.stp_ODL_inizioSetupPromessa + + + + + + + + + +