From e7a6d3bdc63b02dbb90f9e5e3f716082a0894623 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 27 Sep 2019 19:06:20 +0200 Subject: [PATCH] Bozza cambio stato su CART/BIN --- NKC_WF/MachineUnloadSmart.aspx.cs | 64 ++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/NKC_WF/MachineUnloadSmart.aspx.cs b/NKC_WF/MachineUnloadSmart.aspx.cs index bdfcbbf..44b4923 100644 --- a/NKC_WF/MachineUnloadSmart.aspx.cs +++ b/NKC_WF/MachineUnloadSmart.aspx.cs @@ -148,8 +148,38 @@ namespace NKC_WF } break; case codeType.Cart: + if (currCartTab.Count == 1) + { + // controllo se sia quello corretto + if (rawData != currCartTab[0].CartDtmx) + { + lblErrorMsg.Text = "INCORRECT CART: please retry"; + itemIdSelected = 0; + divItemError.Visible = true; + } + else + { + // dichiaro che è depositato + DataLayer.man.taIL.updateStatus(itemIdSelected, 4, "WRK001"); + } + } break; case codeType.Bin: + if (currBinTab.Count == 1) + { + // controllo se sia quello corretto + if (rawData != currBinTab[0].BinDtmx) + { + lblErrorMsg.Text = "INCORRECT BIN: please retry"; + itemIdSelected = 0; + divItemError.Visible = true; + } + else + { + // dichiaro che è depositato + DataLayer.man.taIL.updateStatus(itemIdSelected, 5, "WRK001"); + } + } break; default: break; @@ -167,11 +197,13 @@ namespace NKC_WF // mostro output (compreso che mi aspetto entro 30 sec lettura cart/Bin) +#if false icnCart.Attributes.Remove("class"); icnCart.Attributes.Add("class", "btn btn-sm btn-block btn-success"); lblMessage.Text = "Riconosciuto item"; lblDestination.Text = "SEND TO CART CR00012"; - lblDestination.CssClass = "text-success"; + lblDestination.CssClass = "text-success"; +#endif } /// /// Mostra o nasconde dettaglio su ITEM letto @@ -245,6 +277,21 @@ namespace NKC_WF lbtSecOp.Visible = false; } + protected DS_App.BinsDataTable currBinTab + { + get + { + return DataLayer.man.taBN.getByItemID(itemIdSelected); + } + } + protected DS_App.CartsDataTable currCartTab + { + get + { + return DataLayer.man.taCR.getByItemID(itemIdSelected); + } + } + private void doUpdate() { // reset grafico @@ -264,14 +311,14 @@ namespace NKC_WF icnCart.Attributes.Remove("class"); icnCart.Attributes.Add("class", "btn btn-sm btn-block btn-success"); lblMessage.Text = "Item recognized"; - var tabCart = DataLayer.man.taCR.getByItemID(itemIdSelected); - if (tabCart.Count == 1) + // controllo SE HO cart + if (currCartTab.Count == 1) { - lblDestination.Text = $"SEND TO CART {tabCart[0].CartDtmx}"; + lblDestination.Text = $"SEND TO CART {currCartTab[0].CartDtmx}"; } else { - lblDestination.Text = $"ERROR SEARCHING CART: {tabCart.Count} found!"; + lblDestination.Text = $"ERROR SEARCHING CART: {currCartTab.Count} found!"; } lblDestination.CssClass = "text-success"; } @@ -280,14 +327,13 @@ namespace NKC_WF icnBin.Attributes.Remove("class"); icnBin.Attributes.Add("class", "btn btn-sm btn-block btn-primary"); lblMessage.Text = "Item recognized"; - var tabBin = DataLayer.man.taBN.getByItemID(itemIdSelected); - if (tabBin.Count == 1) + if (currBinTab.Count == 1) { - lblDestination.Text = $"SEND TO BIN {tabBin[0].BinDtmx}"; + lblDestination.Text = $"SEND TO BIN {currBinTab[0].BinDtmx}"; } else { - lblDestination.Text = $"ERROR SEARCHING BIN: {tabBin.Count} found!"; + lblDestination.Text = $"ERROR SEARCHING BIN: {currBinTab.Count} found!"; } lblDestination.CssClass = "text-primary"; }