Update gestione buon rilavorati!

This commit is contained in:
Samuele E. Locatelli
2020-07-14 19:26:48 +02:00
parent f0619df15c
commit aaf515eecc
3 changed files with 313 additions and 284 deletions
+50 -27
View File
@@ -119,37 +119,46 @@ namespace NKC_WF.WebUserControls
// controllo sia quello RICHIESTO
if (decoData.codeInt == cmp_stackNextloading.StackIdReq)
{
// verifico SE i BUNKS correnti siano tutti stati completati (NumSheet == NumWorking)
if (currentBunkPrinted)
// controllo se il bunk richiesto sia stato caricato coi materiali...
if (!isBunkFilled(decoData.codeInt))
{
cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}");
ComLib.taktMLCurrStack = decoData.code;
// processo DB e salvo che lo stack è stato caricato in MACHINE LOAD
int stackId = 0;
try
{
var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData);
if (tabStack.Count == 1)
{
stackId = tabStack[0].StackID;
}
}
catch
{ }
// SE HO uno stackId valido (>0)...
if (stackId > 0)
{
DataLayer.man.taSTL.updatePos(stackId, 5);
// controllo status del bunk nel suo insieme...
ComLib.updateBatchPositionByBunk(stackId);
doRaiseEv = true;
}
cmp_barcode.showOutput("badge badge-danger", $"NEXT BUNK NOT PREPARED, {decoData.rawData}");
doRaiseEv = true;
}
// altrimenti segnalo NON pronto x caricare prossimo
else
{
cmp_barcode.showOutput("badge badge-danger", $"PREV BUNK NOT COMPLETED, {decoData.rawData}");
doRaiseEv = true;
// verifico SE i BUNKS correnti siano tutti stati completati (NumSheet == NumWorking)
if (currentBunkPrinted)
{
cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}");
ComLib.taktMLCurrStack = decoData.code;
// processo DB e salvo che lo stack è stato caricato in MACHINE LOAD
int stackId = 0;
try
{
var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData);
if (tabStack.Count == 1)
{
stackId = tabStack[0].StackID;
}
}
catch
{ }
// SE HO uno stackId valido (>0)...
if (stackId > 0)
{
DataLayer.man.taSTL.updatePos(stackId, 5);
// controllo status del bunk nel suo insieme...
ComLib.updateBatchPositionByBunk(stackId);
doRaiseEv = true;
}
}
// altrimenti segnalo NON pronto x caricare prossimo
else
{
cmp_barcode.showOutput("badge badge-danger", $"PREV BUNK NOT COMPLETED, {decoData.rawData}");
doRaiseEv = true;
}
}
}
else
@@ -220,6 +229,20 @@ namespace NKC_WF.WebUserControls
return answ;
}
}
/// <summary>
/// verifica se il bunk sia stato completato come caricamento dei fogli richiesti)
/// </summary>
protected bool isBunkFilled(int BunkId)
{
bool answ = false;
// leggo i dati del bunk...
var currBunk = DataLayer.man.taSTL.getByKey(BunkId);
if (currBunk.Count == 1)
{
answ = currBunk[0].Position == 4;
}
return answ;
}
protected void checkVisibility()
{