From c364f265316c40bc063be8176e22cbaa77f19372 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 23 Jul 2020 18:41:43 +0200 Subject: [PATCH] Aggiunti metodi x update e caricamento TUTTI OtherItems di un CART --- AppData/DS_App.Designer.cs | 74 +++++++++++++++++-- AppData/DS_App.xsd | 15 ++++ AppData/DS_App.xss | 4 +- .../cmp_KS_OtherItemsCart.ascx | 7 +- .../cmp_KS_OtherItemsCart.ascx.cs | 9 +-- .../cmp_KS_OtherItemsCart.ascx.designer.cs | 9 --- .../WebUserControls/cmp_kittingSmart.ascx.cs | 2 +- 7 files changed, 89 insertions(+), 31 deletions(-) diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 464d22e..9eded29 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -34087,7 +34087,7 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W [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[4]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "select * from PackLog"; @@ -34102,20 +34102,30 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserName", 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_PL_acquirePaint"; + this._commandCollection[2].CommandText = "dbo.stp_PL_acquireOtherItems"; 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("@BinID", 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("@OtherItemID", 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("@CartID", 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("@MaxNum", 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("@Device", 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("@UserName", 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_PLog_getByCart"; + this._commandCollection[3].CommandText = "dbo.stp_PL_acquirePaint"; 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("@BinID", 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("@CartID", 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("@MaxNum", 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("@Device", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserName", 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_PLog_getByCart"; + 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("@CartID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -34147,7 +34157,7 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.PackLogDataTable getByCartId(global::System.Nullable CartID) { - this.Adapter.SelectCommand = this.CommandCollection[3]; + this.Adapter.SelectCommand = this.CommandCollection[4]; if ((CartID.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(CartID.Value)); } @@ -34202,8 +34212,60 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W [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 acquirePaint(global::System.Nullable BinID, global::System.Nullable CartID, global::System.Nullable MaxNum, string Device, string UserName) { + public virtual int acquireOtherItems(global::System.Nullable OtherItemID, global::System.Nullable CartID, global::System.Nullable MaxNum, string Device, string UserName) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + if ((OtherItemID.HasValue == true)) { + command.Parameters[1].Value = ((int)(OtherItemID.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((CartID.HasValue == true)) { + command.Parameters[2].Value = ((int)(CartID.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((MaxNum.HasValue == true)) { + command.Parameters[3].Value = ((int)(MaxNum.Value)); + } + else { + command.Parameters[3].Value = global::System.DBNull.Value; + } + if ((Device == null)) { + command.Parameters[4].Value = global::System.DBNull.Value; + } + else { + command.Parameters[4].Value = ((string)(Device)); + } + if ((UserName == null)) { + command.Parameters[5].Value = global::System.DBNull.Value; + } + else { + command.Parameters[5].Value = ((string)(UserName)); + } + 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 acquirePaint(global::System.Nullable BinID, global::System.Nullable CartID, global::System.Nullable MaxNum, string Device, string UserName) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; if ((BinID.HasValue == true)) { command.Parameters[1].Value = ((int)(BinID.Value)); } diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index 73180ea..00036e0 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -2599,6 +2599,21 @@ FROM v_PackListDet + + + + dbo.stp_PL_acquireOtherItems + + + + + + + + + + + diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss index 66b28ec..02bf352 100644 --- a/AppData/DS_App.xss +++ b/AppData/DS_App.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -34,7 +34,7 @@ - + diff --git a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx index 9a7c056..833f514 100644 --- a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx +++ b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx @@ -11,12 +11,9 @@
-
- + 1 -
-
+
- +<%: hfNumAll.Value %>(ALL) + +<%: hfNumAll.Value %> (ALL)
diff --git a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs index cc23c37..1fba68c 100644 --- a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs @@ -73,7 +73,6 @@ namespace NKC_WF.WebUserControls cmp_KS_OkibCart.Visible = cartOk; } lbtAddAll.Visible = showBtns; - lbtAddOne.Visible = showBtns; // se ho bin e cart --> mostro buttons calcolati! if (showBtns) { @@ -166,15 +165,9 @@ namespace NKC_WF.WebUserControls } } - protected void lbtAddOne_Click(object sender, EventArgs e) - { - DataLayer.man.taPLog.acquirePaint(OtherItemID, CartID, 1, currIpAddress(), user_std.UtSn.userNameAD); - doUpdate(); - } - protected void lbtAddAll_Click(object sender, EventArgs e) { - DataLayer.man.taPLog.acquirePaint(OtherItemID, CartID, numMax, currIpAddress(), user_std.UtSn.userNameAD); + DataLayer.man.taPLog.acquireOtherItems(OtherItemID, CartID, numMax, currIpAddress(), user_std.UtSn.userNameAD); doUpdate(); } } diff --git a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.designer.cs index 34bacde..704458b 100644 --- a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.designer.cs @@ -23,15 +23,6 @@ namespace NKC_WF.WebUserControls /// protected global::NKC_WF.WebUserControls.cmp_KS_currOI cmp_KS_currOI; - /// - /// Controllo lbtAddOne. - /// - /// - /// 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 lbtAddOne; - /// /// Controllo hfNumAll. /// diff --git a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs index 720fc34..2ffaa92 100644 --- a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs @@ -395,7 +395,7 @@ namespace NKC_WF.WebUserControls } } break; - case codeType.ItemGeneric: + case codeType.OtherItem: // recupero la tab OKOI x iniziare a controllare i dati... var tabOKOI = DataLayer.man.taOKOI.getByOtherItemDtmx(rawData); // PRIMO: verifico SE ho delle righe valide...