From 1fba7f5c4a457f7e8624ef344cf69a3fa6e568ee Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 18 Mar 2020 19:36:56 +0100 Subject: [PATCH] Update parziale con NUOVI metodi x creaz lotti + UDC --- MP-MAG/SMART/prtFiniti.aspx | 2 +- MP-MAG/SMART/prtSemilav.aspx | 2 +- MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx | 14 +- .../WebUserControls/cmp_creaLottoOUT.ascx.cs | 28 +--- .../cmp_creaLottoOUT.ascx.designer.cs | 22 +-- MP-MAG/WebUserControls/cmp_printLottoOUT.ascx | 12 +- .../WebUserControls/cmp_printLottoOUT.ascx.cs | 20 ++- .../cmp_printLottoOUT.ascx.designer.cs | 17 +- MP-MAG/WebUserControls/cmp_prtFiniti.ascx | 3 +- MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs | 32 ++-- .../cmp_prtFiniti.ascx.designer.cs | 13 +- MP-MAG/WebUserControls/cmp_prtSemilav.ascx | 3 +- MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs | 48 ++++-- .../cmp_prtSemilav.ascx.designer.cs | 13 +- MagData/DS_Mag.Designer.cs | 153 +++++++++++++++--- MagData/DS_Mag.xsd | 36 ++++- MagData/DS_Mag.xss | 8 +- MagData/MagDataLayer.cs | 4 +- 18 files changed, 296 insertions(+), 134 deletions(-) diff --git a/MP-MAG/SMART/prtFiniti.aspx b/MP-MAG/SMART/prtFiniti.aspx index aa9d997..a12f72c 100644 --- a/MP-MAG/SMART/prtFiniti.aspx +++ b/MP-MAG/SMART/prtFiniti.aspx @@ -3,5 +3,5 @@ <%@ Register Src="~/WebUserControls/cmp_prtFiniti.ascx" TagPrefix="uc1" TagName="cmp_prtFiniti" %> - + diff --git a/MP-MAG/SMART/prtSemilav.aspx b/MP-MAG/SMART/prtSemilav.aspx index 32e4ccf..749efd4 100644 --- a/MP-MAG/SMART/prtSemilav.aspx +++ b/MP-MAG/SMART/prtSemilav.aspx @@ -3,5 +3,5 @@ <%@ Register Src="~/WebUserControls/cmp_prtSemilav.ascx" TagPrefix="uc1" TagName="cmp_prtSemilav" %> - + diff --git a/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx b/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx index cb3ec78..94e400e 100644 --- a/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx +++ b/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx @@ -8,21 +8,9 @@
-
- num UDC: -
-
- -
-
- qta tot: -
-
- -
Creazione nuovo lotto dai Lotti IN selezionati - Crea Lotto + Crea Lotto
diff --git a/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.cs b/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.cs index db00933..9755452 100644 --- a/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.cs @@ -14,31 +14,11 @@ namespace MP_MAG.WebUserControls } /// - /// Num ODC richeisti + /// Evento richiesta creazione lotto /// - public int numUdc - { - get - { - int answ = 0; - int.TryParse(txtNumUDC.Text, out answ); - return answ; - } - } - /// - /// Qta Originale richiesta - /// - public int qtaOrig - { - get - { - int answ = 0; - int.TryParse(txtQtaOrig.Text, out answ); - return answ; - } - } - - protected void lbtPrintSemilav_Click(object sender, EventArgs e) + /// + /// + protected void lbtCreaLotto_Click(object sender, EventArgs e) { // sollevo evento richiesta... raiseEvent(); diff --git a/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.designer.cs b/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.designer.cs index 8d2fc69..8e55dca 100644 --- a/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.designer.cs +++ b/MP-MAG/WebUserControls/cmp_creaLottoOUT.ascx.designer.cs @@ -15,30 +15,12 @@ namespace MP_MAG.WebUserControls { /// - /// Controllo txtNumUDC. + /// Controllo lbtCreaLotto. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.TextBox txtNumUDC; - - /// - /// Controllo txtQtaOrig. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.TextBox txtQtaOrig; - - /// - /// Controllo lbtPrintSemilav. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.LinkButton lbtPrintSemilav; + protected global::System.Web.UI.WebControls.LinkButton lbtCreaLotto; } } diff --git a/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx b/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx index e62736e..a3f38fb 100644 --- a/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx +++ b/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx @@ -7,14 +7,20 @@
- num: + # UDC:
- + +
+
+ qta tot: +
+
+
Indicare il num di cartellini da stampare - PRINT + PRINT
diff --git a/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.cs b/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.cs index 2586c73..9fdc6cf 100644 --- a/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.cs @@ -14,18 +14,30 @@ namespace MP_MAG.WebUserControls } /// - /// Num etichette richieste + /// Num ODC richiesti /// - public int num2print + public int numUdc { get { int answ = 0; - int.TryParse(txtNumPrint.Text, out answ); + int.TryParse(txtNumUDC.Text, out answ); return answ; } } - protected void lbtPrintSemilav_Click(object sender, EventArgs e) + /// + /// Qta Totale richiesta (per il totale UDC) + /// + public int qtaTot + { + get + { + int answ = 0; + int.TryParse(txtQtaTot.Text, out answ); + return answ; + } + } + protected void lbtPrintOUT_Click(object sender, EventArgs e) { // sollevo evento richiesta... raiseEvent(); diff --git a/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.designer.cs b/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.designer.cs index c54c3da..0ecc092 100644 --- a/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.designer.cs +++ b/MP-MAG/WebUserControls/cmp_printLottoOUT.ascx.designer.cs @@ -15,21 +15,30 @@ namespace MP_MAG.WebUserControls { /// - /// Controllo txtNumPrint. + /// Controllo txtNumUDC. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.TextBox txtNumPrint; + protected global::System.Web.UI.WebControls.TextBox txtNumUDC; /// - /// Controllo lbtPrintSemilav. + /// Controllo txtQtaTot. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.LinkButton lbtPrintSemilav; + protected global::System.Web.UI.WebControls.TextBox txtQtaTot; + + /// + /// Controllo lbtPrintOUT. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtPrintOUT; } } diff --git a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx index 5b2055e..facd68a 100644 --- a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx +++ b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx @@ -10,7 +10,8 @@ - + + diff --git a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs index 5264b50..3ead167 100644 --- a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs @@ -78,15 +78,29 @@ namespace MP_MAG.WebUserControls /// /// Cod Stato /// - public string codStato + public string codStatoOUT { get { - return hfCodStato.Value; + return hfCodStatoOUT.Value; } set { - hfCodStato.Value = value; + hfCodStatoOUT.Value = value; + } + } + /// + /// Cod Stato + /// + public string codStatoIN + { + get + { + return hfCodStatoIN.Value; + } + set + { + hfCodStatoIN.Value = value; } } /// @@ -136,7 +150,7 @@ namespace MP_MAG.WebUserControls cmp_LottiOut.lottiSel = value; cmp_ArtOut.lottiSel = value; } - } + } /// /// Caricamento pagina /// @@ -175,11 +189,13 @@ namespace MP_MAG.WebUserControls { MagDataLayer.man.taPJQ.insertQuery(keyParam, printQueue); } + // nascondo creazione... + showCreaStampa(false, false); } private void Cmp_creaLottoOUT_eh_doRefresh(object sender, EventArgs e) { - MagDataLayer.man.taEL.insertQuery(tipoLotto, cmp_ArtOut.CodArtSel, codStato, origine, "", cmp_creaLottoOUT.qtaOrig, cmp_creaLottoOUT.numUdc, RifExt, cmp_LottiIn.elLotti); + MagDataLayer.man.taEL.insertQuery(tipoLotto, cmp_ArtOut.CodArtSel, codStatoOUT, origine, "", RifExt, cmp_LottiIn.elLotti); cmp_LottiOut.doUpdate(); } @@ -230,8 +246,6 @@ namespace MP_MAG.WebUserControls { cmp_creaLottoOUT.Visible = showCrea; cmp_printLottoOUT.Visible = showPrint; - //if (!showCrea) cmp_LottiOut.deSelect(); - //if (!showPrint) cmp_ArtOut.deSelect(); } private void cmp_LottiIn_eh_doReset(object sender, EventArgs e) @@ -246,8 +260,6 @@ namespace MP_MAG.WebUserControls private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e) { - - bool doRaiseEv = false; // processo evento.. lastCmd = cmp_barcode.inputAcquired.ToUpper(); @@ -343,7 +355,7 @@ namespace MP_MAG.WebUserControls case codeType.Lotto: // IN PRIMIS cerco lotto valido DS_Mag.ElencoLottiDataTable tabLotti; - tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "E"); + tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "*", codStatoIN); if (tabLotti.Count == 1) { // se trovato cerco in elenco --> aggiungo in lista se non c'è diff --git a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.designer.cs b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.designer.cs index bb620ae..928eef6 100644 --- a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.designer.cs +++ b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.designer.cs @@ -33,13 +33,22 @@ namespace MP_MAG.WebUserControls protected global::System.Web.UI.WebControls.HiddenField hfTipoLotto; /// - /// Controllo hfCodStato. + /// Controllo hfCodStatoOUT. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.HiddenField hfCodStato; + protected global::System.Web.UI.WebControls.HiddenField hfCodStatoOUT; + + /// + /// Controllo hfCodStatoIN. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfCodStatoIN; /// /// Controllo hfOrigine. diff --git a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx index 99e4f7a..30bb2bb 100644 --- a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx +++ b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx @@ -10,7 +10,8 @@ - + + diff --git a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs index e7043fc..c9648ef 100644 --- a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs @@ -77,17 +77,31 @@ namespace MP_MAG.WebUserControls } } /// - /// Cod Stato + /// Cod Stato in uscita /// - public string codStato + public string codStatoOUT { get { - return hfCodStato.Value; + return hfCodStatoOUT.Value; } set { - hfCodStato.Value = value; + hfCodStatoOUT.Value = value; + } + } + /// + /// Cod Stato materiale in ingresso + /// + public string codStatoIN + { + get + { + return hfCodStatoIN.Value; + } + set + { + hfCodStatoIN.Value = value; } } /// @@ -170,17 +184,27 @@ namespace MP_MAG.WebUserControls private void Cmp_printLottoOUT_eh_doRefresh(object sender, EventArgs e) { // salvo richiesta stampa della quantità richiesta - int num2print = cmp_printLottoOUT.num2print; - string keyParam = cmp_LottiOut.lottoSel; - for (int i = 0; i < num2print; i++) + int numUdc = cmp_printLottoOUT.numUdc; + decimal qtaTot = cmp_printLottoOUT.qtaTot; + if (numUdc > 0) { - MagDataLayer.man.taPJQ.insertQuery(keyParam, printQueue); + decimal qtaUdc = qtaTot / numUdc; + string keyParam = cmp_LottiOut.lottoSel; + for (int i = 0; i < numUdc; i++) + { + // creo UDC x semilavorato.. + MagDataLayer.man.taEUdc.insertQuery() + // cheo stampa per chiave lotto... + MagDataLayer.man.taPJQ.insertQuery(keyParam, printQueue); + } } + // nascondo creazione... + showCreaStampa(false, false); } private void Cmp_creaLottoOUT_eh_doRefresh(object sender, EventArgs e) { - MagDataLayer.man.taEL.insertQuery(tipoLotto, cmp_ArtOut.CodArtSel, codStato, origine, "", cmp_creaLottoOUT.qtaOrig, cmp_creaLottoOUT.numUdc, RifExt, cmp_LottiIn.elLotti); + MagDataLayer.man.taEL.insertQuery(tipoLotto, cmp_ArtOut.CodArtSel, codStatoOUT, origine, "", RifExt, cmp_LottiIn.elLotti); cmp_LottiOut.doUpdate(); } @@ -231,8 +255,6 @@ namespace MP_MAG.WebUserControls { cmp_creaLottoOUT.Visible = showCrea; cmp_printLottoOUT.Visible = showPrint; - //if (!showCrea) cmp_LottiOut.deSelect(); - //if (!showPrint) cmp_ArtOut.deSelect(); } private void cmp_LottiIn_eh_doReset(object sender, EventArgs e) @@ -247,8 +269,6 @@ namespace MP_MAG.WebUserControls private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e) { - - bool doRaiseEv = false; // processo evento.. lastCmd = cmp_barcode.inputAcquired.ToUpper(); @@ -344,7 +364,7 @@ namespace MP_MAG.WebUserControls case codeType.Lotto: // IN PRIMIS cerco lotto valido DS_Mag.ElencoLottiDataTable tabLotti; - tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "E"); + tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "*", codStatoIN); if (tabLotti.Count == 1) { // se trovato cerco in elenco --> aggiungo in lista se non c'è diff --git a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.designer.cs b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.designer.cs index 58f83e6..368a78c 100644 --- a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.designer.cs +++ b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.designer.cs @@ -33,13 +33,22 @@ namespace MP_MAG.WebUserControls protected global::System.Web.UI.WebControls.HiddenField hfTipoLotto; /// - /// Controllo hfCodStato. + /// Controllo hfCodStatoOUT. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.HiddenField hfCodStato; + protected global::System.Web.UI.WebControls.HiddenField hfCodStatoOUT; + + /// + /// Controllo hfCodStatoIN. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfCodStatoIN; /// /// Controllo hfOrigine. diff --git a/MagData/DS_Mag.Designer.cs b/MagData/DS_Mag.Designer.cs index 494a4ed..437c304 100644 --- a/MagData/DS_Mag.Designer.cs +++ b/MagData/DS_Mag.Designer.cs @@ -4257,6 +4257,7 @@ namespace MagData.DS_MagTableAdapters { 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("@Lotto", 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("@TipoLotto", 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("@CodStato", 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_EL_getBySearch"; @@ -4273,8 +4274,6 @@ namespace MagData.DS_MagTableAdapters { this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodStato", 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("@Origine", 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("@Note", global::System.Data.SqlDbType.NVarChar, 250, 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("@QtaOrig", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 9, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumUdc", 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("@RifExt", 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("@elLotti", global::System.Data.SqlDbType.NVarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand(); @@ -4366,7 +4365,7 @@ namespace MagData.DS_MagTableAdapters { [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_Mag.ElencoLottiDataTable getByKey(string Lotto, string TipoLotto) { + public virtual DS_Mag.ElencoLottiDataTable getByKey(string Lotto, string TipoLotto, string CodStato) { this.Adapter.SelectCommand = this.CommandCollection[4]; if ((Lotto == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; @@ -4380,6 +4379,12 @@ namespace MagData.DS_MagTableAdapters { else { this.Adapter.SelectCommand.Parameters[2].Value = ((string)(TipoLotto)); } + if ((CodStato == null)) { + this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[3].Value = ((string)(CodStato)); + } DS_Mag.ElencoLottiDataTable dataTable = new DS_Mag.ElencoLottiDataTable(); this.Adapter.Fill(dataTable); return dataTable; @@ -4405,7 +4410,7 @@ namespace MagData.DS_MagTableAdapters { [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(string TipoLotto, string CodArt, string CodStato, string Origine, string Note, global::System.Nullable QtaOrig, global::System.Nullable NumUdc, string RifExt, string elLotti) { + public virtual int insertQuery(string TipoLotto, string CodArt, string CodStato, string Origine, string Note, string RifExt, string elLotti) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; if ((TipoLotto == null)) { command.Parameters[1].Value = global::System.DBNull.Value; @@ -4437,29 +4442,17 @@ namespace MagData.DS_MagTableAdapters { else { command.Parameters[5].Value = ((string)(Note)); } - if ((QtaOrig.HasValue == true)) { - command.Parameters[6].Value = ((decimal)(QtaOrig.Value)); - } - else { + if ((RifExt == null)) { command.Parameters[6].Value = global::System.DBNull.Value; } - if ((NumUdc.HasValue == true)) { - command.Parameters[7].Value = ((int)(NumUdc.Value)); - } else { - command.Parameters[7].Value = global::System.DBNull.Value; - } - if ((RifExt == null)) { - command.Parameters[8].Value = global::System.DBNull.Value; - } - else { - command.Parameters[8].Value = ((string)(RifExt)); + command.Parameters[6].Value = ((string)(RifExt)); } if ((elLotti == null)) { - command.Parameters[9].Value = global::System.DBNull.Value; + command.Parameters[7].Value = global::System.DBNull.Value; } else { - command.Parameters[9].Value = ((string)(elLotti)); + command.Parameters[7].Value = ((string)(elLotti)); } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) @@ -4682,7 +4675,7 @@ namespace MagData.DS_MagTableAdapters { [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[2]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT *\r\nFROM dbo.v_ElencoUdc"; @@ -4693,6 +4686,24 @@ namespace MagData.DS_MagTableAdapters { this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[1].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[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_EU_InsertQuery"; + 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("@Lotto", 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("@Flusso", 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("@CodCliente", 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("@CodPost", 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("@Qta", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 9, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumCont", 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("@CodSoggetto", 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("@PesoTot", global::System.Data.SqlDbType.Float, 8, global::System.Data.ParameterDirection.Input, 53, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PesoCad", global::System.Data.SqlDbType.Float, 8, global::System.Data.ParameterDirection.Input, 53, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Tara", global::System.Data.SqlDbType.Float, 8, global::System.Data.ParameterDirection.Input, 53, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodImballo", 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("@IdxPosizione", 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, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -4735,6 +4746,106 @@ namespace MagData.DS_MagTableAdapters { 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")] + public virtual int insertQuery(string Lotto, string Flusso, string CodCliente, string CodPost, global::System.Nullable Qta, global::System.Nullable NumCont, string CodSoggetto, global::System.Nullable PesoTot, global::System.Nullable PesoCad, global::System.Nullable Tara, string CodImballo, global::System.Nullable IdxPosizione, string Note) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + if ((Lotto == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(Lotto)); + } + if ((Flusso == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(Flusso)); + } + if ((CodCliente == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(CodCliente)); + } + if ((CodPost == null)) { + command.Parameters[4].Value = global::System.DBNull.Value; + } + else { + command.Parameters[4].Value = ((string)(CodPost)); + } + if ((Qta.HasValue == true)) { + command.Parameters[5].Value = ((decimal)(Qta.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + if ((NumCont.HasValue == true)) { + command.Parameters[6].Value = ((int)(NumCont.Value)); + } + else { + command.Parameters[6].Value = global::System.DBNull.Value; + } + if ((CodSoggetto == null)) { + command.Parameters[7].Value = global::System.DBNull.Value; + } + else { + command.Parameters[7].Value = ((string)(CodSoggetto)); + } + if ((PesoTot.HasValue == true)) { + command.Parameters[8].Value = ((double)(PesoTot.Value)); + } + else { + command.Parameters[8].Value = global::System.DBNull.Value; + } + if ((PesoCad.HasValue == true)) { + command.Parameters[9].Value = ((double)(PesoCad.Value)); + } + else { + command.Parameters[9].Value = global::System.DBNull.Value; + } + if ((Tara.HasValue == true)) { + command.Parameters[10].Value = ((double)(Tara.Value)); + } + else { + command.Parameters[10].Value = global::System.DBNull.Value; + } + if ((CodImballo == null)) { + command.Parameters[11].Value = global::System.DBNull.Value; + } + else { + command.Parameters[11].Value = ((string)(CodImballo)); + } + if ((IdxPosizione.HasValue == true)) { + command.Parameters[12].Value = ((int)(IdxPosizione.Value)); + } + else { + command.Parameters[12].Value = global::System.DBNull.Value; + } + if ((Note == null)) { + command.Parameters[13].Value = global::System.DBNull.Value; + } + else { + command.Parameters[13].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; + } } /// diff --git a/MagData/DS_Mag.xsd b/MagData/DS_Mag.xsd index ff55b24..a40b4c2 100644 --- a/MagData/DS_Mag.xsd +++ b/MagData/DS_Mag.xsd @@ -79,6 +79,7 @@ FROM V_ElencoLotti + @@ -105,8 +106,6 @@ FROM V_ElencoLotti - - @@ -183,6 +182,29 @@ FROM dbo.v_ElencoUdc + + + + dbo.stp_EU_InsertQuery + + + + + + + + + + + + + + + + + + + @@ -314,7 +336,7 @@ FROM dbo.ElencoPost2Queue - + @@ -389,7 +411,7 @@ FROM dbo.ElencoPost2Queue - + @@ -544,7 +566,7 @@ FROM dbo.ElencoPost2Queue - + @@ -571,7 +593,7 @@ FROM dbo.ElencoPost2Queue - + @@ -631,7 +653,7 @@ FROM dbo.ElencoPost2Queue - + diff --git a/MagData/DS_Mag.xss b/MagData/DS_Mag.xss index 3daeb20..553cf5e 100644 --- a/MagData/DS_Mag.xss +++ b/MagData/DS_Mag.xss @@ -7,10 +7,10 @@ - - - - + + + + \ No newline at end of file diff --git a/MagData/MagDataLayer.cs b/MagData/MagDataLayer.cs index bac3346..4853497 100644 --- a/MagData/MagDataLayer.cs +++ b/MagData/MagDataLayer.cs @@ -297,11 +297,11 @@ namespace MagData answ.codeInt = codeInt; answ.description = $"UDC Odette: {answ.code}"; } - else if (bcValue.Length == 7 || bcValue.Length == 6) + else if (bcValue.Length >= 6 && bcValue.Length <= 7) { // cerco x lotto SOLO Ext (M=INT, E=Ext) DS_Mag.ElencoLottiDataTable tabLotti; - tabLotti = taEL.getByKey(bcValue, "E"); + tabLotti = taEL.getByKey(bcValue, "*", "*"); if (tabLotti.Count > 0) { var riga = tabLotti[0];