diff --git a/Jenkinsfile b/Jenkinsfile index 7d567aa1..072c7858 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=1401']) { + withEnv(['NEXT_BUILD_NUMBER=1402']) { // env.versionNumber = VersionNumber(versionNumberString : '6.13.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '6.13.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO' diff --git a/MP-MAG/WebUserControls/cmp_OrderListAdd.ascx.cs b/MP-MAG/WebUserControls/cmp_OrderListAdd.ascx.cs index 29d45aba..498e8a0b 100644 --- a/MP-MAG/WebUserControls/cmp_OrderListAdd.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_OrderListAdd.ascx.cs @@ -58,14 +58,22 @@ namespace MP_MAG.WebUserControls { // recupero dati... string keySel = grView.SelectedValue.ToString(); - int RigaOrd = 0; - int.TryParse(keySel, out RigaOrd); - var tabOrdExt = MagData.MagDataLayer.man.taEOL.getByKey(RigaOrd); + int numRigaOrd = 0; + int.TryParse(keySel, out numRigaOrd); + var tabOrdExt = MagData.MagDataLayer.man.taEOL.getByKey(numRigaOrd); if (tabOrdExt != null && tabOrdExt.Count > 0) { var rigaOrd = tabOrdExt[0]; string descrOrd = $"Data: {rigaOrd.DataConsegna:yyyy/MM/dd} | Dest: {rigaOrd.DescDestinazione}"; - MagData.MagDataLayer.man.taOList.insertQuery(PackListID, keySel, rigaOrd.CodArticolo, descrOrd, rigaOrd.Qta); + + // verifico che per la packingList corrente no ci sia già l'ordine (sennò NON aggiungo... + var tabOrdiniCaricati = MagData.MagDataLayer.man.taOList.getByPLID(PackListID); + // cerco se ci sia il cod esterno + var ordiniCaricati = tabOrdiniCaricati.Where(x => x.ExtOrdCod == keySel); + if (ordiniCaricati.ToList().Count == 0) + { + MagData.MagDataLayer.man.taOList.insertQuery(PackListID, keySel, rigaOrd.CodArticolo, descrOrd, rigaOrd.Qta, rigaOrd.CodCliente, rigaOrd.DescDestinazione); + } raiseAddNew(); } } diff --git a/MagData/DS_PackList.Designer.cs b/MagData/DS_PackList.Designer.cs index 69102f0f..b5d0c3c9 100644 --- a/MagData/DS_PackList.Designer.cs +++ b/MagData/DS_PackList.Designer.cs @@ -2830,6 +2830,8 @@ namespace MagData.DS_PackListTableAdapters { this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArt", 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("@OrdDescr", 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("@Qty", 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("@CodCliente", 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("@CodDestinazione", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; this._commandCollection[5].CommandText = "dbo.stp_OrdList_updateQuery"; @@ -2935,7 +2937,7 @@ namespace MagData.DS_PackListTableAdapters { [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 insertQuery(global::System.Nullable PackListID, string ExtOrdCod, string CodArt, string OrdDescr, global::System.Nullable Qty) { + public virtual int insertQuery(global::System.Nullable PackListID, string ExtOrdCod, string CodArt, string OrdDescr, global::System.Nullable Qty, string CodCliente, string CodDestinazione) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((PackListID.HasValue == true)) { command.Parameters[1].Value = ((int)(PackListID.Value)); @@ -2967,6 +2969,18 @@ namespace MagData.DS_PackListTableAdapters { else { command.Parameters[5].Value = global::System.DBNull.Value; } + if ((CodCliente == null)) { + command.Parameters[6].Value = global::System.DBNull.Value; + } + else { + command.Parameters[6].Value = ((string)(CodCliente)); + } + if ((CodDestinazione == null)) { + command.Parameters[7].Value = global::System.DBNull.Value; + } + else { + command.Parameters[7].Value = ((string)(CodDestinazione)); + } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { diff --git a/MagData/DS_PackList.xsd b/MagData/DS_PackList.xsd index 4309d004..f008af52 100644 --- a/MagData/DS_PackList.xsd +++ b/MagData/DS_PackList.xsd @@ -169,6 +169,8 @@ + + @@ -240,7 +242,7 @@ - + @@ -279,7 +281,7 @@ - + @@ -318,7 +320,7 @@ - + diff --git a/MagData/DS_PackList.xss b/MagData/DS_PackList.xss index 03d29fd2..91f4bca5 100644 --- a/MagData/DS_PackList.xss +++ b/MagData/DS_PackList.xss @@ -7,8 +7,8 @@ - - + + \ No newline at end of file