Fix messaggio x lotti non richiesti TAB - 1351
This commit is contained in:
@@ -90,8 +90,12 @@ namespace MoonProTablet.WebUserControls
|
||||
private void processInput()
|
||||
{
|
||||
bool found = false;
|
||||
MapoDb.DS_Arca.GiacenzeDataTable tabGiacenzeLotto = new MapoDb.DS_Arca.GiacenzeDataTable();
|
||||
MapoDb.DS_SheetTech.ST_ActualRowDataTable tabRichieste = new MapoDb.DS_SheetTech.ST_ActualRowDataTable();
|
||||
MapoDb.DS_SheetTech.ST_ActualRowRow datiBatchCheck;
|
||||
MapoDb.DS_Arca.GiacenzeRow datiLotto;
|
||||
// per prima cosa recupero i valori "Pending" da leggere come candidati...
|
||||
var tabRichieste = DataLayerObj.taSTAR.getPendingByOdl(idxOdl);
|
||||
tabRichieste = DataLayerObj.taSTAR.getPendingByOdl(idxOdl);
|
||||
if (tabRichieste != null && tabRichieste.Count > 0)
|
||||
{
|
||||
// cerco per EQ come primo step...
|
||||
@@ -111,30 +115,55 @@ namespace MoonProTablet.WebUserControls
|
||||
// se non trovato
|
||||
if (!found)
|
||||
{
|
||||
// recupero record.. cercando in giacenza il LOTTO...
|
||||
tabGiacenzeLotto = DataLayerObj.taArcaGiac.getBySearch(null, "", BCodeVal, "", false);
|
||||
// controllo condizione tipo BATCH (speciale) - prima solo che CI SIA una richiesta di questo tipo
|
||||
var trovatoBatch = tabRichieste.Where(x => x.CheckType == "BATCH");
|
||||
if (trovatoBatch != null && trovatoBatch.Count() > 0)
|
||||
{
|
||||
// recupero record.. cercando in giacenza il LOTTO...
|
||||
var tabGiacenzeLotto = DataLayerObj.taArcaGiac.getBySearch(null, "", BCodeVal, "", false);
|
||||
if (tabGiacenzeLotto != null && tabGiacenzeLotto.Count > 0)
|
||||
{
|
||||
var datiBatchCheck = trovatoBatch.FirstOrDefault();
|
||||
var datiLotto = tabGiacenzeLotto.FirstOrDefault();
|
||||
datiBatchCheck = trovatoBatch.FirstOrDefault();
|
||||
datiLotto = tabGiacenzeLotto.FirstOrDefault();
|
||||
|
||||
// registro trovato
|
||||
found = true;
|
||||
lblMessage.Text = $"Parametro acquisito: {BCodeVal} --> {datiLotto.Cd_AR}";
|
||||
lblMessage.CssClass = "text-success";
|
||||
// upsert controllo
|
||||
DataLayerObj.taSTChk.upsertQuery(idxOdl, datiBatchCheck.IdxST, datiBatchCheck.Oggetto, datiBatchCheck.Num, BCodeVal, datiLotto.Cd_AR, true, user_std.UtSn.utente);
|
||||
// conto quanti check ci sono dopo, se calati --> ok altrimenti errore
|
||||
var tabRichiestePost = DataLayerObj.taSTAR.getPendingByOdl(idxOdl);
|
||||
if (tabRichiestePost.Count < tabRichieste.Count)
|
||||
{
|
||||
lblMessage.Text = $"Lotto riconosciuto: {BCodeVal} --> {datiLotto.Cd_AR} | Articolo acquisito";
|
||||
lblMessage.CssClass = "text-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = $"Lotto: {BCodeVal} --> {datiLotto.Cd_AR} | Articolo NON richiesto";
|
||||
lblMessage.CssClass = "text-danger";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// se non trovato
|
||||
if (!found)
|
||||
{
|
||||
if (tabGiacenzeLotto != null && tabGiacenzeLotto.Count > 0)
|
||||
{
|
||||
datiLotto = tabGiacenzeLotto.FirstOrDefault();
|
||||
lblMessage.Text = $"Lotto: {BCodeVal} --> {datiLotto.Cd_AR} | Articolo NON richiesto";
|
||||
lblMessage.CssClass = "text-danger";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = $"Parametro non riconosciuto: {BCodeVal}";
|
||||
lblMessage.CssClass = "text-secondary";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = "Parametro non valido";
|
||||
lblMessage.Text = $"Parametro non valido: {BCodeVal}";
|
||||
lblMessage.CssClass = "text-secondary";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user