diff --git a/GMW/GMW/WebUserControls/mod_labConsUdc.ascx b/GMW/GMW/WebUserControls/mod_labConsUdc.ascx index 5ac3adf4..664744fa 100644 --- a/GMW/GMW/WebUserControls/mod_labConsUdc.ascx +++ b/GMW/GMW/WebUserControls/mod_labConsUdc.ascx @@ -51,86 +51,91 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -    - - - - +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +    + +
+ + + +
diff --git a/GMW/GMW/WebUserControls/mod_labConsUdc.ascx.cs b/GMW/GMW/WebUserControls/mod_labConsUdc.ascx.cs index 7259c2b0..c829a59c 100644 --- a/GMW/GMW/WebUserControls/mod_labConsUdc.ascx.cs +++ b/GMW/GMW/WebUserControls/mod_labConsUdc.ascx.cs @@ -143,6 +143,12 @@ namespace GMW.WebUserControls btnSendAs400.Text = traduci("btnSendAs400"); //checkFixOds(); } + if (true) + { + lblWarning.Visible = true; + lblWarning.Text = memLayer.ML.StringSessionObj("errConsUdc"); + memLayer.ML.emptySessionVal("errConsUdc"); + } } protected override void OnLoad(EventArgs e) { @@ -285,20 +291,39 @@ namespace GMW.WebUserControls } catch { } - try + // controllo che UDC non risulti già consumato + if (MagClass.magazzino.udcMpIsConsumabile(UDC)) { - // registor consumo in AS400 - utils.obj.taSTP.stp_accodaConsumoUdcMP(UDC, DateTime.Now, turno, rbl.SelectedValue, codTerz); - // registro nuova posizione 56 --> -56 - MagClass.magazzino.scaricaUdcMpWip(UDC); + // consumo! + try + { + // registro consumo in AS400 + utils.obj.taSTP.stp_accodaConsumoUdcMP(UDC, DateTime.Now, turno, rbl.SelectedValue, codTerz); + // registro nuova posizione + X --> - X (scambio da positivo a negativo) + MagClass.magazzino.scaricaUdcMpWip(UDC); + lblWarning.Text = ""; + lblWarning.Visible = false; + } + catch (Exception e) + { + logger.lg.scriviLog(string.Format("Errore tentando di consumare UDC di MP cod {0}: {1}{2}", UDC, Environment.NewLine, e), tipoLog.EXCEPTION); + } } - catch (Exception e) + else { - logger.lg.scriviLog(string.Format("Errore tentando di consumare UDC di MP cod {0}: {1}{2}", UDC, Environment.NewLine, e), tipoLog.EXCEPTION); + // mostro errore che è già stato consumato! + lblWarning.Text = traduci("erroreUdcConsumato"); + lblWarning.Visible = true; + // log dell'errore + logger.lg.scriviLog(string.Format("Errore tentando di consumare UDC di MP cod {0}: risulta già consumato!", UDC), tipoLog.INFO); } } else { + // mostro errore che non c'è benestare! + lblWarning.Text = traduci("erroreUdcSenzaBenestare"); + lblWarning.Visible = true; + // log dell'errore logger.lg.scriviLog(string.Format("Errore tentando di consumare UDC di MP cod {0}: non c'è benestare qualità!", UDC), tipoLog.INFO); } } @@ -332,19 +357,9 @@ namespace GMW.WebUserControls // se è valido chiamo consumo... consumaUdc(txtBarcode.Text.Trim()); } - if (false) - { - // modalità originale - grView.DataBind(); - // cancello txtbox... - txtBarcode.Text = ""; - txtBarcode.Focus(); - } - else - { - // x velocizzare ricarico pagina... - Response.Redirect(_paginaCorrente); - } + memLayer.ML.setSessionVal("errConsUdc", lblWarning.Text); + // x velocizzare ricarico pagina... + Response.Redirect(_paginaCorrente); } /// /// effettua chiamata stored x aggiornare ssu AS400 diff --git a/GMW/GMW/bin/GMW.dll b/GMW/GMW/bin/GMW.dll index 785696e7..3ea62081 100644 Binary files a/GMW/GMW/bin/GMW.dll and b/GMW/GMW/bin/GMW.dll differ diff --git a/GMW/GMW/bin/GMW_data.dll b/GMW/GMW/bin/GMW_data.dll index 0d99d61b..747d688f 100644 Binary files a/GMW/GMW/bin/GMW_data.dll and b/GMW/GMW/bin/GMW_data.dll differ diff --git a/GMW/GMW/obj/Debug/GMW.dll b/GMW/GMW/obj/Debug/GMW.dll index 785696e7..3ea62081 100644 Binary files a/GMW/GMW/obj/Debug/GMW.dll and b/GMW/GMW/obj/Debug/GMW.dll differ diff --git a/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache b/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache index 7649b13f..2e996773 100644 Binary files a/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache and b/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache differ diff --git a/GMW/GMW_data/MagClass.cs b/GMW/GMW_data/MagClass.cs index a06a7a3f..800aeffe 100644 --- a/GMW/GMW_data/MagClass.cs +++ b/GMW/GMW_data/MagClass.cs @@ -382,7 +382,7 @@ namespace GMW_data return answ; } /// - /// controlla se l'udc delal qualità indicato ha benestare qualità ("S") + /// controlla se l'udc della qualità indicato ha benestare qualità ("S") /// /// /// @@ -402,6 +402,26 @@ namespace GMW_data return answ; } /// + /// controlla se l'udc deaal qualità indicato è già stato consumato + /// + /// + /// + public bool udcMpIsConsumabile(string UDC) + { + bool answ = false; + try + { + DS_magazzino.ElencoCartelliniRow rigaUDC = taCartellini.getByUdc(UDC)[0]; + if (rigaUDC.IdxPosizione > 0) + { + answ = true; + } + } + catch + { } + return answ; + } + /// /// fornisce il codice UDC calcolato /// /// diff --git a/GMW/GMW_data/bin/Debug/GMW_data.dll b/GMW/GMW_data/bin/Debug/GMW_data.dll index 0d99d61b..747d688f 100644 Binary files a/GMW/GMW_data/bin/Debug/GMW_data.dll and b/GMW/GMW_data/bin/Debug/GMW_data.dll differ diff --git a/GMW/GMW_data/obj/Debug/GMW_data.dll b/GMW/GMW_data/obj/Debug/GMW_data.dll index 0d99d61b..747d688f 100644 Binary files a/GMW/GMW_data/obj/Debug/GMW_data.dll and b/GMW/GMW_data/obj/Debug/GMW_data.dll differ