|
|
|
@@ -776,7 +776,7 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
protected void lbtEndProd_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
// leggo idxOdl da ultimo odl attivo x macchina
|
|
|
|
|
int idxODL = DataLayerObj.taODL.getByMacchina(idxMacchinaFix)[0].IdxODL;
|
|
|
|
|
int idxODLCurr = DataLayerObj.taODL.getByMacchina(idxMacchinaFix)[0].IdxODL;
|
|
|
|
|
int idxEvento = 7; // !!!HARD CODED
|
|
|
|
|
|
|
|
|
|
// confermo prod vecchio ODL
|
|
|
|
@@ -789,11 +789,11 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// processo x macchina selezionata
|
|
|
|
|
DataLayerObj.taODL.fineProd(idxODL, idxMacchinaFix);
|
|
|
|
|
DataLayerObj.taODL.fineProd(idxODLCurr, idxMacchinaFix);
|
|
|
|
|
string evText = "Registrata fine produzione per ODL {0}";
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
sb.AppendLine(String.Format(evText, idxODL));
|
|
|
|
|
processaEvento(idxMacchinaFix, idxEvento, sb.ToString(), idxODL);
|
|
|
|
|
sb.AppendLine(String.Format(evText, idxODLCurr));
|
|
|
|
|
processaEvento(idxMacchinaFix, idxEvento, sb.ToString(), idxODLCurr);
|
|
|
|
|
// se è multi processo ANCHE x altra tavola...
|
|
|
|
|
if (isMulti)
|
|
|
|
|
{
|
|
|
|
@@ -825,9 +825,9 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// effettuo split su nuovo ODL
|
|
|
|
|
DataLayerObj.taODL.splitODL(idxODL, DataLayerObj.MatrOpr, idxMacchinaFix, TCAssegnato(idxODL), PzPallet, string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false, 0);
|
|
|
|
|
DataLayerObj.taODL.splitODL(idxODLCurr, DataLayerObj.MatrOpr, idxMacchinaFix, TCAssegnato(idxODLCurr), PzPallet, string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODLCurr, TCAssegnato(idxODLCurr)), false, 0);
|
|
|
|
|
// processo chiusura setup
|
|
|
|
|
processaEvento(idxMacchinaFix, idxEvento, String.Format("Registrata fine produzione per ODL {0}, nuovo ODL per quantità residua", idxODL), idxODL);
|
|
|
|
|
processaEvento(idxMacchinaFix, idxEvento, String.Format("Registrata fine produzione per ODL {0}, nuovo ODL per quantità residua", idxODLCurr), idxODLCurr);
|
|
|
|
|
|
|
|
|
|
// se è multi processo ANCHE x altra tavola...
|
|
|
|
|
if (isMulti)
|
|
|
|
@@ -857,6 +857,8 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
}
|
|
|
|
|
// resetto ODL su redis...
|
|
|
|
|
DataLayerObj.emptyCurrODL(idxMacchinaFix);
|
|
|
|
|
// imposto odl a zero...
|
|
|
|
|
idxOdl = 0;
|
|
|
|
|
// aggiorno visualizzazione
|
|
|
|
|
checkAll();
|
|
|
|
|
// sollevo evento!
|
|
|
|
@@ -1149,6 +1151,8 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
DataLayerObj.saveCounter(idxMacchinaFix, "0");
|
|
|
|
|
// imposto ODL su redis...
|
|
|
|
|
DataLayerObj.saveCurrODL(idxMacchinaFix, idxODL_curr.ToString());
|
|
|
|
|
// salvo odl selezionato
|
|
|
|
|
idxODL = idxODL_curr;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@@ -1175,12 +1179,12 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
TCRichAttr = TCAssegnato(idxODLSel);
|
|
|
|
|
}
|
|
|
|
|
// leggo idxOdl da ultimo odl attivo x macchina
|
|
|
|
|
int idxODL = DataLayerObj.taODL.getByMacchina(idxMacchinaFix)[0].IdxODL;
|
|
|
|
|
int idxODLStart = DataLayerObj.taODL.getByMacchina(idxMacchinaFix)[0].IdxODL;
|
|
|
|
|
int idxEvento = 1; // !!!HARD CODED
|
|
|
|
|
// aggiorno (se necessario) note e tempo setup
|
|
|
|
|
DataLayerObj.taODL.updateSetup(idxODL, DataLayerObj.MatrOpr, TCRichAttr, PzPallet, txtNote.Text);
|
|
|
|
|
DataLayerObj.taODL.updateSetup(idxODLStart, DataLayerObj.MatrOpr, TCRichAttr, PzPallet, txtNote.Text);
|
|
|
|
|
// controllo se TC Assegnato != TCRichiesto allora invio email x verifiche...
|
|
|
|
|
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxODL, false)[0];
|
|
|
|
|
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxODLStart, false)[0];
|
|
|
|
|
if (rigaOdl.TCAssegnato != TCRichAttr)
|
|
|
|
|
{
|
|
|
|
|
// invio email!
|
|
|
|
@@ -1189,12 +1193,12 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
// processo chiusura setup
|
|
|
|
|
string evText = "Registrata inizio produzione per ODL {0}";
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
sb.AppendLine(String.Format(evText, idxODL));
|
|
|
|
|
processaEvento(idxMacchinaFix, idxEvento, sb.ToString(), idxODL);
|
|
|
|
|
sb.AppendLine(String.Format(evText, idxODLStart));
|
|
|
|
|
processaEvento(idxMacchinaFix, idxEvento, sb.ToString(), idxODLStart);
|
|
|
|
|
// indico INIZIO SETUP su REDIS come EXE della macchina...
|
|
|
|
|
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
|
|
|
|
|
//DataLayerObj.addTask4Machine(idxMacchina, "stopSetup", $"TS:{ts}|MATR:{DataLayerObj.MatrOpr}|ODL:{idxODL}");
|
|
|
|
|
DataLayerObj.addTask4Machine(idxMacchinaFix, taskType.stopSetup, $"TS:{ts}|MATR:{DataLayerObj.MatrOpr}|ODL:{idxODL}");
|
|
|
|
|
DataLayerObj.addTask4Machine(idxMacchinaFix, taskType.stopSetup, $"TS:{ts}|MATR:{DataLayerObj.MatrOpr}|ODL:{idxODLStart}");
|
|
|
|
|
// se è multi processo chiusura setup x altra tavola...
|
|
|
|
|
if (isMulti)
|
|
|
|
|
{
|
|
|
|
@@ -1211,7 +1215,7 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
// se c'è gestione SchedaTecnica --> chiamo procedura update x lotti
|
|
|
|
|
if (enableSchedaTecnica)
|
|
|
|
|
{
|
|
|
|
|
DataLayerObj.taMagELotti.UpsertByOdl(idxODL, true);
|
|
|
|
|
DataLayerObj.taMagELotti.UpsertByOdl(idxODLStart, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// riporto stringa
|
|
|
|
@@ -1220,6 +1224,8 @@ namespace MoonProTablet.WebUserControls
|
|
|
|
|
showNoteTC(false);
|
|
|
|
|
// update buttons...
|
|
|
|
|
checkAll();
|
|
|
|
|
// imposto odl...
|
|
|
|
|
idxOdl = idxODLStart;
|
|
|
|
|
// sollevo evento!
|
|
|
|
|
if (eh_reqUpdate != null)
|
|
|
|
|
{
|
|
|
|
|