diff --git a/MapoDb/DS_ProdTempi.xsd b/MapoDb/DS_ProdTempi.xsd index 23ba3ea8..93caa041 100644 --- a/MapoDb/DS_ProdTempi.xsd +++ b/MapoDb/DS_ProdTempi.xsd @@ -255,6 +255,25 @@ FROM v_ODL_exp ORDER BY IdxODL DESC + + + + dbo.stp_ODL_AutoStart + + + + + + + + + + + + + + + @@ -537,7 +556,6 @@ FROM v_ODL_exp ORDER BY IdxODL DESC - @@ -2947,7 +2965,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3028,7 +3046,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3040,7 +3058,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3065,7 +3083,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3103,7 +3121,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3142,7 +3160,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3208,7 +3226,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3285,7 +3303,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3320,7 +3338,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + @@ -3342,7 +3360,7 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + diff --git a/MapoDb/DS_ProdTempi.xss b/MapoDb/DS_ProdTempi.xss index 50df6368..622a43e8 100644 --- a/MapoDb/DS_ProdTempi.xss +++ b/MapoDb/DS_ProdTempi.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + diff --git a/MapoDb/DS_ProdTempi1.Designer.cs b/MapoDb/DS_ProdTempi1.Designer.cs index fad6a767..1ba4365e 100644 --- a/MapoDb/DS_ProdTempi1.Designer.cs +++ b/MapoDb/DS_ProdTempi1.Designer.cs @@ -17519,7 +17519,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[27]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[28]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT *\r\nFROM v_ODL_exp ORDER BY IdxODL DESC"; @@ -17535,77 +17535,83 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Approvato", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_ODL_clearSetup"; + this._commandCollection[2].CommandText = "dbo.stp_ODL_AutoStart"; this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; 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[2].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[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2].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[2].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[2].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[2].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[2].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[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtyRich", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@KeyRichiesta", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_ODL_deleteQuery"; + this._commandCollection[3].CommandText = "dbo.stp_ODL_clearSetup"; 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("@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[3].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[3].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[4] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[4].Connection = this.Connection; - this._commandCollection[4].CommandText = "dbo.stp_ODL_dividiDaAltraTav"; + this._commandCollection[4].CommandText = "dbo.stp_ODL_deleteQuery"; 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("@idxODL", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchinaTo", 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("@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[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; - this._commandCollection[5].CommandText = "dbo.stp_ODL_fineProd"; + this._commandCollection[5].CommandText = "dbo.stp_ODL_dividiDaAltraTav"; 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("@idxODL", 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("@IdxMacchina", 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("@MatrOpr", 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("@IdxMacchinaTo", 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_ODL_fixMachineSlave"; + this._commandCollection[6].CommandText = "dbo.stp_ODL_fineProd"; 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("@idxODL", 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("@IdxMacchina", 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("@NumDayPrev", 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("@DoInsert", 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_ODL_getByCodArt"; + this._commandCollection[7].CommandText = "dbo.stp_ODL_fixMachineSlave"; 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("@CodArticolo", 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("@IdxMacchina", 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("@NumDayPrev", 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("@DoInsert", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, 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_ODL_getByIdx"; + this._commandCollection[8].CommandText = "dbo.stp_ODL_getByCodArt"; 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("@IdxODL", 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("@onlyUnused", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].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[9] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[9].Connection = this.Connection; - this._commandCollection[9].CommandText = "dbo.stp_ODL_getByMacchina"; + this._commandCollection[9].CommandText = "dbo.stp_ODL_getByIdx"; this._commandCollection[9].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[9].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[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("@IdxODL", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@onlyUnused", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, 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_ODL_getByMacchinaCodArt"; + this._commandCollection[10].CommandText = "dbo.stp_ODL_getByMacchina"; 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("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[10].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[11] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[11].Connection = this.Connection; - this._commandCollection[11].CommandText = "dbo.stp_ODL_getByMacchinaPeriodo"; + this._commandCollection[11].CommandText = "dbo.stp_ODL_getByMacchinaCodArt"; this._commandCollection[11].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[11].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[11].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[11].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[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[12] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[12].Connection = this.Connection; - this._commandCollection[12].CommandText = "dbo.stp_ODL_getByMacchinaPeriodoNoNull"; + this._commandCollection[12].CommandText = "dbo.stp_ODL_getByMacchinaPeriodo"; this._commandCollection[12].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[12].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[12].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, "", "", "")); @@ -17613,39 +17619,36 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile this._commandCollection[12].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, 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_getLastByMacchina"; + this._commandCollection[13].CommandText = "dbo.stp_ODL_getByMacchinaPeriodoNoNull"; 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("@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("@dataFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, 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_getLastByMacchinaNum"; + this._commandCollection[14].CommandText = "dbo.stp_ODL_getLastByMacchina"; 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("@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("@numRec", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_needAppr"; + this._commandCollection[15].CommandText = "dbo.stp_ODL_getLastByMacchinaNum"; 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("@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("@numRec", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_inizioSetup"; + this._commandCollection[16].CommandText = "dbo.stp_ODL_needAppr"; 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("@MatrOpr", 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("@PzPallet", 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("@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] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[17].Connection = this.Connection; - this._commandCollection[17].CommandText = "dbo.stp_ODL_inizioSetupPromessa"; + this._commandCollection[17].CommandText = "dbo.stp_ODL_inizioSetup"; 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("@idxPromessa", 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("@MatrOpr", 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, "", "", "")); @@ -17653,26 +17656,26 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile 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[18] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[18].Connection = this.Connection; - this._commandCollection[18].CommandText = "dbo.stp_ODL_inizioSetupPromessaPostuma"; + this._commandCollection[18].CommandText = "dbo.stp_ODL_inizioSetupPromessa"; 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("@idxPromessa", 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("@MatrOpr", 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("@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("@TCRichAttr", 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("@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] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[19].Connection = this.Connection; - this._commandCollection[19].CommandText = "dbo.stp_ODL_insertProvv"; + this._commandCollection[19].CommandText = "dbo.stp_ODL_inizioSetupPromessaPostuma"; 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("@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("@idxPromessa", 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("@MatrOpr", 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("@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("@Note", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 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_insertQuery"; + this._commandCollection[20].CommandText = "dbo.stp_ODL_insertProvv"; 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("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); @@ -17680,69 +17683,79 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile this._commandCollection[20].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[20].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[20].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[20].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[20].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[20].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[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, "", "", "")); this._commandCollection[21] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[21].Connection = this.Connection; - this._commandCollection[21].CommandText = "dbo.stp_ODL_insPostumo"; + this._commandCollection[21].CommandText = "dbo.stp_ODL_insertQuery"; this._commandCollection[21].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[21].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[21].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[21].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[21].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[21].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[21].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[21].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[21].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[21].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[21].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[22] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[22].Connection = this.Connection; - this._commandCollection[22].CommandText = "dbo.stp_ODL_reopenOdlMacc"; + this._commandCollection[22].CommandText = "dbo.stp_ODL_insPostumo"; this._commandCollection[22].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[22].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[22].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[22].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[23] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[23].Connection = this.Connection; - this._commandCollection[23].CommandText = "dbo.stp_ODL_split"; + this._commandCollection[23].CommandText = "dbo.stp_ODL_reopenOdlMacc"; this._commandCollection[23].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[23].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[23].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[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[23].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[23].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[23].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[23].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[23].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[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtyRich", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@KeyRichiesta", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[24] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[24].Connection = this.Connection; - this._commandCollection[24].CommandText = "dbo.stp_ODL_updateQta"; + this._commandCollection[24].CommandText = "dbo.stp_ODL_split"; this._commandCollection[24].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[24].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[24].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[24].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[24].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[24].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[24].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[24].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[24].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[24].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[24].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[24].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtyRich", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[25] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[25].Connection = this.Connection; - this._commandCollection[25].CommandText = "dbo.stp_ODL_update"; + this._commandCollection[25].CommandText = "dbo.stp_ODL_updateQta"; this._commandCollection[25].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[25].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[25].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[25].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[25].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[25].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[25].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[25].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[25].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[25].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[25].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[25].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[26] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[26].Connection = this.Connection; - this._commandCollection[26].CommandText = "dbo.stp_ODL_updateSetup"; + this._commandCollection[26].CommandText = "dbo.stp_ODL_update"; this._commandCollection[26].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[26].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[26].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[26].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[26].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[26].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[26].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[26].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[26].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[26].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[26].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[26].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[26].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[26].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[27] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[27].Connection = this.Connection; + this._commandCollection[27].CommandText = "dbo.stp_ODL_updateSetup"; + this._commandCollection[27].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[27].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[27].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[27].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[27].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[27].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[27].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()] @@ -17774,7 +17787,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.Select, false)] public virtual DS_ProdTempi.ODLDataTable getByCodArt(string CodArticolo) { - this.Adapter.SelectCommand = this.CommandCollection[7]; + this.Adapter.SelectCommand = this.CommandCollection[8]; if ((CodArticolo == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -17791,7 +17804,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.Select, false)] public virtual DS_ProdTempi.ODLDataTable getByIdx(global::System.Nullable IdxODL, global::System.Nullable onlyUnused) { - this.Adapter.SelectCommand = this.CommandCollection[8]; + this.Adapter.SelectCommand = this.CommandCollection[9]; if ((IdxODL.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(IdxODL.Value)); } @@ -17814,7 +17827,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.Select, false)] public virtual DS_ProdTempi.ODLDataTable getByMacchina(string IdxMacchina) { - this.Adapter.SelectCommand = this.CommandCollection[9]; + this.Adapter.SelectCommand = this.CommandCollection[10]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -17831,7 +17844,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.Select, false)] public virtual DS_ProdTempi.ODLDataTable getByMacchinaArticolo(string CodArticolo, string IdxMacchina) { - this.Adapter.SelectCommand = this.CommandCollection[10]; + this.Adapter.SelectCommand = this.CommandCollection[11]; if ((CodArticolo == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -17854,35 +17867,6 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_ProdTempi.ODLDataTable getByMacchinaPeriodo(string IdxMacchina, global::System.Nullable dataFrom, global::System.Nullable dataTo) { - this.Adapter.SelectCommand = this.CommandCollection[11]; - if ((IdxMacchina == null)) { - this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; - } - else { - this.Adapter.SelectCommand.Parameters[1].Value = ((string)(IdxMacchina)); - } - if ((dataFrom.HasValue == true)) { - this.Adapter.SelectCommand.Parameters[2].Value = ((System.DateTime)(dataFrom.Value)); - } - else { - this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; - } - if ((dataTo.HasValue == true)) { - this.Adapter.SelectCommand.Parameters[3].Value = ((System.DateTime)(dataTo.Value)); - } - else { - this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; - } - DS_ProdTempi.ODLDataTable dataTable = new DS_ProdTempi.ODLDataTable(); - 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_ProdTempi.ODLDataTable getByMacchinaPeriodoNoNull(string IdxMacchina, global::System.Nullable dataFrom, global::System.Nullable dataTo) { this.Adapter.SelectCommand = this.CommandCollection[12]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; @@ -17911,7 +17895,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [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_ProdTempi.ODLDataTable getLastByMacc(string IdxMacchina) { + public virtual DS_ProdTempi.ODLDataTable getByMacchinaPeriodoNoNull(string IdxMacchina, global::System.Nullable dataFrom, global::System.Nullable dataTo) { this.Adapter.SelectCommand = this.CommandCollection[13]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; @@ -17919,6 +17903,35 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile else { this.Adapter.SelectCommand.Parameters[1].Value = ((string)(IdxMacchina)); } + if ((dataFrom.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[2].Value = ((System.DateTime)(dataFrom.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + if ((dataTo.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[3].Value = ((System.DateTime)(dataTo.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; + } + DS_ProdTempi.ODLDataTable dataTable = new DS_ProdTempi.ODLDataTable(); + 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_ProdTempi.ODLDataTable getLastByMacc(string IdxMacchina) { + this.Adapter.SelectCommand = this.CommandCollection[14]; + if ((IdxMacchina == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(IdxMacchina)); + } DS_ProdTempi.ODLDataTable dataTable = new DS_ProdTempi.ODLDataTable(); this.Adapter.Fill(dataTable); return dataTable; @@ -17929,7 +17942,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.Select, false)] public virtual DS_ProdTempi.ODLDataTable getLastByMaccNum(string IdxMacchina, global::System.Nullable numRec) { - this.Adapter.SelectCommand = this.CommandCollection[14]; + this.Adapter.SelectCommand = this.CommandCollection[15]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -17952,7 +17965,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.Select, false)] public virtual DS_ProdTempi.ODLDataTable getNeedAppr() { - this.Adapter.SelectCommand = this.CommandCollection[15]; + this.Adapter.SelectCommand = this.CommandCollection[16]; DS_ProdTempi.ODLDataTable dataTable = new DS_ProdTempi.ODLDataTable(); this.Adapter.Fill(dataTable); return dataTable; @@ -17963,7 +17976,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.Select, false)] public virtual DS_ProdTempi.ODLDataTable reopenGetLast(string IdxMacchina) { - this.Adapter.SelectCommand = this.CommandCollection[22]; + this.Adapter.SelectCommand = this.CommandCollection[23]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -18024,7 +18037,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")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int clearSetup(global::System.Nullable idxODL, string IdxMacchina) { + public virtual int autoStart(global::System.Nullable idxODL, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note, global::System.Nullable StartNewOdl, global::System.Nullable QtyRich, string KeyRichiesta) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; if ((idxODL.HasValue == true)) { command.Parameters[1].Value = ((int)(idxODL.Value)); @@ -18032,502 +18045,6 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile 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)); - } - 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, false)] - public virtual int DeleteQuery(global::System.Nullable Original_IdxODL) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; - if ((Original_IdxODL.HasValue == true)) { - command.Parameters[1].Value = ((int)(Original_IdxODL.Value)); - } - else { - command.Parameters[1].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; - } - - [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 dividiDaAltraTav(global::System.Nullable idxODL, global::System.Nullable MatrOpr, string IdxMacchinaTo) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; - if ((idxODL.HasValue == true)) { - command.Parameters[1].Value = ((int)(idxODL.Value)); - } - else { - command.Parameters[1].Value = global::System.DBNull.Value; - } - if ((MatrOpr.HasValue == true)) { - command.Parameters[2].Value = ((int)(MatrOpr.Value)); - } - else { - command.Parameters[2].Value = global::System.DBNull.Value; - } - if ((IdxMacchinaTo == null)) { - command.Parameters[3].Value = global::System.DBNull.Value; - } - else { - command.Parameters[3].Value = ((string)(IdxMacchinaTo)); - } - 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int fineProd(global::System.Nullable idxODL, string IdxMacchina) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; - if ((idxODL.HasValue == true)) { - command.Parameters[1].Value = ((int)(idxODL.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)); - } - 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int fixMachineSlave(string IdxMacchina, global::System.Nullable NumDayPrev, global::System.Nullable DoInsert) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; - if ((IdxMacchina == null)) { - command.Parameters[1].Value = global::System.DBNull.Value; - } - else { - command.Parameters[1].Value = ((string)(IdxMacchina)); - } - if ((NumDayPrev.HasValue == true)) { - command.Parameters[2].Value = ((int)(NumDayPrev.Value)); - } - else { - command.Parameters[2].Value = global::System.DBNull.Value; - } - if ((DoInsert.HasValue == true)) { - command.Parameters[3].Value = ((int)(DoInsert.Value)); - } - else { - command.Parameters[3].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; - } - - [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 inizioSetup(global::System.Nullable idxODL, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[16]; - if ((idxODL.HasValue == true)) { - command.Parameters[1].Value = ((int)(idxODL.Value)); - } - else { - command.Parameters[1].Value = global::System.DBNull.Value; - } - if ((MatrOpr.HasValue == true)) { - command.Parameters[2].Value = ((int)(MatrOpr.Value)); - } - else { - command.Parameters[2].Value = global::System.DBNull.Value; - } - if ((IdxMacchina == null)) { - command.Parameters[3].Value = global::System.DBNull.Value; - } - else { - command.Parameters[3].Value = ((string)(IdxMacchina)); - } - if ((TCRichAttr.HasValue == true)) { - command.Parameters[4].Value = ((decimal)(TCRichAttr.Value)); - } - else { - command.Parameters[4].Value = global::System.DBNull.Value; - } - if ((PzPallet.HasValue == true)) { - command.Parameters[5].Value = ((int)(PzPallet.Value)); - } - else { - command.Parameters[5].Value = global::System.DBNull.Value; - } - if ((Note == null)) { - command.Parameters[6].Value = global::System.DBNull.Value; - } - else { - command.Parameters[6].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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int inizioSetupPromessa(global::System.Nullable idxPromessa, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[17]; - if ((idxPromessa.HasValue == true)) { - command.Parameters[1].Value = ((int)(idxPromessa.Value)); - } - else { - command.Parameters[1].Value = global::System.DBNull.Value; - } - if ((MatrOpr.HasValue == true)) { - command.Parameters[2].Value = ((int)(MatrOpr.Value)); - } - else { - command.Parameters[2].Value = global::System.DBNull.Value; - } - if ((IdxMacchina == null)) { - command.Parameters[3].Value = global::System.DBNull.Value; - } - else { - command.Parameters[3].Value = ((string)(IdxMacchina)); - } - if ((TCRichAttr.HasValue == true)) { - command.Parameters[4].Value = ((decimal)(TCRichAttr.Value)); - } - else { - command.Parameters[4].Value = global::System.DBNull.Value; - } - if ((PzPallet.HasValue == true)) { - command.Parameters[5].Value = ((int)(PzPallet.Value)); - } - else { - command.Parameters[5].Value = global::System.DBNull.Value; - } - if ((Note == null)) { - command.Parameters[6].Value = global::System.DBNull.Value; - } - else { - command.Parameters[6].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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int inizioSetupPromessaPostuma(global::System.Nullable idxPromessa, global::System.Nullable MatrOpr, string IdxMacchina) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[18]; - if ((idxPromessa.HasValue == true)) { - command.Parameters[1].Value = ((int)(idxPromessa.Value)); - } - else { - command.Parameters[1].Value = global::System.DBNull.Value; - } - if ((MatrOpr.HasValue == true)) { - command.Parameters[2].Value = ((int)(MatrOpr.Value)); - } - else { - command.Parameters[2].Value = global::System.DBNull.Value; - } - if ((IdxMacchina == null)) { - command.Parameters[3].Value = global::System.DBNull.Value; - } - else { - command.Parameters[3].Value = ((string)(IdxMacchina)); - } - 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int insertProvv(string CodArticolo, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable NumPezzi, global::System.Nullable TCAssegnato, string Note) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[19]; - if ((CodArticolo == null)) { - command.Parameters[1].Value = global::System.DBNull.Value; - } - else { - command.Parameters[1].Value = ((string)(CodArticolo)); - } - if ((MatrOpr.HasValue == true)) { - command.Parameters[2].Value = ((int)(MatrOpr.Value)); - } - else { - command.Parameters[2].Value = global::System.DBNull.Value; - } - if ((IdxMacchina == null)) { - command.Parameters[3].Value = global::System.DBNull.Value; - } - else { - command.Parameters[3].Value = ((string)(IdxMacchina)); - } - if ((NumPezzi.HasValue == true)) { - command.Parameters[4].Value = ((int)(NumPezzi.Value)); - } - else { - command.Parameters[4].Value = global::System.DBNull.Value; - } - if ((TCAssegnato.HasValue == true)) { - command.Parameters[5].Value = ((decimal)(TCAssegnato.Value)); - } - else { - command.Parameters[5].Value = global::System.DBNull.Value; - } - if ((Note == null)) { - command.Parameters[6].Value = global::System.DBNull.Value; - } - else { - command.Parameters[6].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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, false)] - public virtual int InsertQuery(string CodArticolo, global::System.Nullable MatrOpr, 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[20]; - if ((CodArticolo == null)) { - command.Parameters[1].Value = global::System.DBNull.Value; - } - else { - command.Parameters[1].Value = ((string)(CodArticolo)); - } - if ((MatrOpr.HasValue == true)) { - command.Parameters[2].Value = ((int)(MatrOpr.Value)); - } - else { - command.Parameters[2].Value = global::System.DBNull.Value; - } - if ((IdxMacchina == null)) { - command.Parameters[3].Value = global::System.DBNull.Value; - } - else { - command.Parameters[3].Value = ((string)(IdxMacchina)); - } - if ((NumPezzi.HasValue == true)) { - command.Parameters[4].Value = ((int)(NumPezzi.Value)); - } - else { - command.Parameters[4].Value = global::System.DBNull.Value; - } - if ((TCAssegnato.HasValue == true)) { - command.Parameters[5].Value = ((decimal)(TCAssegnato.Value)); - } - else { - command.Parameters[5].Value = global::System.DBNull.Value; - } - if ((PzPallet.HasValue == true)) { - command.Parameters[6].Value = ((int)(PzPallet.Value)); - } - else { - command.Parameters[6].Value = global::System.DBNull.Value; - } - if ((ToAs400.HasValue == true)) { - command.Parameters[7].Value = ((bool)(ToAs400.Value)); - } - else { - command.Parameters[7].Value = global::System.DBNull.Value; - } - if ((CommessaAs400 == null)) { - command.Parameters[8].Value = global::System.DBNull.Value; - } - else { - command.Parameters[8].Value = ((string)(CommessaAs400)); - } - 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", "16.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[21]; - if ((idxODL.HasValue == true)) { - command.Parameters[1].Value = ((int)(idxODL.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)); - } - 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int splitODL(global::System.Nullable idxODL, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note, global::System.Nullable StartNewOdl, global::System.Nullable QtyRich, string KeyRichiesta) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[23]; - if ((idxODL.HasValue == true)) { - command.Parameters[1].Value = ((int)(idxODL.Value)); - } - else { - command.Parameters[1].Value = global::System.DBNull.Value; - } if ((MatrOpr.HasValue == true)) { command.Parameters[2].Value = ((int)(MatrOpr.Value)); } @@ -18596,8 +18113,574 @@ 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")] [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) { + public virtual int clearSetup(global::System.Nullable idxODL, string IdxMacchina) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + if ((idxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxODL.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)); + } + 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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, false)] + public virtual int DeleteQuery(global::System.Nullable Original_IdxODL) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; + if ((Original_IdxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(Original_IdxODL.Value)); + } + else { + command.Parameters[1].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; + } + + [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 dividiDaAltraTav(global::System.Nullable idxODL, global::System.Nullable MatrOpr, string IdxMacchinaTo) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; + if ((idxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxODL.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((MatrOpr.HasValue == true)) { + command.Parameters[2].Value = ((int)(MatrOpr.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((IdxMacchinaTo == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(IdxMacchinaTo)); + } + 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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int fineProd(global::System.Nullable idxODL, string IdxMacchina) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; + if ((idxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxODL.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)); + } + 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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int fixMachineSlave(string IdxMacchina, global::System.Nullable NumDayPrev, global::System.Nullable DoInsert) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; + if ((IdxMacchina == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(IdxMacchina)); + } + if ((NumDayPrev.HasValue == true)) { + command.Parameters[2].Value = ((int)(NumDayPrev.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((DoInsert.HasValue == true)) { + command.Parameters[3].Value = ((int)(DoInsert.Value)); + } + else { + command.Parameters[3].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; + } + + [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 inizioSetup(global::System.Nullable idxODL, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[17]; + if ((idxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxODL.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((MatrOpr.HasValue == true)) { + command.Parameters[2].Value = ((int)(MatrOpr.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((IdxMacchina == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(IdxMacchina)); + } + if ((TCRichAttr.HasValue == true)) { + command.Parameters[4].Value = ((decimal)(TCRichAttr.Value)); + } + else { + command.Parameters[4].Value = global::System.DBNull.Value; + } + if ((PzPallet.HasValue == true)) { + command.Parameters[5].Value = ((int)(PzPallet.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + if ((Note == null)) { + command.Parameters[6].Value = global::System.DBNull.Value; + } + else { + command.Parameters[6].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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int inizioSetupPromessa(global::System.Nullable idxPromessa, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[18]; + if ((idxPromessa.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxPromessa.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((MatrOpr.HasValue == true)) { + command.Parameters[2].Value = ((int)(MatrOpr.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((IdxMacchina == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(IdxMacchina)); + } + if ((TCRichAttr.HasValue == true)) { + command.Parameters[4].Value = ((decimal)(TCRichAttr.Value)); + } + else { + command.Parameters[4].Value = global::System.DBNull.Value; + } + if ((PzPallet.HasValue == true)) { + command.Parameters[5].Value = ((int)(PzPallet.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + if ((Note == null)) { + command.Parameters[6].Value = global::System.DBNull.Value; + } + else { + command.Parameters[6].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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int inizioSetupPromessaPostuma(global::System.Nullable idxPromessa, global::System.Nullable MatrOpr, string IdxMacchina) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[19]; + if ((idxPromessa.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxPromessa.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((MatrOpr.HasValue == true)) { + command.Parameters[2].Value = ((int)(MatrOpr.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((IdxMacchina == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(IdxMacchina)); + } + 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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int insertProvv(string CodArticolo, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable NumPezzi, global::System.Nullable TCAssegnato, string Note) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[20]; + if ((CodArticolo == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(CodArticolo)); + } + if ((MatrOpr.HasValue == true)) { + command.Parameters[2].Value = ((int)(MatrOpr.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((IdxMacchina == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(IdxMacchina)); + } + if ((NumPezzi.HasValue == true)) { + command.Parameters[4].Value = ((int)(NumPezzi.Value)); + } + else { + command.Parameters[4].Value = global::System.DBNull.Value; + } + if ((TCAssegnato.HasValue == true)) { + command.Parameters[5].Value = ((decimal)(TCAssegnato.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + if ((Note == null)) { + command.Parameters[6].Value = global::System.DBNull.Value; + } + else { + command.Parameters[6].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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, false)] + public virtual int InsertQuery(string CodArticolo, global::System.Nullable MatrOpr, 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[21]; + if ((CodArticolo == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(CodArticolo)); + } + if ((MatrOpr.HasValue == true)) { + command.Parameters[2].Value = ((int)(MatrOpr.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((IdxMacchina == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(IdxMacchina)); + } + if ((NumPezzi.HasValue == true)) { + command.Parameters[4].Value = ((int)(NumPezzi.Value)); + } + else { + command.Parameters[4].Value = global::System.DBNull.Value; + } + if ((TCAssegnato.HasValue == true)) { + command.Parameters[5].Value = ((decimal)(TCAssegnato.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + if ((PzPallet.HasValue == true)) { + command.Parameters[6].Value = ((int)(PzPallet.Value)); + } + else { + command.Parameters[6].Value = global::System.DBNull.Value; + } + if ((ToAs400.HasValue == true)) { + command.Parameters[7].Value = ((bool)(ToAs400.Value)); + } + else { + command.Parameters[7].Value = global::System.DBNull.Value; + } + if ((CommessaAs400 == null)) { + command.Parameters[8].Value = global::System.DBNull.Value; + } + else { + command.Parameters[8].Value = ((string)(CommessaAs400)); + } + 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", "16.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[22]; + if ((idxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxODL.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)); + } + 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", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int splitODL(global::System.Nullable idxODL, global::System.Nullable MatrOpr, string IdxMacchina, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note, global::System.Nullable StartNewOdl, global::System.Nullable QtyRich) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[24]; + if ((idxODL.HasValue == true)) { + command.Parameters[1].Value = ((int)(idxODL.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((MatrOpr.HasValue == true)) { + command.Parameters[2].Value = ((int)(MatrOpr.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((IdxMacchina == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(IdxMacchina)); + } + if ((TCRichAttr.HasValue == true)) { + command.Parameters[4].Value = ((decimal)(TCRichAttr.Value)); + } + else { + command.Parameters[4].Value = global::System.DBNull.Value; + } + if ((PzPallet.HasValue == true)) { + command.Parameters[5].Value = ((int)(PzPallet.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + if ((Note == null)) { + command.Parameters[6].Value = global::System.DBNull.Value; + } + else { + command.Parameters[6].Value = ((string)(Note)); + } + if ((StartNewOdl.HasValue == true)) { + command.Parameters[7].Value = ((bool)(StartNewOdl.Value)); + } + else { + command.Parameters[7].Value = global::System.DBNull.Value; + } + if ((QtyRich.HasValue == true)) { + command.Parameters[8].Value = ((int)(QtyRich.Value)); + } + else { + command.Parameters[8].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; + } + + [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 updateQta(global::System.Nullable NumPezzi, global::System.Nullable PzPallet, global::System.Nullable Original_IdxODL) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[25]; if ((NumPezzi.HasValue == true)) { command.Parameters[1].Value = ((int)(NumPezzi.Value)); } @@ -18638,7 +18721,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, global::System.Nullable MatrOpr, 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[25]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[26]; if ((CodArticolo == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -18720,7 +18803,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateSetup(global::System.Nullable idxODL, global::System.Nullable MatrOpr, global::System.Nullable TCRichAttr, global::System.Nullable PzPallet, string Note) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[26]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[27]; if ((idxODL.HasValue == true)) { command.Parameters[1].Value = ((int)(idxODL.Value)); } diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index a9679cc4..0a584efe 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -975,6 +975,162 @@ namespace MapoDb return answTab; } + /// + /// Effettua split ODL + /// + /// macchina + /// effettuare conferma qty + /// imposta la qty prox ODL da ODL che si chiude + /// STEP x cui arrotondare la quantità prox ODL (corrente come riferimento) + /// Cod ext da associare all'ODL + /// + public string AutoStartOdl(string idxMacchina, bool doConfirm, bool qtyFromLast, int roundStep = 100, string keyRichiesta = "") + { + string answ = "KO"; + // verifico NON CI SIA un veto a NUOVI split... 2 min di default... + string redKey = vetoSplitOdlMaccHash(idxMacchina); + string rawData = memLayer.ML.getRSV(redKey); + if (string.IsNullOrEmpty(rawData)) + { + // registro VETO x altri split... 5 minuti + memLayer.ML.setRSV(redKey, $"Inizio SPLIT-ODL {DateTime.Now}", 300); + // calcolo la qta da gestire + int qtyConf = 0; + int qtyNew = 0; + if (doConfirm) + { + DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd; + try + { + rigaProd = taPzProd2conf.GetData(idxMacchina)[0]; + qtyConf = rigaProd.pezziNonConfermati; + // calcolo nuovi pezzi da confermare + if (qtyFromLast) + { + roundStep = roundStep == 0 ? 1 : roundStep; + double ratio = (double)qtyConf / roundStep; + qtyNew = (int)Math.Round(Math.Ceiling(ratio) * roundStep, 0); + } + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}{1}{2}", idxMacchina, Environment.NewLine, exc), tipoLog.ERROR); + } + } + + // proseguo + DS_ProdTempi.ODLDataTable currData = null; + DateTime adesso = DateTime.Now; + // chiamo metodo redis/db... + try + { + // recupero ODL corrente + currData = currODLRowTab(idxMacchina); + if (currData.Count > 0) + { + // registro un evento di inizio attrezzaggio (idxTipoEv = 2) + int idxEvento = 2; + logger.lg.scriviLog($"Invio evento ODL-SPLIT per macchina {idxMacchina}, evento {idxEvento}, articolo {currData[0].CodArticolo}, qty confermata {qtyConf}, nuova qty {qtyNew}", tipoLog.INFO); + + inputComandoMapo resCmd = scriviRigaEventoBarcode(idxMacchina, idxEvento, currData[0].CodArticolo, "ODL-SPLIT", 0, "", adesso, adesso); + if (doConfirm) + { + // attendo 100 msec + Thread.Sleep(100); + adesso = DateTime.Now; + // chiamo conferma produzione... + try + { + string chiamata = confRett ? "confermaProdMacchinaFull" : "confermaProdMacchina"; + logger.lg.scriviLog($"Chiamata a {chiamata} con parametri {currData[0].IdxMacchina} |{MatrOpr} | {DateTime.Now.AddDays(-10)} | {DateTime.Now} | {qtyConf} | 0 | 1 | {DateTime.Now} | false", tipoLog.INFO); + string idxMacchinaSel = currData[0].IdxMacchina; + bool fatto = false; + if (confRett) + { + // confermo al netto dei pezzi lasciati... + fatto = confermaProdMacchinaFull(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, 0, adesso); + } + else + { + fatto = confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, adesso); + } + if (!fatto) + { + logger.lg.scriviLog($"ERRORE in chiamata {chiamata}", tipoLog.ERROR); + } + } + catch (Exception exc) + { + logger.lg.scriviLog($"Eccezione in ConfermaProduzione{Environment.NewLine}{exc}", tipoLog.EXCEPTION); + } + } + // attendo 100 msec + Thread.Sleep(100); + // chiamo splitOdl + MapoDbObj.taODL.autoStart(currData[0].IdxODL, 0, idxMacchina, currData[0].TCRichAttr, currData[0].PzPallet, $"Nuovo ODL da forceSplitOdl", true, qtyNew, keyRichiesta); + // elimino eventuale ODL precedente... + string rKey = memLayer.ML.redHash($"ODL:{idxMacchina}"); + memLayer.ML.setRSV(rKey, ""); + // ricalcola ODL macchina + var newOdl = currODL(idxMacchina, true); + // attendo 1000 msec + Thread.Sleep(1000); + adesso = DateTime.Now; + // registro fine ODL (idxTipoEv = 1) + idxEvento = 1; + logger.lg.scriviLog($"Invio evento FINE ODL-SPLIT per macchina {idxMacchina}, evento {idxEvento}, articolo {currData[0].CodArticolo}", tipoLog.INFO); + resCmd = scriviRigaEventoBarcode(idxMacchina, idxEvento, currData[0].CodArticolo, "ODL-START"); + // invio eventi setup a macchina.... + string setArtVal = $"{currData[0].CodArticolo}"; + string setPzCommVal = $"{qtyNew}"; + string setCommVal = $"ODL{newOdl}"; + if (!string.IsNullOrEmpty(keyRichiesta)) + { + setCommVal = $"{keyRichiesta} ODL{newOdl}"; + } + try + { + // invio task caricamento dati ODL + addTask4Machine(idxMacchina, taskType.setArt, setArtVal); + addTask4Machine(idxMacchina, taskType.setPzComm, setPzCommVal); + addTask4Machine(idxMacchina, taskType.setComm, setCommVal); + } + catch + { } + // chiamo refresh MSE + taMSE.forceRecalc(0, idxMacchina); + // resetto stato macchina... + memLayer.ML.redDelKey(currStatoMaccHash(idxMacchina)); + answ = "OK"; + logger.lg.scriviLog($"Effettuato reset e ricalcoli x split ODL per macchina {idxMacchina}", tipoLog.INFO); + // se è una master richiamo fix x child... + if (isMaster(idxMacchina)) + { + taODL.fixMachineSlave(idxMacchina, 30, 1); + // ciclo su ogni slave la gestione reinvio pezzi -->calcolo gli slave... + var slaveList = taM2S.getByMaster(idxMacchina); + foreach (var machine in slaveList) + { + // invio task caricamento dati ODL + addTask4Machine(machine.IdxMacchinaSlave, taskType.setArt, setArtVal); + addTask4Machine(machine.IdxMacchinaSlave, taskType.setPzComm, setPzCommVal); + addTask4Machine(machine.IdxMacchinaSlave, taskType.setComm, setCommVal); + } + } + } + } + catch (Exception exc) + { + logger.lg.scriviLog($"Eccezione in forceSplitOdl{Environment.NewLine}{exc}", tipoLog.EXCEPTION); + } + } + else + { + logger.lg.scriviLog($"VETO ATTIVO | Richiesto forceSplitOdl per impianto {idxMacchina} | impossibile procedere"); + } + return answ; + } + /// /// controlla se da il segnale di "microstato" deriva un evento da generare - modalità OFFLINE /// @@ -1533,162 +1689,6 @@ namespace MapoDb return fatto; } - /// - /// Effettua split ODL - /// - /// macchina - /// effettuare conferma qty - /// imposta la qty prox ODL da ODL che si chiude - /// STEP x cui arrotondare la quantità prox ODL (corrente come riferimento) - /// Cod ext da associare all'ODL - /// - public string forceSplitOdl(string idxMacchina, bool doConfirm, bool qtyFromLast, int roundStep = 100, string keyRichiesta = "") - { - string answ = "KO"; - // verifico NON CI SIA un veto a NUOVI split... 2 min di default... - string redKey = vetoSplitOdlMaccHash(idxMacchina); - string rawData = memLayer.ML.getRSV(redKey); - if (string.IsNullOrEmpty(rawData)) - { - // registro VETO x altri split... 5 minuti - memLayer.ML.setRSV(redKey, $"Inizio SPLIT-ODL {DateTime.Now}", 300); - // calcolo la qta da gestire - int qtyConf = 0; - int qtyNew = 0; - if (doConfirm) - { - DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd; - try - { - rigaProd = taPzProd2conf.GetData(idxMacchina)[0]; - qtyConf = rigaProd.pezziNonConfermati; - // calcolo nuovi pezzi da confermare - if (qtyFromLast) - { - roundStep = roundStep == 0 ? 1 : roundStep; - double ratio = (double)qtyConf / roundStep; - qtyNew = (int)Math.Round(Math.Ceiling(ratio) * roundStep, 0); - } - } - catch (Exception exc) - { - logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}{1}{2}", idxMacchina, Environment.NewLine, exc), tipoLog.ERROR); - } - } - - // proseguo - DS_ProdTempi.ODLDataTable currData = null; - DateTime adesso = DateTime.Now; - // chiamo metodo redis/db... - try - { - // recupero ODL corrente - currData = currODLRowTab(idxMacchina); - if (currData.Count > 0) - { - // registro un evento di inizio attrezzaggio (idxTipoEv = 2) - int idxEvento = 2; - logger.lg.scriviLog($"Invio evento ODL-SPLIT per macchina {idxMacchina}, evento {idxEvento}, articolo {currData[0].CodArticolo}, qty confermata {qtyConf}, nuova qty {qtyNew}", tipoLog.INFO); - - inputComandoMapo resCmd = scriviRigaEventoBarcode(idxMacchina, idxEvento, currData[0].CodArticolo, "ODL-SPLIT", 0, "", adesso, adesso); - if (doConfirm) - { - // attendo 100 msec - Thread.Sleep(100); - adesso = DateTime.Now; - // chiamo conferma produzione... - try - { - string chiamata = confRett ? "confermaProdMacchinaFull" : "confermaProdMacchina"; - logger.lg.scriviLog($"Chiamata a {chiamata} con parametri {currData[0].IdxMacchina} |{MatrOpr} | {DateTime.Now.AddDays(-10)} | {DateTime.Now} | {qtyConf} | 0 | 1 | {DateTime.Now} | false", tipoLog.INFO); - string idxMacchinaSel = currData[0].IdxMacchina; - bool fatto = false; - if (confRett) - { - // confermo al netto dei pezzi lasciati... - fatto = confermaProdMacchinaFull(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, 0, adesso); - } - else - { - fatto = confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, adesso); - } - if (!fatto) - { - logger.lg.scriviLog($"ERRORE in chiamata {chiamata}", tipoLog.ERROR); - } - } - catch (Exception exc) - { - logger.lg.scriviLog($"Eccezione in ConfermaProduzione{Environment.NewLine}{exc}", tipoLog.EXCEPTION); - } - } - // attendo 100 msec - Thread.Sleep(100); - // chiamo splitOdl - MapoDbObj.taODL.splitODL(currData[0].IdxODL, 0, idxMacchina, currData[0].TCRichAttr, currData[0].PzPallet, $"Nuovo ODL da forceSplitOdl", true, qtyNew, keyRichiesta); - // elimino eventuale ODL precedente... - string rKey = memLayer.ML.redHash($"ODL:{idxMacchina}"); - memLayer.ML.setRSV(rKey, ""); - // ricalcola ODL macchina - var newOdl = currODL(idxMacchina, true); - // attendo 1000 msec - Thread.Sleep(1000); - adesso = DateTime.Now; - // registro fine ODL (idxTipoEv = 1) - idxEvento = 1; - logger.lg.scriviLog($"Invio evento FINE ODL-SPLIT per macchina {idxMacchina}, evento {idxEvento}, articolo {currData[0].CodArticolo}", tipoLog.INFO); - resCmd = scriviRigaEventoBarcode(idxMacchina, idxEvento, currData[0].CodArticolo, "ODL-START"); - // invio eventi setup a macchina.... - string setArtVal = $"{currData[0].CodArticolo}"; - string setPzCommVal = $"{qtyNew}"; - string setCommVal = $"ODL{newOdl}"; - if (!string.IsNullOrEmpty(keyRichiesta)) - { - setCommVal = $"{keyRichiesta} ODL{newOdl}"; - } - try - { - // invio task caricamento dati ODL - addTask4Machine(idxMacchina, taskType.setArt, setArtVal); - addTask4Machine(idxMacchina, taskType.setPzComm, setPzCommVal); - addTask4Machine(idxMacchina, taskType.setComm, setCommVal); - } - catch - { } - // chiamo refresh MSE - taMSE.forceRecalc(0, idxMacchina); - // resetto stato macchina... - memLayer.ML.redDelKey(currStatoMaccHash(idxMacchina)); - answ = "OK"; - logger.lg.scriviLog($"Effettuato reset e ricalcoli x split ODL per macchina {idxMacchina}", tipoLog.INFO); - // se è una master richiamo fix x child... - if (isMaster(idxMacchina)) - { - taODL.fixMachineSlave(idxMacchina, 30, 1); - // ciclo su ogni slave la gestione reinvio pezzi -->calcolo gli slave... - var slaveList = taM2S.getByMaster(idxMacchina); - foreach (var machine in slaveList) - { - // invio task caricamento dati ODL - addTask4Machine(machine.IdxMacchinaSlave, taskType.setArt, setArtVal); - addTask4Machine(machine.IdxMacchinaSlave, taskType.setPzComm, setPzCommVal); - addTask4Machine(machine.IdxMacchinaSlave, taskType.setComm, setCommVal); - } - } - } - } - catch (Exception exc) - { - logger.lg.scriviLog($"Eccezione in forceSplitOdl{Environment.NewLine}{exc}", tipoLog.EXCEPTION); - } - } - else - { - logger.lg.scriviLog($"VETO ATTIVO | Richiesto forceSplitOdl per impianto {idxMacchina} | impossibile procedere"); - } - return answ; - } - /// /// GET elenco parametri correnti x IOB ///