Iniziata decodifica items
This commit is contained in:
@@ -8,6 +8,8 @@ namespace AppData
|
||||
#region oggetti public
|
||||
|
||||
public DS_AppTableAdapters.BatchListTableAdapter taBL;
|
||||
public DS_AppTableAdapters.BinsTableAdapter taBN;
|
||||
public DS_AppTableAdapters.CartsTableAdapter taCR;
|
||||
public DS_AppTableAdapters.ItemListTableAdapter taIL;
|
||||
public DS_AppTableAdapters.MaterialsTableAdapter taMat;
|
||||
public DS_AppTableAdapters.OrderListTableAdapter taOL;
|
||||
@@ -29,6 +31,8 @@ namespace AppData
|
||||
{
|
||||
string connString = memLayer.ML.CRS("NKC_WFConnectionString");
|
||||
taBL.Connection.ConnectionString = connString;
|
||||
taBN.Connection.ConnectionString = connString;
|
||||
taCR.Connection.ConnectionString = connString;
|
||||
taIL.Connection.ConnectionString = connString;
|
||||
taMat.Connection.ConnectionString = connString;
|
||||
taOL.Connection.ConnectionString = connString;
|
||||
@@ -42,6 +46,8 @@ namespace AppData
|
||||
private void initTA()
|
||||
{
|
||||
taBL = new DS_AppTableAdapters.BatchListTableAdapter();
|
||||
taBN = new DS_AppTableAdapters.BinsTableAdapter();
|
||||
taCR = new DS_AppTableAdapters.CartsTableAdapter();
|
||||
taIL = new DS_AppTableAdapters.ItemListTableAdapter();
|
||||
taMat = new DS_AppTableAdapters.MaterialsTableAdapter();
|
||||
taOL = new DS_AppTableAdapters.OrderListTableAdapter();
|
||||
|
||||
@@ -13,6 +13,28 @@
|
||||
<uc1:cmp_barcode runat="server" ID="cmp_barcode" />
|
||||
<asp:HiddenField runat="server" ID="hfBarcode" />
|
||||
</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="divItemError" class="bg-danger text-warning" visible="false">
|
||||
<div class="col-12 px-1">
|
||||
<asp:Label runat="server" ID="lblErrorMsg" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 px-0">
|
||||
<div class="row small">
|
||||
<div class="col-4 pr-1">
|
||||
@@ -27,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 px-0">
|
||||
<asp:LinkButton runat="server" ID="lbtCancel" CssClass="btn btn-block btn-warning text-uppercase"><i class="fa fa-ban" aria-hidden="true"></i> <%: traduci("cancel") %></asp:LinkButton>
|
||||
<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>
|
||||
|
||||
@@ -49,11 +49,11 @@ namespace NKC_WF
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Item:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Item recognized: {decoData.rawData}");
|
||||
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", $"Item recognized: {decoData.rawData}");
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid IG Code: {decoData.rawData}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
case codeType.Material:
|
||||
@@ -73,11 +73,11 @@ namespace NKC_WF
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Cart:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Cart recognized: {decoData.description}");
|
||||
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", $"Bin recognized: {decoData.description}");
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
default:
|
||||
@@ -107,7 +107,40 @@ namespace NKC_WF
|
||||
/// <param name="codeInt"></param>
|
||||
private void processItemSuggestion(codeType tipoCod, string rawData, int codeInt)
|
||||
{
|
||||
// processo suggerimenti x ITEM dato suo RawData (Dtmx) e Cod univoco (intero)
|
||||
DS_App.ItemListDataTable tabItem = null;
|
||||
// processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero)
|
||||
switch (tipoCod)
|
||||
{
|
||||
case codeType.Item:
|
||||
tabItem = DataLayer.man.taIL.getBySearch(codeInt, rawData);
|
||||
if (tabItem.Count == 1)
|
||||
{
|
||||
showItemDetail(true, tabItem[0], false);
|
||||
}
|
||||
else if (tabItem.Count == 0)
|
||||
{
|
||||
showItemDetail(false, null, true);
|
||||
}
|
||||
break;
|
||||
case codeType.ItemGeneric:
|
||||
tabItem = DataLayer.man.taIL.getBySearch(0, rawData);
|
||||
if (tabItem.Count == 1)
|
||||
{
|
||||
showItemDetail(true, tabItem[0], false);
|
||||
}
|
||||
else if (tabItem.Count == 0)
|
||||
{
|
||||
showItemDetail(false, null, true);
|
||||
}
|
||||
break;
|
||||
case codeType.Cart:
|
||||
break;
|
||||
case codeType.Bin:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// cerco su DB
|
||||
|
||||
@@ -126,6 +159,43 @@ namespace NKC_WF
|
||||
lblDestination.Text = "SEND TO CART CR00012";
|
||||
lblDestination.CssClass = "text-success";
|
||||
}
|
||||
/// <summary>
|
||||
/// Mostra o nasconde dettaglio su ITEM letto
|
||||
/// </summary>
|
||||
/// <param name="v"></param>
|
||||
/// <param name="itemRow"></param>
|
||||
private void showItemDetail(bool showItem, DS_App.ItemListRow itemRow, bool showError)
|
||||
{
|
||||
divItemDet.Visible = showItem;
|
||||
divItemError.Visible = showError;
|
||||
if (showError)
|
||||
{
|
||||
lblErrorMsg.Text = "Item not found";
|
||||
itemIdSelected = 0;
|
||||
}
|
||||
if (showItem)
|
||||
{
|
||||
lblItemCode.Text = itemRow.ItemExtCode;
|
||||
lblItemDesc.Text = itemRow.ItemDesc;
|
||||
lblItemDtmx.Text = itemRow.ItemDtmx;
|
||||
itemIdSelected = itemRow.ItemID;
|
||||
}
|
||||
}
|
||||
|
||||
public int itemIdSelected
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(hfItemID.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfItemID.Value = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void resetIcons()
|
||||
{
|
||||
@@ -171,5 +241,12 @@ namespace NKC_WF
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
protected void lbtCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
// resetto item selezionato...
|
||||
itemIdSelected = 0;
|
||||
showItemDetail(false, null, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+63
@@ -30,6 +30,69 @@ namespace NKC_WF {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfBarcode;
|
||||
|
||||
/// <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 divItemError.
|
||||
/// </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 divItemError;
|
||||
|
||||
/// <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 icnCart.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user