diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 3654307..8417af1 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -18102,12 +18102,11 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BinIndex", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_BIN_update"; + this._commandCollection[6].CommandText = "dbo.stp_BIN_updatePainted"; 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("@Original_BinID", 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("@FillDate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrintDate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PaintDate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -18235,7 +18234,7 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat [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_App.BinsDataTable updateQuery(global::System.Nullable Original_BinID, global::System.Nullable FillDate, global::System.Nullable PrintDate) { + public virtual DS_App.BinsDataTable updatePainted(global::System.Nullable Original_BinID, global::System.Nullable PaintDate) { this.Adapter.SelectCommand = this.CommandCollection[6]; if ((Original_BinID.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Original_BinID.Value)); @@ -18243,18 +18242,12 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat else { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } - if ((FillDate.HasValue == true)) { - this.Adapter.SelectCommand.Parameters[2].Value = ((System.DateTime)(FillDate.Value)); + if ((PaintDate.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[2].Value = ((System.DateTime)(PaintDate.Value)); } else { this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; } - if ((PrintDate.HasValue == true)) { - this.Adapter.SelectCommand.Parameters[3].Value = ((System.DateTime)(PrintDate.Value)); - } - else { - this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; - } DS_App.BinsDataTable dataTable = new DS_App.BinsDataTable(); this.Adapter.Fill(dataTable); return dataTable; diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index 859e324..30c38a4 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -1135,15 +1135,14 @@ FROM v_BinDetail - + - dbo.stp_BIN_update + dbo.stp_BIN_updatePainted - - + diff --git a/NKC_WF/WebUserControls/cmp_painting.ascx b/NKC_WF/WebUserControls/cmp_painting.ascx index 0c89d3d..96895f1 100644 --- a/NKC_WF/WebUserControls/cmp_painting.ascx +++ b/NKC_WF/WebUserControls/cmp_painting.ascx @@ -13,6 +13,8 @@ + + <%: traduci("ConfirmPaint") %>
diff --git a/NKC_WF/WebUserControls/cmp_painting.ascx.cs b/NKC_WF/WebUserControls/cmp_painting.ascx.cs index 6a33045..44a75a3 100644 --- a/NKC_WF/WebUserControls/cmp_painting.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_painting.ascx.cs @@ -51,8 +51,15 @@ namespace NKC_WF.WebUserControls /// protected void Page_Load(object sender, EventArgs e) { + fixButtons(); cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh; } + + private void fixButtons() + { + lbtConfirmPaint.Visible = false; + } + private void doUpdate() { cmp_paint_binsIN.doUpdate(); @@ -65,7 +72,6 @@ namespace NKC_WF.WebUserControls // processo evento.. lastCmd = cmp_barcode.inputAcquired.ToUpper(); doRaiseEv = processLastCmd(doRaiseEv); - // reset comando cmp_barcode.inputAcquired = ""; // aggiorno... @@ -113,8 +119,28 @@ namespace NKC_WF.WebUserControls doRaiseEv = true; break; case codeType.Bin: + var tabBin = DataLayer.man.taBN.getByKey(decoData.codeInt); + bool allOk = false; + // se ne trovo 1 --> OK verde + if (tabBin.Count == 1) + { + // se NON E' PAINTED ma รจ COMPLETE + var riga = tabBin[0]; + allOk = (riga.Complete == 1 && riga.Painted == 0); + } + if (allOk) + { + cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}"); + } + else + { + cmp_barcode.showOutput("badge badge-danger", $"{decoData.description} --> no valid action"); + } + lbtConfirmPaint.Visible = allOk; break; case codeType.BinProcessed: + cmp_barcode.showOutput("text-danger", $"BinProcessed - ignored: {decoData.rawData} --> no action"); + doRaiseEv = true; break; case codeType.SecScreen: cmp_barcode.showOutput("badge badge-warning", $"SecScreen - ignored: {decoData.description}"); @@ -127,5 +153,16 @@ namespace NKC_WF.WebUserControls } return doRaiseEv; } + + + protected void lbtConfirmPaint_Click(object sender, EventArgs e) + { + // processiamo barcode letto + decodedData decoData = DataLayer.man.decodeBcode(lastValidCmd); + // lo indico come painted (update dtPainted) + DataLayer.man.taBN.updatePainted(decoData.codeInt, DateTime.Now); + // udpate tabelle! + doUpdate(); + } } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs index 33838e9..147153b 100644 --- a/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs @@ -50,6 +50,15 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.HiddenField hfLastValidBCode; + /// + /// Controllo lbtConfirmPaint. + /// + /// + /// 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 lbtConfirmPaint; + /// /// Controllo cmp_paint_binsOUT. ///