Start LabelsPrint page
This commit is contained in:
@@ -1 +1,64 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_labelsPrint.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_labelsPrint" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/cmp_barcode.ascx" TagPrefix="uc1" TagName="cmp_barcode" %>
|
||||
|
||||
<div class="mx-0">
|
||||
<asp:HiddenField ID="hfBatchID" runat="server" />
|
||||
<asp:HiddenField ID="hfSheetID" runat="server" />
|
||||
<asp:HiddenField ID="hfDeviceId" runat="server" />
|
||||
<div class="card text-center" style="width: 100%;">
|
||||
<h4 class="card-header p-1 bg-secondary text-light"><%: traduci("LabelPrintSmart") %></h4>
|
||||
<div class="card-body py-1">
|
||||
<div class="row mt-2" style="min-height: 25rem;">
|
||||
<div class="col-12 px-0">
|
||||
<uc1:cmp_barcode runat="server" ID="cmp_barcode" />
|
||||
<asp:HiddenField runat="server" ID="hfLastBCode" />
|
||||
<asp:HiddenField runat="server" ID="hfLastObject" />
|
||||
<asp:HiddenField runat="server" ID="hfLastValidBCode" />
|
||||
</div>
|
||||
<div class="col-12 px-0">
|
||||
area per funzioni specifiche di ri-stampa...
|
||||
</div>
|
||||
<div class="col-12 px-0">
|
||||
<div runat="server" id="divItemDet" class="bg-success text-warning small" visible="false">
|
||||
<asp:HiddenField runat="server" ID="hfItemID" />
|
||||
<div class="row">
|
||||
<div class="col-3 pr-0">
|
||||
<b>
|
||||
<asp:Label runat="server" ID="lblItemCode" /></b>
|
||||
</div>
|
||||
<div class="col-6 px-1">
|
||||
<asp:Label runat="server" ID="lblItemDesc" />
|
||||
</div>
|
||||
<div class="col-3 pl-0">
|
||||
<asp:Label runat="server" ID="lblItemDtmx" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="divError" class="bg-danger text-warning" visible="false">
|
||||
<div class="col-12 px-1">
|
||||
<asp:Label runat="server" ID="lblErrorMsg" />
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="divInfo" class="bg-info text-light" visible="false">
|
||||
<div class="col-12 px-1">
|
||||
<asp:Label runat="server" ID="lblSuccessMsg" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 px-0">
|
||||
<asp:LinkButton runat="server" ID="lbtCancel" CssClass="btn btn-block btn-warning text-uppercase" OnClick="lbtCancel_Click"><i class="fa fa-ban" aria-hidden="true"></i> <%: traduci("cancel") %></asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-12 px-0">
|
||||
<b>
|
||||
<asp:Label runat="server" ID="lblLastBCode" /></b><br />
|
||||
<asp:Label runat="server" ID="lblMessage" /><br />
|
||||
<asp:Label runat="server" ID="lblDestination" />
|
||||
</div>
|
||||
<div class="col-12 px-0">
|
||||
<asp:LinkButton runat="server" ID="lbtResetSel" CssClass="btn btn-block btn-warning text-uppercase" OnClick="lbtResetSel_Click"><i class="fa fa-ban" aria-hidden="true"></i> <%: traduci("ResetSel") %></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using AppData;
|
||||
using NKC_SDK;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -7,11 +10,763 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.WebUserControls
|
||||
{
|
||||
public partial class cmp_labelsPrint : System.Web.UI.UserControl
|
||||
public partial class cmp_labelsPrint : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// ID univoco da IP
|
||||
/// </summary>
|
||||
protected string DeviceId
|
||||
{
|
||||
set
|
||||
{
|
||||
hfDeviceId.Value = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return hfDeviceId.Value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Postazione attuale (per ora cablata)
|
||||
/// </summary>
|
||||
protected string PlaceId
|
||||
{
|
||||
get
|
||||
{
|
||||
return "WRK001";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sheet selezionato...
|
||||
/// </summary>
|
||||
protected int SheetID
|
||||
{
|
||||
set
|
||||
{
|
||||
hfSheetID.Value = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(hfSheetID.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiorna dati correnti (IP, batch, sheet...)
|
||||
/// </summary>
|
||||
protected void updateCurrData()
|
||||
{
|
||||
// FORSE 5/5?!?
|
||||
var sheetList = DataLayer.man.taSHL.getByMLStatus(PackListID, 3, 5);
|
||||
if (sheetList.Count > 0)
|
||||
{
|
||||
SheetID = sheetList[0].SheetID;
|
||||
}
|
||||
DeviceId = ComLib.GetIPAddress().Replace(".", "0").Replace(":", "0");
|
||||
}
|
||||
/// <summary>
|
||||
/// PackList corrente...
|
||||
/// </summary>
|
||||
public int PackListID
|
||||
{
|
||||
set
|
||||
{
|
||||
hfBatchID.Value = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(hfBatchID.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
lastObject = "";
|
||||
resetShowData();
|
||||
resetIcons();
|
||||
updateCurrData();
|
||||
}
|
||||
cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh;
|
||||
cmp_barcode.eh_doReset += Cmp_barcode_eh_doReset;
|
||||
#if false
|
||||
cmp_KS_BinCart.eh_doRefresh += cmp_KS_BinCart_eh_doRefresh;
|
||||
cmp_KS_OtherItemsCart.eh_doRefresh += cmp_KS_OtherItemsCart_eh_doRefresh;
|
||||
#endif
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
#if false
|
||||
cmp_KS_Cart.Visible = false;
|
||||
cmp_KS_BinCart.Visible = false;
|
||||
cmp_KS_OtherItemsCart.Visible = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Comando barcode letto
|
||||
/// </summary>
|
||||
protected string lastCmd
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfLastBCode.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfLastBCode.Value = value;
|
||||
lastValidCmd = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Ultimo object letto
|
||||
/// </summary>
|
||||
protected string lastObject
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfLastObject.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfLastObject.Value = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ULTIMO Comando barcode VALIDO (!="") letto
|
||||
/// </summary>
|
||||
protected string lastValidCmd
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfLastValidBCode.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
// solo se è !=""
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
hfLastValidBCode.Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void Cmp_barcode_eh_doReset(object sender, EventArgs e)
|
||||
{
|
||||
resetIcons();
|
||||
}
|
||||
|
||||
private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e)
|
||||
{
|
||||
bool doRaiseEv = false;
|
||||
// processo evento..
|
||||
lastCmd = cmp_barcode.inputAcquired.ToUpper();
|
||||
doRaiseEv = processLastCmd(doRaiseEv);
|
||||
|
||||
// reset comando
|
||||
cmp_barcode.inputAcquired = "";
|
||||
// aggiorno...
|
||||
doUpdate();
|
||||
if (doRaiseEv)
|
||||
{
|
||||
raiseEvent();
|
||||
}
|
||||
}
|
||||
|
||||
private bool processLastCmd(bool doRaiseEv)
|
||||
{
|
||||
if (string.IsNullOrEmpty(lastCmd)) doRaiseEv = true;
|
||||
// processiamo barcode letto
|
||||
decodedData decoData = DataLayer.man.decodeBcode(lastCmd);
|
||||
switch (decoData.codeType)
|
||||
{
|
||||
case codeType.UNK:
|
||||
cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action");
|
||||
resetSelection(false);
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Item:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid IT Code: {decoData.rawData}");
|
||||
//processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
case codeType.ItemGeneric:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid IG Code: {decoData.rawData}");
|
||||
//processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
case codeType.OtherItem:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid Generic PART Code: {decoData.rawData}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
case codeType.Material:
|
||||
cmp_barcode.showOutput("badge badge-warning", $"Material - ignored: {decoData.description}");
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Sheet:
|
||||
cmp_barcode.showOutput("badge badge-warning", $"Sheet - ignored: {decoData.description}");
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Stack:
|
||||
cmp_barcode.showOutput("badge badge-warning", $"BUNK - ignored: {decoData.description}");
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Batch:
|
||||
cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}");
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Cart:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid CR Code: {decoData.description}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Bin:
|
||||
cmp_barcode.showOutput("badge badge-warning", $"BIN NOT PAINTED - Ignored: {decoData.description}");
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.BinProcessed:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid BP Code: {decoData.description}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
default:
|
||||
cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action");
|
||||
resetSelection(false);
|
||||
break;
|
||||
}
|
||||
return doRaiseEv;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Processo il DataMatrix letto
|
||||
/// </summary>
|
||||
/// <param name="tipoCod"></param>
|
||||
/// <param name="rawData"></param>
|
||||
/// <param name="codeInt"></param>
|
||||
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)
|
||||
{
|
||||
case codeType.Cart:
|
||||
// primo step: verifico dal codice CART l'ordine da cui deriva...
|
||||
var tabOrdini = DataLayer.man.taOL.getByCart(rawData);
|
||||
if (tabOrdini.Count == 0)
|
||||
{
|
||||
displError($"CART: Order not found for Cart {rawData}, please retry", true);
|
||||
resetCart();
|
||||
}
|
||||
else
|
||||
{
|
||||
var rigaOrd = tabOrdini[0];
|
||||
// ora si va sulla tab delle PackListDet x cercare ordine legato al Cart... prendo quella attiva!
|
||||
var tabPLD = DataLayer.man.taPLD.getRunByOrdExtCode(rigaOrd.OrderExtCode);
|
||||
// controllo se trovo righe...
|
||||
if (tabPLD.Count == 0)
|
||||
{
|
||||
displError($"KIT REQuest: PackList not found for Cart {rawData} --> OrdExtCode {rigaOrd.OrderExtCode}, please retry", true);
|
||||
resetCart();
|
||||
}
|
||||
else
|
||||
{
|
||||
// mostro CART!
|
||||
setCart(rawData, codeInt);
|
||||
// verifico se il cart sia già stato messo in scarico (in quel caso dico già ok...)
|
||||
var tabLog = DataLayer.man.taPLog.getByCartId(codeInt);
|
||||
if (tabLog.Count > 0)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
// verifico se sia SECONDA lettura
|
||||
if (lastObject == rawData)
|
||||
{
|
||||
// --> metto cart in scarico e registro LOG come se avesse appena letto 1:1 ogni Dtmx
|
||||
DataLayer.man.taPLog.closeCart(codeInt);
|
||||
// mostro che ho fatto
|
||||
displInfo($"OK: CART removed {rawData}", true);
|
||||
lastObject = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
lastObject = rawData;
|
||||
displInfo($"Cart already completed, please read CART another time: Cart {rawData}", true);
|
||||
}
|
||||
resetCart();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// recupero da tab di check complessiva
|
||||
var tabPLCheck = DataLayer.man.taPLC.GetData(rawData);
|
||||
if (tabPLCheck.Count == 0)
|
||||
{
|
||||
displError($"ERROR evaluating CART: {rawData}", true);
|
||||
resetCart();
|
||||
}
|
||||
else
|
||||
{
|
||||
var rigaCheck = tabPLCheck[0];
|
||||
// verifico penalty (vedere stored: pezzi da leggere >= pezzi del cart...)
|
||||
if (rigaCheck.NumPenalty == 0)
|
||||
{
|
||||
// verifico se sia SECONDA lettura
|
||||
if (lastObject == rawData)
|
||||
{
|
||||
// --> metto cart in scarico e registro LOG come se avesse appena letto 1:1 ogni Dtmx
|
||||
DataLayer.man.taPLog.acquireCart(rawData, currIpAddress(), user_std.UtSn.userNameAD);
|
||||
displInfo($"OK: CART acquired {rawData} - item confirmed", true);
|
||||
lastObject = "";
|
||||
// eseguo comando x spostare i PAINT nel cart corretto...
|
||||
DataLayer.man.taKL.updateCartForBin(rawData);
|
||||
}
|
||||
else
|
||||
{
|
||||
lastObject = rawData;
|
||||
displError($"Please read CART another time: Cart {rawData}", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
displError($"ERROR CART contains KIT already on download: {rawData}", true);
|
||||
resetCart();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case codeType.BinProcessed:
|
||||
// recupero la tab OKIB x iniziare a controllare i dati...
|
||||
var tabOKIB = DataLayer.man.taOKIB.getByBinDtmxProc(rawData);
|
||||
// PRIMO: verifico SE ho delle righe valide...
|
||||
if (tabOKIB.Count == 0)
|
||||
{
|
||||
displError($"BIN: Code not found {rawData}, please retry", true);
|
||||
// reset preliminare
|
||||
resetBin();
|
||||
}
|
||||
else
|
||||
{
|
||||
var listPainted = tabOKIB.Where(x => !x.IsPaintDateNull()).ToList();
|
||||
if (listPainted.Count == 0)
|
||||
{
|
||||
displError($"BIN: Paint Date missing for item {tabOKIB[0].ItemDesc} | order {tabOKIB[0].OrderExtCode}, please retry", true);
|
||||
// reset preliminare
|
||||
resetBin();
|
||||
}
|
||||
else
|
||||
{
|
||||
var listAvailable = tabOKIB.Where(x => !x.IsPaintDateNull() && x.IsOnCartDateNull()).ToList();
|
||||
if (listAvailable.Count == 0)
|
||||
{
|
||||
displError($"BIN: No item available for pickup on target CART for code {rawData} | item {tabOKIB[0].ItemDesc} | order {tabOKIB[0].OrderExtCode}, please retry", true);
|
||||
// reset preliminare
|
||||
resetBin();
|
||||
}
|
||||
else
|
||||
{
|
||||
// verifico SE ci sia ALMENO UN CART in postazione (iniziato KIT ma NON finito)...
|
||||
var listCartAvailable = tabOKIB.Where(x => !x.IsCartKitStartNull() && x.IsCartKitEndNull()).ToList();
|
||||
if (listCartAvailable.Count == 0)
|
||||
{
|
||||
displError($"BIN: No CART available to proceed: {rawData} | item {tabOKIB[0].ItemDesc} | order {tabOKIB[0].OrderExtCode}", true);
|
||||
// reset preliminare
|
||||
resetBin();
|
||||
}
|
||||
else
|
||||
{
|
||||
// mostro BIN!
|
||||
setBin(rawData, codeInt);
|
||||
|
||||
|
||||
// verifico se il Bin sia già stato messo in scarico (in quel caso dico già ok...)
|
||||
var listBinAcquired = tabOKIB.Where(x => !x.IsCartKitStartNull() && x.IsCartKitEndNull() && !x.IsBinKitStartNull()).ToList();
|
||||
if (listBinAcquired.Count > 0)
|
||||
{
|
||||
// verifico se sia GIA' stato completato KIT...
|
||||
var listBinNotCompleted = tabOKIB.Where(x => !x.IsCartKitStartNull() && x.IsCartKitEndNull() && !x.IsBinKitStartNull() && x.IsBinKitEndNull()).ToList();
|
||||
if (listBinNotCompleted.Count == 0)
|
||||
{
|
||||
displError($"BIN: already completed: {rawData} | item {tabOKIB[0].ItemDesc} | order {tabOKIB[0].OrderExtCode}", true);
|
||||
// reset preliminare
|
||||
resetBin();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// processing...
|
||||
if (lastObject == rawData)
|
||||
{
|
||||
// seconda lettura x indicare in scarico
|
||||
DataLayer.man.taBN.updateKitting(codeInt, true, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// chiedo seconda lettura
|
||||
lastObject = rawData;
|
||||
displError($"Please read BIN another time: BIN {rawData}", true);
|
||||
// reset preliminare
|
||||
resetBin();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
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...
|
||||
if (tabOKOI.Count == 0)
|
||||
{
|
||||
displError($"PART: Code not found {rawData}, please retry", true);
|
||||
// reset preliminare
|
||||
resetOtherItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
var listAvailable = tabOKOI.Where(x => x.IsOnCartDateNull()).ToList();
|
||||
if (listAvailable.Count == 0)
|
||||
{
|
||||
displError($"PART: No item available for pickup on target CART for code {rawData} | item {tabOKOI[0].OtherItemDesc} | order {tabOKOI[0].OrderExtCode}, please retry", true);
|
||||
// reset preliminare
|
||||
resetOtherItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
// verifico SE ci sia ALMENO UN CART in postazione (iniziato KIT ma NON finito)...
|
||||
var listCartAvailable = tabOKOI.Where(x => !x.IsCartKitStartNull() && x.IsCartKitEndNull()).ToList();
|
||||
if (listCartAvailable.Count == 0)
|
||||
{
|
||||
displError($"PART: No CART available to proceed: {rawData} | item {tabOKOI[0].OtherItemDesc} | order {tabOKOI[0].OrderExtCode}", true);
|
||||
// reset preliminare
|
||||
resetOtherItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
// mostro OtherItem!
|
||||
setOtherItem(rawData, codeInt);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
lastObject = "";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Imposta il codice OtherItem sugli oggetti dipendenti
|
||||
/// </summary>
|
||||
/// <param name="rawData"></param>
|
||||
/// <param name="codeInt"></param>
|
||||
private void setOtherItem(string rawData, int codeInt)
|
||||
{
|
||||
#if false
|
||||
cmp_KS_OtherItemsCart.OtherItemID = codeInt;
|
||||
cmp_KS_OtherItemsCart.OtherItemDtmx = rawData;
|
||||
cmp_KS_OtherItemsCart.doUpdate();
|
||||
#endif
|
||||
fixVisibility();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imposta il bin sugli oggetti dipendenti
|
||||
/// </summary>
|
||||
/// <param name="rawData"></param>
|
||||
/// <param name="codeInt"></param>
|
||||
private void setBin(string rawData, int codeInt)
|
||||
{
|
||||
#if false
|
||||
cmp_KS_BinCart.BinID = codeInt;
|
||||
cmp_KS_BinCart.BinDtmx = rawData;
|
||||
cmp_KS_BinCart.doUpdate();
|
||||
#endif
|
||||
fixVisibility();
|
||||
}
|
||||
/// <summary>
|
||||
/// Imposta il cart sugli oggetti dipendenti
|
||||
/// </summary>
|
||||
/// <param name="rawData"></param>
|
||||
/// <param name="codeInt"></param>
|
||||
private void setCart(string rawData, int codeInt)
|
||||
{
|
||||
#if false
|
||||
cmp_KS_BinCart.CartID = codeInt;
|
||||
cmp_KS_BinCart.CartDtmx = rawData;
|
||||
cmp_KS_BinCart.doUpdate();
|
||||
cmp_KS_OtherItemsCart.CartID = codeInt;
|
||||
cmp_KS_OtherItemsCart.CartDtmx = rawData;
|
||||
cmp_KS_OtherItemsCart.doUpdate();
|
||||
cmp_KS_Cart.CartID = codeInt;
|
||||
cmp_KS_Cart.CartDtmx = rawData;
|
||||
cmp_KS_Cart.doUpdate();
|
||||
#endif
|
||||
fixVisibility();
|
||||
}
|
||||
|
||||
private void resetBin()
|
||||
{
|
||||
#if false
|
||||
cmp_KS_BinCart.BinID = 0;
|
||||
#endif
|
||||
fixVisibility();
|
||||
}
|
||||
|
||||
private void resetCart()
|
||||
{
|
||||
#if false
|
||||
cmp_KS_BinCart.CartID = 0;
|
||||
cmp_KS_OtherItemsCart.CartID = 0;
|
||||
cmp_KS_Cart.CartID = 0;
|
||||
#endif
|
||||
fixVisibility();
|
||||
}
|
||||
private void resetOtherItem()
|
||||
{
|
||||
#if false
|
||||
cmp_KS_OtherItemsCart.OtherItemID = 0;
|
||||
#endif
|
||||
fixVisibility();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mostra errore ed effettua reset vari...
|
||||
/// </summary>
|
||||
/// <param name="infoMessage"></param>
|
||||
/// <param name="resetStatus"></param>
|
||||
protected void displInfo(string infoMessage, bool resetStatus)
|
||||
{
|
||||
lblSuccessMsg.Text = infoMessage;
|
||||
divError.Visible = false;
|
||||
divInfo.Visible = true;
|
||||
resetSelection(resetStatus);
|
||||
}
|
||||
/// <summary>
|
||||
/// Mostra errore ed effettua reset vari...
|
||||
/// </summary>
|
||||
/// <param name="errorMessage"></param>
|
||||
/// <param name="resetStatus"></param>
|
||||
protected void displError(string errorMessage, bool resetStatus)
|
||||
{
|
||||
lblErrorMsg.Text = errorMessage;
|
||||
divError.Visible = true;
|
||||
divInfo.Visible = false;
|
||||
resetSelection(resetStatus);
|
||||
}
|
||||
/// <summary>
|
||||
/// Reset selezione item + blocchi suggerimento + sel REDIS x pagina unload
|
||||
/// </summary>
|
||||
/// <param name="resetStatus"></param>
|
||||
protected void resetSelection(bool resetStatus)
|
||||
{
|
||||
if (resetStatus)
|
||||
{
|
||||
try
|
||||
{
|
||||
// SE item esiste...
|
||||
var tabItem = DataLayer.man.taIL.getBySearch(itemIdSelected, itemIdSelected.ToString(), 0, 999);
|
||||
if (tabItem.Count == 1)
|
||||
{
|
||||
// riposto item a status 1...
|
||||
DataLayer.man.taIL.updateStatus(itemIdSelected, 1, PlaceId);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
// elimino item sel...
|
||||
itemIdSelected = 0;
|
||||
resetShowData();
|
||||
ComLib.resetItemPickup(SheetID, DeviceId);
|
||||
}
|
||||
/// <summary>
|
||||
/// Mostra o nasconde dettaglio su ITEM letto
|
||||
/// </summary>
|
||||
/// <param name="showItem"></param>
|
||||
/// <param name="itemRow"></param>
|
||||
/// <param name="showError"></param>
|
||||
private void showItemDetail(bool showItem, DS_App.ItemListRow itemRow, bool showError)
|
||||
{
|
||||
resetShowData();
|
||||
divItemDet.Visible = showItem;
|
||||
divError.Visible = showError;
|
||||
if (showError)
|
||||
{
|
||||
displError("Item not found", true);
|
||||
}
|
||||
if (showItem)
|
||||
{
|
||||
lblItemCode.Text = itemRow.ItemExtCode;
|
||||
lblItemDesc.Text = itemRow.ItemDesc;
|
||||
lblItemDtmx.Text = itemRow.ItemDtmx;
|
||||
itemIdSelected = itemRow.ItemID;
|
||||
// CONTROLLO SIA in stato 1 --> worked, 2--> selected, 100--> parked...
|
||||
switch (itemRow.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(itemRow.ItemID, 2, PlaceId);
|
||||
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
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(hfItemID.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfItemID.Value = value.ToString();
|
||||
bool showBtn = value != 0;
|
||||
// fix visibilità
|
||||
lbtCancel.Visible = showBtn;
|
||||
}
|
||||
}
|
||||
|
||||
private void resetIcons()
|
||||
{
|
||||
lblDestination.CssClass = "text-secondary";
|
||||
lblMessage.Text = "";
|
||||
lblDestination.Text = "";
|
||||
lblLastBCode.Text = "";
|
||||
lbtCancel.Visible = false;
|
||||
lbtResetSel.Visible = (itemIdSelected != 0);
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
fixVisibility();
|
||||
}
|
||||
|
||||
private void fixVisibility()
|
||||
{
|
||||
// reset grafico
|
||||
#if false
|
||||
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;
|
||||
#endif
|
||||
|
||||
// fix btn reset!
|
||||
lbtResetSel.Visible = (itemIdSelected != 0);
|
||||
}
|
||||
|
||||
protected void lbtCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
// resetto item selezionato...
|
||||
DataLayer.man.taIL.updateStatus(itemIdSelected, 1, PlaceId);
|
||||
resetSelection(true);
|
||||
showItemDetail(false, null, false);
|
||||
}
|
||||
protected void lbtResetSel_Click(object sender, EventArgs e)
|
||||
{
|
||||
var tabSheet = DataLayer.man.taSHL.getByItemID(itemIdSelected);
|
||||
if (tabSheet.Count == 1)
|
||||
{
|
||||
resetShowData();
|
||||
// resetto sheet selezionato...
|
||||
DataLayer.man.taIL.updateSheetStatusPU(tabSheet[0].SheetID, PlaceId);
|
||||
resetSelection(true);
|
||||
showItemDetail(false, null, false);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposto a parcheggiato
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtParkArea_Click(object sender, EventArgs e)
|
||||
{
|
||||
// resetto item selezionato...
|
||||
DataLayer.man.taIL.updateStatus(itemIdSelected, 100, PlaceId);
|
||||
resetSelection(true);
|
||||
showItemDetail(false, null, false);
|
||||
lblMessage.Text = "Item Parked";
|
||||
}
|
||||
/// <summary>
|
||||
/// Imposto come danneggiato/scrapped da rilavorare offline
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtScrapped_Click(object sender, EventArgs e)
|
||||
{
|
||||
// resetto item selezionato...
|
||||
DataLayer.man.taIL.updateStatus(itemIdSelected, 990, PlaceId);
|
||||
lblMessage.Text = "Item Set SCRAPPED";
|
||||
// rirprocesso barcode...
|
||||
lastCmd = lastValidCmd;
|
||||
processLastCmd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+192
-3
@@ -1,10 +1,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </auto-generated>
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.WebUserControls
|
||||
@@ -13,5 +13,194 @@ namespace NKC_WF.WebUserControls
|
||||
|
||||
public partial class cmp_labelsPrint
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfBatchID.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfBatchID;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfSheetID.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfSheetID;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfDeviceId.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfDeviceId;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo cmp_barcode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_barcode cmp_barcode;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfLastBCode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfLastBCode;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfLastObject.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfLastObject;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfLastValidBCode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfLastValidBCode;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divItemDet.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divItemDet;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfItemID.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfItemID;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblItemCode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblItemDesc.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblItemDesc;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblItemDtmx.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblItemDtmx;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divError.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divError;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblErrorMsg.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblErrorMsg;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divInfo.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblSuccessMsg.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblSuccessMsg;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtCancel.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtCancel;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblLastBCode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblLastBCode;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblMessage.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblMessage;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblDestination.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDestination;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtResetSel.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtResetSel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="LabelsPrint.aspx.cs" Inherits="NKC_WF.site.LabelsPrint" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/tpl_WIP.ascx" TagPrefix="uc1" TagName="tpl_WIP" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_labelsPrint.ascx" TagPrefix="uc1" TagName="cmp_labelsPrint" %>
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div class="container px-1">
|
||||
<uc1:tpl_WIP runat="server" ID="tpl_WIP" />
|
||||
</div>
|
||||
<uc1:cmp_labelsPrint runat="server" ID="cmp_labelsPrint" />
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
Generated
+2
-2
@@ -15,12 +15,12 @@ namespace NKC_WF.site
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo tpl_WIP.
|
||||
/// Controllo cmp_labelsPrint.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.tpl_WIP tpl_WIP;
|
||||
protected global::NKC_WF.WebUserControls.cmp_labelsPrint cmp_labelsPrint;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user