-
-
+
\ No newline at end of file
diff --git a/MP-MAG/Web.config b/MP-MAG/Web.config
index 8c24619..bde7d6b 100644
--- a/MP-MAG/Web.config
+++ b/MP-MAG/Web.config
@@ -24,6 +24,8 @@
+
+
diff --git a/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx b/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx
new file mode 100644
index 0000000..0c52cb6
--- /dev/null
+++ b/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx
@@ -0,0 +1,47 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_OrderListByUdc.ascx.cs" Inherits="MP_MAG.WebUserControls.cmp_OrderListByUdc" %>
+
+
+
+
+
+
+
+
+
+ Nessun record trovato
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx.cs b/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx.cs
new file mode 100644
index 0000000..f926b6a
--- /dev/null
+++ b/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx.cs
@@ -0,0 +1,104 @@
+using MagData;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MP_MAG.WebUserControls
+{
+ public partial class cmp_OrderListByUdc : BaseUserControl
+ {
+ #region Public Properties
+
+ public int PackListID
+ {
+ get
+ {
+ int answ = 0;
+ int.TryParse(hfPackListID.Value, out answ);
+ return answ;
+ }
+ set
+ {
+ hfPackListID.Value = $"{value}";
+ }
+ }
+
+ ///
+ /// Ordine selezionato
+ ///
+ public int SelOrdID
+ {
+ get
+ {
+ int answ = 0;
+ if (grView.SelectedIndex >= 0)
+ {
+ int.TryParse(grView.SelectedValue.ToString(), out answ);
+ }
+ return answ;
+ }
+ }
+
+ public string UdcSel
+ {
+ get
+ {
+ return hfUdc.Value;
+ }
+ set
+ {
+ hfUdc.Value = value;
+ doUpdate();
+ }
+ }
+
+ #endregion Public Properties
+
+ #region Private Methods
+
+ private void Cmp_OrderListAdd_eh_addNew(object sender, EventArgs e)
+ {
+ resetSelezione();
+ }
+
+ private void resetSelezione()
+ {
+ grView.SelectedIndex = -1;
+ grView.DataBind();
+ raiseReset();
+ }
+
+ #endregion Private Methods
+
+ #region Protected Methods
+
+ ///
+ /// comando reset
+ ///
+ ///
+ ///
+ protected void lbtReset_Click(object sender, EventArgs e)
+ {
+ resetSelezione();
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ }
+
+ #endregion Protected Methods
+
+ #region Public Methods
+
+ public void doUpdate()
+ {
+ // calcolo il codcliente
+ grView.DataBind();
+ }
+
+ #endregion Public Methods
+ }
+}
\ No newline at end of file
diff --git a/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx.designer.cs b/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx.designer.cs
new file mode 100644
index 0000000..4868a39
--- /dev/null
+++ b/MP-MAG/WebUserControls/cmp_OrderListByUdc.ascx.designer.cs
@@ -0,0 +1,53 @@
+//------------------------------------------------------------------------------
+//
+// Codice generato da uno strumento.
+//
+// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
+// il codice viene rigenerato.
+//
+//------------------------------------------------------------------------------
+
+namespace MP_MAG.WebUserControls
+{
+
+
+ public partial class cmp_OrderListByUdc
+ {
+
+ ///
+ /// Controllo grView.
+ ///
+ ///
+ /// 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.GridView grView;
+
+ ///
+ /// Controllo ods.
+ ///
+ ///
+ /// 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.ObjectDataSource ods;
+
+ ///
+ /// Controllo hfPackListID.
+ ///
+ ///
+ /// 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.HiddenField hfPackListID;
+
+ ///
+ /// Controllo hfUdc.
+ ///
+ ///
+ /// 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.HiddenField hfUdc;
+ }
+}
diff --git a/MP-MAG/WebUserControls/cmp_PLScanner.ascx b/MP-MAG/WebUserControls/cmp_PLScanner.ascx
index b8f5e5b..d832f07 100644
--- a/MP-MAG/WebUserControls/cmp_PLScanner.ascx
+++ b/MP-MAG/WebUserControls/cmp_PLScanner.ascx
@@ -19,6 +19,7 @@
diff --git a/MP-MAG/WebUserControls/cmp_PLScanner.ascx.cs b/MP-MAG/WebUserControls/cmp_PLScanner.ascx.cs
index 14a5cc0..ae01a3d 100644
--- a/MP-MAG/WebUserControls/cmp_PLScanner.ascx.cs
+++ b/MP-MAG/WebUserControls/cmp_PLScanner.ascx.cs
@@ -28,6 +28,21 @@ namespace MP_MAG.WebUserControls
}
}
+ ///
+ /// UDC selezionato
+ ///
+ protected string LastUDC
+ {
+ get
+ {
+ return hfLastUDC.Value;
+ }
+ set
+ {
+ hfLastUDC.Value = value;
+ }
+ }
+
///
/// ULTIMO Comando barcode VALIDO (!="") letto
///
@@ -47,6 +62,63 @@ namespace MP_MAG.WebUserControls
}
}
+ ///
+ /// ID dell'ordine selezionato (per UDC)
+ ///
+ protected int SelOrdID
+ {
+ get
+ {
+ return cmp_SelUdc.SelOrdID;
+ }
+ }
+
+ ///
+ /// ID della packing list selezionata
+ ///
+ protected int SelPackList
+ {
+ get
+ {
+ return cmp_SelPackList.PackListID;
+ }
+ set
+ {
+ cmp_SelPackList.PackListID = value;
+ cmp_SelUdc.PackListID = value;
+ }
+ }
+
+ ///
+ /// Pedana selezionata
+ ///
+ protected string SelPedana
+ {
+ get
+ {
+ return cmp_SelPedana.Pedana;
+ }
+ set
+ {
+ cmp_SelPedana.Pedana = value;
+ }
+ }
+
+ ///
+ /// UDC selezionato
+ ///
+ protected string SelUDC
+ {
+ get
+ {
+ return cmp_SelUdc.UDC;
+ }
+ set
+ {
+ cmp_SelUdc.UDC = value;
+ }
+ }
+
#endregion Protected Properties
#region Private Methods
@@ -129,7 +201,7 @@ namespace MP_MAG.WebUserControls
private bool processLastCmd(bool doRaiseEv)
{
- if (lastCmd == "") doRaiseEv = true;
+ if (string.IsNullOrEmpty(lastCmd)) doRaiseEv = true;
// processiamo barcode letto
decodedData decoData = MagDataLayer.man.decodeBcode(lastValidCmd);
switch (decoData.codeType)
@@ -144,7 +216,7 @@ namespace MP_MAG.WebUserControls
break;
default:
- cmp_barcode.showOutput("text-danger", $"Codice sconosciuto: {decoData.rawData} --> ignoro");
+ cmp_barcode.showOutput("badge badge-danger", $"Codice sconosciuto: {decoData.rawData} --> ignoro");
resetSelection(false);
doRaiseEv = true;
break;
@@ -161,8 +233,8 @@ namespace MP_MAG.WebUserControls
///
private void processSuggestion(codeType tipoCod, string rawData, int codeInt)
{
- //DS_App.ItemListDataTable tabItem = null;
- // processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero)
+ bool allOk = false;
+ // processo suggerimenti
switch (tipoCod)
{
case codeType.Command:
@@ -171,9 +243,9 @@ namespace MP_MAG.WebUserControls
switch (rawData)
{
case "CMDRESET":
- cmp_SelPackList.PackListID = 0;
- cmp_SelPedana.Pedana = "ND";
- cmp_SelUdc.UDC = "NA";
+ SelPackList = 0;
+ SelPedana = "ND";
+ SelUDC = "NA";
resetSelection(true);
break;
@@ -183,140 +255,178 @@ namespace MP_MAG.WebUserControls
break;
case codeType.PackList:
- // FARE!!! verificare packlist valida...
- if (true)
+ // verifica packlist...
+ allOk = false;
+ // step 1 : esiste
+ var tabPList = MagDataLayer.man.taPList.getByKey(codeInt);
+ if (tabPList.Rows.Count > 0)
{
- // seleziono PackList
- cmp_SelPackList.PackListID = codeInt;
- }
-
- tryLinkAlUdc();
-#if false
- // IN PRIMIS cerco lotto valido
- DS_Mag.ElencoLottiDataTable tabLotti;
- tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "*", codStatoIN);
- if (tabLotti.Count == 1)
- {
- // se trovato cerco in elenco --> aggiungo in lista se non c'è
- var currLotti = lottiSel;
- if (!currLotti.Contains(rawData))
+ // step 2: stato (1 richiesta, 2 iniziata, 3 completata)
+ var rowPList = tabPList[0];
+ switch (rowPList.PackStatus)
{
- currLotti.Add(rawData);
- lottiSel = currLotti;
+ case 0:
+ cmp_barcode.showOutput("badge badge-danger", "Errore: PackList in bozza");
+ break;
+
+ case 1:
+ case 2:
+ allOk = true;
+ break;
+
+ case 3:
+ cmp_barcode.showOutput("badge badge-warning", "Errore: PackList completata");
+ break;
+
+ case 4:
+ cmp_barcode.showOutput("badge badge-danger", "Errore: PackList già trasferita");
+ break;
+
+ default:
+ cmp_barcode.showOutput("badge badge-danger", "Errore: PackList in stato UNK");
+ break;
}
}
-#endif
+ if (allOk)
+ {
+ // seleziono PackList
+ SelPackList = codeInt;
+ // resetto PEDANA ed UDC
+ SelPedana = "";
+ SelUDC = "";
+ }
+
break;
case codeType.Pedana:
- // verifico e seleziono pedana
-
- if (true)
+ // verifico di avere pack list
+ allOk = false;
+ if (SelPackList == 0)
{
- cmp_SelPedana.Pedana = rawData;
+ cmp_barcode.showOutput("badge badge-danger", "Errore: manca PackList!");
+ }
+ else
+ {
+ // verifico esista
+ var tabAL = MagDataLayer.man.taEAL.getByKey(rawData);
+ if (tabAL.Rows.Count == 0)
+ {
+ cmp_barcode.showOutput("badge badge-warning", $"Errore: Pedana non trovata: {rawData}");
+ }
+ else
+ {
+ // ...e NON sia associata ad altre PList
+ if (tabAL[0].PackListID == 0)
+ {
+ // se non associata associo...
+ MagDataLayer.man.taEAL.updatePList(rawData, SelPackList);
+ allOk = true;
+ }
+ else if (tabAL[0].PackListID != SelPackList)
+ {
+ cmp_barcode.showOutput("badge badge-danger", $"Errore: AL {rawData} già associata a PackList {tabAL[0].PackListID}");
+ }
+ else if (tabAL[0].Status > 0)
+ {
+ cmp_barcode.showOutput("badge badge-danger", $"Errore: AL {rawData} non modificabile");
+ }
+ else
+ {
+ // tutto ok
+ allOk = true;
+ }
+ }
+ //...e seleziono pedana
+ if (allOk)
+ {
+ SelPedana = rawData;
+ // resetto UDC
+ SelUDC = "";
+ }
}
- //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.Udc:
-
- // verifico e seleziono udc
-
- if (true)
+ // verifico di avere pack list
+ allOk = false;
+ if (SelPackList == 0)
{
- cmp_SelUdc.UDC = rawData;
+ cmp_barcode.showOutput("badge badge-danger", "Errore: manca PackList!");
+ }
+ else
+ {
+ // verifico di avere Pedana
+ if (string.IsNullOrEmpty(SelPedana))
+ {
+ cmp_barcode.showOutput("badge badge-danger", "Errore: manca Pedana!");
+ }
+ else
+ {
+ // verifico esista
+ var tabUDC = MagDataLayer.man.taEUdc.getByKey(rawData);
+ if (tabUDC.Rows.Count == 0)
+ {
+ cmp_barcode.showOutput("badge badge-warning", $"Errore: UDC non trovato: {rawData}");
+ }
+ else
+ {
+ // ...e NON sia stato TRASFERITO
+ if (tabUDC[0].IdxPosizione > 0)
+ {
+ cmp_barcode.showOutput("badge badge-warning", $"Errore: UDC già trasferito: {rawData}");
+ }
+ else
+ {
+ // cerco AL se sia quello selezionato...
+ var tabAL = MagDataLayer.man.taEAL.getByUdc(rawData);
+ // se non trovo --> associo
+ if (tabAL.Rows.Count == 0)
+ {
+ // tutto ok
+ allOk = true;
+ }
+ // se uguale OK
+ else if (tabAL[0].AL == SelPedana)
+ {
+ // tutto ok
+ allOk = true;
+ }
+ else
+ {
+ // se siamo in seconda lettura --> OK x spostamento
+ if (LastUDC == rawData)
+ {
+ allOk = true;
+ LastUDC = "";
+ }
+ else
+ {
+ // verifico pedana (vecchia/attuale) libera...
+ if (tabAL[0].Status > 0)
+ {
+ cmp_barcode.showOutput("badge badge-danger", $"Attenzione: AL di origine ({tabAL[0].AL}) non modificabile, impossibile spostare");
+ }
+ // chiedo seconda lettura SE AL "libero"
+ else
+ {
+ cmp_barcode.showOutput("badge badge-info", $"Attenzione: UDC {rawData} già associato ad AL ({tabAL[0].AL}), rileggere per confermare ({SelPedana})");
+ LastUDC = rawData;
+ }
+ }
+ }
+ }
+ }
+ // ...e seleziono udc
+ if (allOk)
+ {
+ SelUDC = rawData;
+ tryLinkAlUdc();
+ }
+ }
}
-
- tryLinkAlUdc();
-
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;
}
@@ -324,11 +434,42 @@ namespace MP_MAG.WebUserControls
private void tryLinkAlUdc()
{
- // verifica UDC ed al, se entrambi validi e LIBERI
-
- // se c'è già un associazione UDC con altro AL --> chiede rilettura
-
- // se non c'era effettua associazione
+ bool doRecordUdc = false;
+ int OrderListID = 0;
+ // cerco se UDC sia tra quelli RICHIESTI facendo Ordine <--> Lotto <--> UDC
+ var tabOrdini = MagDataLayer.man.taOList.getByPL_UDC(SelPackList, SelUDC);
+ // se sono 0 --> NON COMPATIBILE
+ if (tabOrdini.Rows.Count == 0)
+ {
+ cmp_barcode.showOutput("badge badge-danger", "Errore: articolo non presente nella PackList, impossibile acquisire");
+ }
+ // se 1 --> associa
+ else if (tabOrdini.Rows.Count == 1)
+ {
+ OrderListID = tabOrdini[0].OrderListID;
+ doRecordUdc = true;
+ }
+ // se è già selezionato un singolo ordine
+ else if (SelOrdID > 0)
+ {
+ OrderListID = SelOrdID;
+ doRecordUdc = true;
+ }
+ // se > 1 ma NON HO selezione --> chiede a quale associare
+ else
+ {
+ cmp_barcode.showOutput("badge badge-warning", "Attenzione: più di un ordine presente, prego selezionare (UDC)");
+ }
+ // se va salvato...
+ if (doRecordUdc)
+ {
+ MagDataLayer.man.taEA2U.upsertQuery(SelUDC, SelPedana, OrderListID);
+ cmp_SelUdc.cssCol = "success";
+ }
+ else
+ {
+ cmp_SelUdc.cssCol = "warning";
+ }
}
#endregion Private Methods
@@ -337,6 +478,13 @@ namespace MP_MAG.WebUserControls
protected void Page_Load(object sender, EventArgs e)
{
+ if (!Page.IsPostBack)
+ {
+ SelPackList = 0;
+ SelPedana = "";
+ SelUDC = "";
+ LastUDC = "";
+ }
// eventi barcode
cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh;
// eventi reset lotti IN
diff --git a/MP-MAG/WebUserControls/cmp_PLScanner.ascx.designer.cs b/MP-MAG/WebUserControls/cmp_PLScanner.ascx.designer.cs
index 7f4b6db..255f478 100644
--- a/MP-MAG/WebUserControls/cmp_PLScanner.ascx.designer.cs
+++ b/MP-MAG/WebUserControls/cmp_PLScanner.ascx.designer.cs
@@ -68,6 +68,15 @@ namespace MP_MAG.WebUserControls
///
protected global::MP_MAG.WebUserControls.cmp_SelUdc cmp_SelUdc;
+ ///
+ /// Controllo hfLastUDC.
+ ///
+ ///
+ /// 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.HiddenField hfLastUDC;
+
///
/// Controllo cmp_SelPedana.
///
diff --git a/MP-MAG/WebUserControls/cmp_SelPackList.ascx b/MP-MAG/WebUserControls/cmp_SelPackList.ascx
index d70eab8..967e466 100644
--- a/MP-MAG/WebUserControls/cmp_SelPackList.ascx
+++ b/MP-MAG/WebUserControls/cmp_SelPackList.ascx
@@ -4,12 +4,8 @@