OK caricamento singoilo bunk richiesto

This commit is contained in:
Samuele E. Locatelli
2020-07-13 16:52:28 +02:00
parent aef71558a3
commit 2e54ed3af7
+60 -34
View File
@@ -107,44 +107,52 @@ namespace NKC_WF.WebUserControls
}
else
{
// controllo sia quello RICHIESTO, eventualmente permetteremo TUTTI quelli del giorno in ogni ordine...
if (decoData.codeInt == cmp_stackNextloading.StackIdReq)
// verifico non sia già in lavorazione
if (currentBunkAlreadyWorking(decoData.codeInt))
{
// 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}");
}
cmp_barcode.showOutput("badge badge-success", $"BUNK in processing, {decoData.rawData}");
}
else
{
cmp_barcode.showOutput("badge badge-danger", $"WRONG BUNK, {decoData.rawData}");
// controllo sia quello RICHIESTO
if (decoData.codeInt == cmp_stackNextloading.StackIdReq)
{
// 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}");
}
}
else
{
cmp_barcode.showOutput("badge badge-danger", $"WRONG BUNK, {decoData.rawData}");
}
}
}
break;
@@ -167,7 +175,25 @@ namespace NKC_WF.WebUserControls
raiseEvent();
}
}
protected bool currentBunkAlreadyWorking(int StackIdRequested)
{
bool answ = false;
// leggo i dati del bunk...
var currBunks = DataLayer.man.taSTL.getCurrByBatch(BatchIdCurr);
if (currBunks.Count > 0)
{
// verifico x ogni bunk corrente
foreach (var item in currBunks)
{
// verifico se numSheet = NumWorging
bool checkFound = item.StackID == StackIdRequested;
// update answ
answ = answ || checkFound;
}
}
return answ;
}
protected bool currentBunkPrinted
{
get