diff --git a/AppData/DataLayer.cs b/AppData/DataLayer.cs index ab07a89..0927d19 100644 --- a/AppData/DataLayer.cs +++ b/AppData/DataLayer.cs @@ -11,6 +11,7 @@ namespace AppData public DS_AppTableAdapters.BatchListTableAdapter taBL; public DS_AppTableAdapters.BinsTableAdapter taBN; public DS_AppTableAdapters.BinListTableAdapter taBNLS; + public DS_AppTableAdapters.CartOnKitTableAdapter taCOK; public DS_AppTableAdapters.CountersTableAdapter taCount; public DS_AppTableAdapters.CartsTableAdapter taCR; public DS_AppTableAdapters.ErrorsLogTableAdapter taEL; @@ -55,6 +56,7 @@ namespace AppData taBL.Connection.ConnectionString = connString; taBN.Connection.ConnectionString = connString; taBNLS.Connection.ConnectionString = connString; + taCOK.Connection.ConnectionString = connString; taCount.Connection.ConnectionString = connString; taCR.Connection.ConnectionString = connString; taEL.Connection.ConnectionString = connString; @@ -91,6 +93,7 @@ namespace AppData taBL = new DS_AppTableAdapters.BatchListTableAdapter(); taBN = new DS_AppTableAdapters.BinsTableAdapter(); taBNLS = new DS_AppTableAdapters.BinListTableAdapter(); + taCOK= new DS_AppTableAdapters.CartOnKitTableAdapter (); taCount = new DS_AppTableAdapters.CountersTableAdapter(); taCR = new DS_AppTableAdapters.CartsTableAdapter(); taEL = new DS_AppTableAdapters.ErrorsLogTableAdapter(); diff --git a/NKC_WF/WebUserControls/cmp_KS_BinCart.ascx.cs b/NKC_WF/WebUserControls/cmp_KS_BinCart.ascx.cs index 228a5d1..ad842ab 100644 --- a/NKC_WF/WebUserControls/cmp_KS_BinCart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_KS_BinCart.ascx.cs @@ -69,15 +69,17 @@ namespace NKC_WF.WebUserControls { cmp_KS_OkibBin.Visible = binOk; } - lbtAddAll.Visible = showBtns; - lbtAddOne.Visible = showBtns; // se ho bin e cart --> mostro buttons calcolati! + lbtAddAll.Visible = false; + lbtAddOne.Visible = false; if (showBtns) { var tabOKIB = DataLayer.man.taOKIB_Sum.getByKey(BinID, CartID); if (tabOKIB.Count > 0) { numMax = tabOKIB[0].NumItems - tabOKIB[0].NumPicked; + lbtAddAll.Visible = true; + lbtAddOne.Visible = true; } } } @@ -130,7 +132,7 @@ namespace NKC_WF.WebUserControls } set { - cmp_KS_currBin.CurrId = value; + } } /// @@ -152,13 +154,21 @@ namespace NKC_WF.WebUserControls protected void lbtAddOne_Click(object sender, EventArgs e) { DataLayer.man.taPLog.acquirePaint(BinID, CartID, 1, currIpAddress(), user_std.UtSn.userNameAD); - doUpdate(); + // resetto + CartID = 0; + BinID = 0; + // sollevo evento + raiseEvent(); } protected void lbtAddAll_Click(object sender, EventArgs e) { DataLayer.man.taPLog.acquirePaint(BinID, CartID, numMax, currIpAddress(), user_std.UtSn.userNameAD); - doUpdate(); + // resetto + CartID = 0; + BinID = 0; + // sollevo evento + raiseEvent(); } } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_KS_OkibCart.ascx b/NKC_WF/WebUserControls/cmp_KS_OkibCart.ascx index e0bedab..91edfa9 100644 --- a/NKC_WF/WebUserControls/cmp_KS_OkibCart.ascx +++ b/NKC_WF/WebUserControls/cmp_KS_OkibCart.ascx @@ -13,10 +13,13 @@
+ +
+
Picked:
-
+
Total:
diff --git a/NKC_WF/WebUserControls/cmp_KS_OkoiCart.ascx b/NKC_WF/WebUserControls/cmp_KS_OkoiCart.ascx index ab46317..b9a519f 100644 --- a/NKC_WF/WebUserControls/cmp_KS_OkoiCart.ascx +++ b/NKC_WF/WebUserControls/cmp_KS_OkoiCart.ascx @@ -3,7 +3,7 @@ - +
@@ -14,13 +14,12 @@
-
-
+
Picked:
-
+
Total:
diff --git a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs index 71992da..0228087 100644 --- a/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_KS_OtherItemsCart.ascx.cs @@ -68,14 +68,15 @@ namespace NKC_WF.WebUserControls { cmp_KS_OkoiOI.Visible = otherItemOk; } - lbtAddAll.Visible = showBtns; // se ho bin e cart --> mostro buttons calcolati! + lbtAddAll.Visible = false; if (showBtns) { var tabOKOI = DataLayer.man.taOKOI_Sum.getByKey(OtherItemID, CartID); if (tabOKOI.Count > 0) { numMax = tabOKOI[0].NumItems - tabOKOI[0].NumPicked; + lbtAddAll.Visible = true; } } } @@ -150,7 +151,11 @@ namespace NKC_WF.WebUserControls protected void lbtAddAll_Click(object sender, EventArgs e) { DataLayer.man.taPLog.acquireOtherItems(OtherItemID, CartID, numMax, currIpAddress(), user_std.UtSn.userNameAD); - doUpdate(); + // resetto + CartID = 0; + OtherItemID = 0; + // sollevo evento + raiseEvent(); } } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx index 94fce5d..cdb81b7 100644 --- a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx +++ b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx @@ -19,14 +19,10 @@
-
- -
-
-
+
@@ -44,11 +40,16 @@
-
+
+
+
+ +
+
<%: traduci("cancel") %> diff --git a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs index 69562d7..08e282c 100644 --- a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs @@ -90,10 +90,23 @@ namespace NKC_WF.WebUserControls } cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh; cmp_barcode.eh_doReset += Cmp_barcode_eh_doReset; + cmp_KS_BinCart.eh_doRefresh += cmp_KS_BinCart_eh_doRefresh; + cmp_KS_OtherItemsCart.eh_doRefresh += cmp_KS_OtherItemsCart_eh_doRefresh; + } + + private void cmp_KS_OtherItemsCart_eh_doRefresh(object sender, EventArgs e) + { + displInfo("Other PART added", true); + } + + private void cmp_KS_BinCart_eh_doRefresh(object sender, EventArgs e) + { + displInfo("PAINT PART added", true); } private void resetShowData() { + cmp_KS_Cart.Visible = false; cmp_KS_BinCart.Visible = false; cmp_KS_OtherItemsCart.Visible = false; } @@ -225,7 +238,6 @@ namespace NKC_WF.WebUserControls resetSelection(false); break; } - return doRaiseEv; } @@ -239,6 +251,7 @@ namespace NKC_WF.WebUserControls private void processItemSuggestion(codeType tipoCod, string rawData, int codeInt) { DS_App.ItemListDataTable tabItem = null; + divInfo.Visible = false; // processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero) switch (tipoCod) { @@ -269,8 +282,15 @@ namespace NKC_WF.WebUserControls var tabLog = DataLayer.man.taPLog.getByCartId(codeInt); if (tabLog.Count > 0) { - // se già in scarico ok --> segnalo - displError($"CART already on KIT: Cart {rawData}", true); + // verifico se sia completo -_> reset... altrimenti lascio così... + var tabCOK = DataLayer.man.taCOK.GetData(); + // cerco se sia "green" numWait + numReady + numOtherWait = 0 + var tabGreen = tabCOK.Where(x => (x.NumPzWaiting + x.NumPzBinAvail + x.OtherQtyWait == 0) && x.CartDtmx == rawData).ToList(); + if(tabGreen.Count>0) + { + displInfo("Cart already completed", true); + resetCart(); + } } else { @@ -368,10 +388,6 @@ namespace NKC_WF.WebUserControls // reset preliminare resetBin(); } - else - { - displError($"BIN: already completed: {rawData} | item {tabOKIB[0].ItemDesc} | order {tabOKIB[0].OrderExtCode}", true); - } } else { @@ -451,6 +467,7 @@ namespace NKC_WF.WebUserControls cmp_KS_OtherItemsCart.OtherItemID = codeInt; cmp_KS_OtherItemsCart.OtherItemDtmx = rawData; cmp_KS_OtherItemsCart.doUpdate(); + fixVisibility(); } /// @@ -463,6 +480,7 @@ namespace NKC_WF.WebUserControls cmp_KS_BinCart.BinID = codeInt; cmp_KS_BinCart.BinDtmx = rawData; cmp_KS_BinCart.doUpdate(); + fixVisibility(); } /// /// Imposta il cart sugli oggetti dipendenti @@ -480,36 +498,50 @@ namespace NKC_WF.WebUserControls cmp_KS_Cart.CartID = codeInt; cmp_KS_Cart.CartDtmx = rawData; cmp_KS_Cart.doUpdate(); + fixVisibility(); } private void resetBin() { cmp_KS_BinCart.BinID = 0; - cmp_KS_BinCart.doUpdate(); + fixVisibility(); } private void resetCart() { cmp_KS_BinCart.CartID = 0; - cmp_KS_BinCart.doUpdate(); cmp_KS_OtherItemsCart.CartID = 0; - cmp_KS_OtherItemsCart.doUpdate(); + cmp_KS_Cart.CartID = 0; + fixVisibility(); } private void resetOtherItem() { cmp_KS_OtherItemsCart.OtherItemID = 0; - cmp_KS_OtherItemsCart.doUpdate(); + fixVisibility(); } + /// + /// Mostra errore ed effettua reset vari... + /// + /// + /// + protected void displInfo(string infoMessage, bool resetStatus) + { + lblSuccessMsg.Text = infoMessage; + divError.Visible = false; + divInfo.Visible = true; + resetSelection(resetStatus); + } /// /// Mostra errore ed effettua reset vari... /// /// /// - protected void displError(string errorMessage, bool resetStatus) + protected void displError(string errorMessage, bool resetStatus) { lblErrorMsg.Text = errorMessage; - divItemError.Visible = true; + divError.Visible = true; + divInfo.Visible = false; resetSelection(resetStatus); } /// @@ -548,7 +580,7 @@ namespace NKC_WF.WebUserControls { resetShowData(); divItemDet.Visible = showItem; - divItemError.Visible = showError; + divError.Visible = showError; if (showError) { displError("Item not found", true); @@ -595,68 +627,6 @@ namespace NKC_WF.WebUserControls } lbtResetSel.Visible = (itemIdSelected != 0); } - /// - /// Mostra o nasconde dettaglio su OTHER ITEM letto - /// - /// - /// - /// - private void showOtherItemDetail(bool showItem, DS_App.OtherItemRow otherItemRow, bool showError) - { - resetShowData(); - divItemDet.Visible = showItem; - divItemError.Visible = showError; - if (showError) - { - displError("Other Item not found", true); - } - if (showItem) - { - lblItemCode.Text = otherItemRow.OtherItemExtCode; - lblItemDesc.Text = otherItemRow.OtherItemDesc; - lblItemDtmx.Text = otherItemRow.OtherItemDtmx; - itemIdSelected = otherItemRow.OtherItemID; - //// CONTROLLO SIA in stato 1 --> worked, 2--> selected, 100--> parked... - //switch (otherItemRow.StatusID) - //{ - // case 0: - // displError("ERROR: Item not ready", false); - // break; - // case 1: - // case 2: - // case 100: - // // salvo che è in STATO 2 (picked up) - // DataLayer.man.taIL.updateStatus(otherItemRow.ItemID, 2, PlaceId); - // // verifico cosa devo mostrare come PROX passaggio... - // showCart = otherItemRow.ProcessesReq == ""; - // showBin = (otherItemRow.ProcessesReq.Contains("PaintFlag")); - // secOp = otherItemRow.PostProcList; - // showSecOp = (secOp != ""); - // doUpdate(); - // break; - // case 3: - // displError("Item already on CART!", false); - // break; - // case 4: - // // fino a concorrenza qta richiesta sposto, POI do errori - // displError("ALL Item already scanned on BIN!", false); - // break; - // case 5: - // displError("Item already at KIT STATION!", false); - // break; - // case 990: - // displError("Item declared SCRAP!", false); - // break; - // case 991: - // displError("Item declared SCRAP with CNC program created!", false); - // break; - // default: - // displError("ERROR: Item status UNKNOWN!", false); - // break; - //} - } - lbtResetSel.Visible = (itemIdSelected != 0); - } public int itemIdSelected { @@ -701,16 +671,16 @@ namespace NKC_WF.WebUserControls } private void doUpdate() + { + fixVisibility(); + } + + private void fixVisibility() { // reset grafico - if (cmp_KS_BinCart.BinID > 0 || cmp_KS_BinCart.CartID > 0) - { - cmp_KS_BinCart.Visible = true; - } - if (cmp_KS_OtherItemsCart.OtherItemID > 0 || cmp_KS_OtherItemsCart.CartID > 0) - { - cmp_KS_OtherItemsCart.Visible = true; - } + cmp_KS_Cart.Visible = cmp_KS_Cart.CartID > 0 && (cmp_KS_BinCart.BinID + cmp_KS_OtherItemsCart.OtherItemID == 0); + cmp_KS_BinCart.Visible = cmp_KS_BinCart.BinID > 0; + cmp_KS_OtherItemsCart.Visible = cmp_KS_OtherItemsCart.OtherItemID > 0; // fix btn reset! lbtResetSel.Visible = (itemIdSelected != 0); diff --git a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.designer.cs index 8086de8..70265cf 100644 --- a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.designer.cs @@ -77,15 +77,6 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.HiddenField hfLastValidBCode; - /// - /// Controllo cmp_KS_Cart. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::NKC_WF.WebUserControls.cmp_KS_Cart cmp_KS_Cart; - /// /// Controllo cmp_KS_BinCart. /// @@ -104,6 +95,15 @@ namespace NKC_WF.WebUserControls /// protected global::NKC_WF.WebUserControls.cmp_KS_OtherItemsCart cmp_KS_OtherItemsCart; + /// + /// Controllo cmp_KS_Cart. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::NKC_WF.WebUserControls.cmp_KS_Cart cmp_KS_Cart; + /// /// Controllo divItemDet. /// @@ -150,13 +150,13 @@ namespace NKC_WF.WebUserControls protected global::System.Web.UI.WebControls.Label lblItemDtmx; /// - /// Controllo divItemError. + /// Controllo divError. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl divItemError; + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divError; /// /// Controllo lblErrorMsg. @@ -167,6 +167,24 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.Label lblErrorMsg; + /// + /// Controllo divInfo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divInfo; + + /// + /// Controllo lblSuccessMsg. + /// + /// + /// 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.Label lblSuccessMsg; + /// /// Controllo lbtCancel. ///