update continuo gestione search
This commit is contained in:
@@ -1 +1,12 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_searchItems.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_searchItems" %>
|
||||
|
||||
<div class=" border border-success rounded table-success">
|
||||
<div class="row" style="font-size: 2em;">
|
||||
<div class="col-md-3 text-center">
|
||||
<asp:Label runat="server" ID="lblSearch" Text="..." CssClass="font-weight-bold" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<asp:Label runat="server" ID="lblDescr" Text="-" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+21
-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,23 @@ namespace NKC_WF.WebUserControls
|
||||
|
||||
public partial class cmp_searchItems
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblSearch.
|
||||
/// </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 lblSearch;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblDescr.
|
||||
/// </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 lblDescr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div class="display-4 text-center border border-info rounded mb-2">Advanced <span class="text-info">SEARCH</span></div>
|
||||
<uc1:cmp_barcode runat="server" ID="cmp_barcode" />
|
||||
<uc1:cmp_searchItems runat="server" id="cmp_searchItems" />
|
||||
<asp:HiddenField runat="server" ID="hfLastBCode" />
|
||||
<asp:HiddenField runat="server" ID="hfLastValidBCode" />
|
||||
<uc1:cmp_searchItems runat="server" ID="cmp_searchItems" />
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using AppData;
|
||||
using NKC_SDK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -7,14 +9,298 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
public partial class GlobalSearch : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class GlobalSearch : System.Web.UI.Page
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
((SiteContent)this.Master).showSearch = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Comando barcode letto
|
||||
/// </summary>
|
||||
protected string lastCmd
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfLastBCode.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfLastBCode.Value = value;
|
||||
lastValidCmd = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ULTIMO Comando barcode VALIDO (!="") letto
|
||||
/// </summary>
|
||||
protected string lastValidCmd
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfLastValidBCode.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
// solo se è !=""
|
||||
if (value != "")
|
||||
{
|
||||
hfLastValidBCode.Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
((SiteContent)this.Master).showSearch = false;
|
||||
cmp_searchItems.Visible = false;
|
||||
}
|
||||
cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh;
|
||||
cmp_barcode.eh_doReset += Cmp_barcode_eh_doReset;
|
||||
}
|
||||
|
||||
private void Cmp_barcode_eh_doReset(object sender, EventArgs e)
|
||||
{
|
||||
cmp_searchItems.Visible = false;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private bool processLastCmd(bool doRaiseEv)
|
||||
{
|
||||
if (lastCmd == "") doRaiseEv = true;
|
||||
// processiamo barcode letto
|
||||
decodedData decoData = DataLayer.man.decodeBcode(lastCmd);
|
||||
#if false
|
||||
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);
|
||||
break;
|
||||
case codeType.Bin:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid BN 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;
|
||||
}
|
||||
#endif
|
||||
|
||||
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;
|
||||
#if false
|
||||
// processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero)
|
||||
switch (tipoCod)
|
||||
{
|
||||
case codeType.OtherItem:
|
||||
var tabOtherItem = DataLayer.man.taOtItem.getByKey(codeInt);
|
||||
if (tabOtherItem.Count == 1)
|
||||
{
|
||||
showOtherItemDetail(true, tabOtherItem[0], false);
|
||||
}
|
||||
break;
|
||||
case codeType.Item:
|
||||
tabItem = DataLayer.man.taIL.getBySearch(codeInt, rawData, 0, 999);
|
||||
if (tabItem.Count == 1)
|
||||
{
|
||||
showItemDetail(true, tabItem[0], false);
|
||||
}
|
||||
else if (tabItem.Count == 0)
|
||||
{
|
||||
showItemDetail(false, null, true);
|
||||
}
|
||||
break;
|
||||
case codeType.ItemGeneric:
|
||||
// PRIMA CERCSE ne ho in stato 1..3
|
||||
tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 3);
|
||||
if (tabItem.Count == 0)
|
||||
{
|
||||
// se NON ne trovo cerci FINO a stato 5...
|
||||
tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 5);
|
||||
}
|
||||
if (tabItem.Count == 1)
|
||||
{
|
||||
showItemDetail(true, tabItem[0], false);
|
||||
}
|
||||
else if (tabItem.Count == 0)
|
||||
{
|
||||
showItemDetail(false, null, true);
|
||||
}
|
||||
break;
|
||||
case codeType.Cart:
|
||||
// verifico NON SIA richiesto PAINT
|
||||
if (showBin)
|
||||
{
|
||||
displError("PAINT: BIN REQUESTED: please retry", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currCartTab.Count == 1)
|
||||
{
|
||||
// controllo se sia quello corretto
|
||||
if (rawData != currCartTab[0].CartDtmx)
|
||||
{
|
||||
displError("INCORRECT CART: please retry", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// dichiaro che è depositato
|
||||
DataLayer.man.taIL.updateStatus(itemIdSelected, 3, PlaceId);
|
||||
lblDestination.Text = $"Item {itemIdSelected} PUT IN CART {rawData}";
|
||||
resetSelection(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case codeType.Bin:
|
||||
// verifico NON SIA richiesto PAINT
|
||||
if (showCart)
|
||||
{
|
||||
displError("NOT PAINTED: CART REQUESTED: please retry", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currBinTab.Count == 1)
|
||||
{
|
||||
// controllo se sia quello corretto
|
||||
if (rawData != currBinTab[0].BinDtmx)
|
||||
{
|
||||
displError("INCORRECT BIN: please retry", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// dichiaro che è depositato
|
||||
DataLayer.man.taIL.updateStatus(itemIdSelected, 4, PlaceId);
|
||||
lblDestination.Text = $"Item {itemIdSelected} PUT IN BIN {rawData}";
|
||||
resetSelection(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void doUpdate()
|
||||
{
|
||||
cmp_searchItems.Visible = true;
|
||||
#if false
|
||||
// reset grafico
|
||||
icnCart.Attributes.Remove("class");
|
||||
icnCart.Attributes.Add("class", "btn btn-sm btn-block btn-outline-secondary");
|
||||
icnBin.Attributes.Remove("class");
|
||||
icnBin.Attributes.Add("class", "btn btn-sm btn-block btn-outline-secondary");
|
||||
icnSecOp.Attributes.Remove("class");
|
||||
icnSecOp.Attributes.Add("class", "btn btn-sm btn-block btn-outline-secondary");
|
||||
|
||||
// in base al secondo mostro uno o altro...
|
||||
if (showCart)
|
||||
{
|
||||
icnCart.Attributes.Remove("class");
|
||||
icnCart.Attributes.Add("class", "btn btn-sm btn-block btn-success");
|
||||
lblMessage.Text = "Item recognized";
|
||||
// controllo SE HO cart
|
||||
if (currCartTab.Count == 1)
|
||||
{
|
||||
var cartRow = currCartTab[0];
|
||||
// imposto OUT
|
||||
lblDestination.Text = $"SEND TO CART <b>C{cartRow.CartIndex}</b> ({cartRow.CartDtmx})";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblDestination.Text = $"ERROR SEARCHING CART: {currCartTab.Count} found!";
|
||||
}
|
||||
lblDestination.CssClass = "text-success";
|
||||
}
|
||||
else if (showBin)
|
||||
{
|
||||
icnBin.Attributes.Remove("class");
|
||||
icnBin.Attributes.Add("class", "btn btn-sm btn-block btn-primary");
|
||||
lblMessage.Text = "Item recognized";
|
||||
if (currBinTab.Count == 1)
|
||||
{
|
||||
var binRow = currBinTab[0];
|
||||
lblDestination.Text = $"SEND TO BIN <b>B{binRow.BinIndex}</b> ({binRow.BinDtmx})";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblDestination.Text = $"ERROR SEARCHING BIN: {currBinTab.Count} found!";
|
||||
}
|
||||
lblDestination.CssClass = "text-primary";
|
||||
}
|
||||
if (showSecOp)
|
||||
{
|
||||
icnSecOp.Attributes.Remove("class");
|
||||
icnSecOp.Attributes.Add("class", "btn btn-sm btn-block btn-info");
|
||||
lblMessage.Text = "Item recognized";
|
||||
lblLastBCode.Text = $"DO SEC OP: {secOp}";
|
||||
lblLastBCode.CssClass = "text-info";
|
||||
}
|
||||
// fix btn reset!
|
||||
lbtResetSel.Visible = (itemIdSelected != 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -23,6 +23,24 @@ namespace NKC_WF.site
|
||||
/// </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 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 cmp_searchItems.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user