Fix display post conferma prod
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
|
||||
@if (showInnov)
|
||||
{
|
||||
@*class="d-flex justify-content-between"*@
|
||||
<div class="cardBg p-2 mt-2">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="col-6">
|
||||
|
||||
@@ -170,9 +170,9 @@ namespace MP_TAB_SERV.Components
|
||||
protected async Task SalvaConfPz()
|
||||
{
|
||||
isProcessing = true;
|
||||
await Task.Delay(1);
|
||||
// effettua conferma con conf da DB del tipo (giorni / turni / periodo
|
||||
bool fatto = effettuaConfermaProd();
|
||||
await TabDServ.FlushCache("StatoProd");
|
||||
// refresh tabella dati tablet...
|
||||
await TabDServ.RicalcMse(IdxMaccSel, 0);
|
||||
// rileggo e salvo..
|
||||
@@ -188,8 +188,6 @@ namespace MP_TAB_SERV.Components
|
||||
lblOut = $"Confermata produzione {numPzConfermati - numPzLasciati} pezzi (+{numPzLasciati} pz lasciati, +{numPzScarto2Rec} pz scarto) |{dtReqUpdate:HH:mm:ss} | {dtReqUpdate:ddd yyyy.MM.dd}";
|
||||
// cambio button conferma...
|
||||
showInnov = false;
|
||||
// sollevo evento!
|
||||
//dtReqUpdate = DateTime.Now;
|
||||
numPzLasciati = 0;
|
||||
await DoUpdate();
|
||||
await Task.Delay(1);
|
||||
@@ -291,445 +289,6 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#if false
|
||||
|
||||
/// <summary>
|
||||
/// restituisce css disabled SE odl NON OK...
|
||||
/// </summary>
|
||||
public string cssBtnConf
|
||||
{
|
||||
get
|
||||
{
|
||||
return odlOk ? "" : "disabled";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data-Ora ultimo update valori produzione
|
||||
/// </summary>
|
||||
public DateTime dtReqUpdate
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
DateTime.TryParse(hfDtReqUpdate.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfDtReqUpdate.Value = $"{value}";
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime dtFine
|
||||
{
|
||||
set
|
||||
{
|
||||
lblFine.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI da ultima conferma
|
||||
/// </summary>
|
||||
protected DateTime dtInizio
|
||||
{
|
||||
set
|
||||
{
|
||||
lblInizio.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI da ultima conferma
|
||||
/// </summary>
|
||||
protected int numPz2Rec
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPz2RecTot.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi BUONI già confermati
|
||||
/// </summary>
|
||||
protected int numPzBuoniConf
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPzConfBuoni.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi confermati (buoni - scarto)
|
||||
/// </summary>
|
||||
protected int numPzConfermati
|
||||
{
|
||||
get
|
||||
{
|
||||
return numPzProdotti2Rec - numPzScarto2Rec;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi da LASCIARE non dichiarati
|
||||
/// </summary>
|
||||
protected int numPzLasciati
|
||||
{
|
||||
set
|
||||
{
|
||||
txtNumLasciati.Text = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(txtNumLasciati.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI GLOBALI
|
||||
/// </summary>
|
||||
protected int numPzProdotti
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPzTotODL.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI da registrare
|
||||
/// </summary>
|
||||
/// da ultima conferma
|
||||
protected int numPzProdotti2Rec
|
||||
{
|
||||
set
|
||||
{
|
||||
txtNumPezzi.Text = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(txtNumPezzi.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi SCARTO già confermati
|
||||
/// </summary>
|
||||
protected int numPzScaConf
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPzConfScarto.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero pezzi SCARTATI da registrare
|
||||
/// </summary>
|
||||
protected int numPzScarto2Rec
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPz2RecScarto.Text = value.ToString();
|
||||
memLayer.ML.setSessionVal("lblPz2RecScarto", value);
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.IntSessionObj("lblPz2RecScarto");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected void ddlSubMacc_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// se ho in memoria un valore LO REIMPOSTO...
|
||||
if (!string.IsNullOrEmpty(subMaccSel))
|
||||
{
|
||||
// se è una SUB machcina (contiene "#")
|
||||
if (subMaccSel.Contains("#"))
|
||||
{
|
||||
// provo a preselezionare...
|
||||
try
|
||||
{
|
||||
ddlSubMacc.SelectedValue = subMaccSel;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
// altrimenti salvo!
|
||||
else
|
||||
{
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
// salvo ODL
|
||||
DataLayerObj.taMSE.getByIdxMaccAndSub(idxMacchinaSel, subMaccSel);
|
||||
//altri controlli
|
||||
checkAll();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// salvo produzione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSalva_Click(object sender, EventArgs e)
|
||||
{
|
||||
// effettua conferma con conf da DB del tipo (giorni / turni / periodo
|
||||
bool fatto = effettuaConfermaProd();
|
||||
// refresh tabella dati tablet...
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMacchinaSel);
|
||||
// mostro output
|
||||
lblOut.Text = string.Format("Confermata la produzione per {0} pezzi! (+{1} pz scarto) alle {2:yyyy-MM-dd HH:mm:ss}", numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
// cambio button conferma...
|
||||
switchBtnConferma(!txtNumPezzi.Enabled);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
}
|
||||
dtReqUpdate = DateTime.Now;
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
checkAll();
|
||||
if (isMulti)
|
||||
{
|
||||
// sollevo evento!
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update pz lasciati --> aggiorno!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtNumLasciati_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblOut.Text = "";
|
||||
updatePzBuoni();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// update post modifica pz buoni
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtNumPezzi_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblOut.Text = "";
|
||||
updatePzBuoni();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ODL correntemente sulla macchina
|
||||
/// - cerca in Redis (TTL 5 sec)
|
||||
/// - altrimenti recupera da DB...
|
||||
/// </summary>
|
||||
protected void updateOdl()
|
||||
{
|
||||
// userò ODL del turno
|
||||
int answ = 0;
|
||||
// cerco da redis...
|
||||
int.TryParse(DataLayerObj.currODL(idxMacchinaSel, true), out answ);
|
||||
// salvo!
|
||||
idxOdl = answ;
|
||||
}
|
||||
|
||||
private void checkAll()
|
||||
{
|
||||
updateOdl();
|
||||
checkConfig();
|
||||
fixSelMacc();
|
||||
checkOdl();
|
||||
lblOut.Text = "";
|
||||
switchBtnConferma(false);
|
||||
lbtShowConfProd.Visible = odlOk;
|
||||
lblConfProd.Visible = !odlOk;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verifica config x modalità permesse
|
||||
/// </summary>
|
||||
private void checkConfig()
|
||||
{
|
||||
// verifico SE sia permesso gestire i "Pezzi lasciati" in macchina...
|
||||
lblNumLasciati.Visible = enablePzProdLasciati;
|
||||
txtNumLasciati.Visible = enablePzProdLasciati;
|
||||
lblEmptyNumLasciati.Visible = !enablePzProdLasciati;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se abbia un ODL ATTIVO
|
||||
/// </summary>
|
||||
private void checkOdl()
|
||||
{
|
||||
lbtShowConfProd.Visible = odlOk;
|
||||
lblConfProd.Visible = !odlOk;
|
||||
lblMancaODL.Visible = !odlOk;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registra conferma produzione in modalità nuova (con rettifica pezzi lasciati) o legacy
|
||||
/// (con anticipo periodo)
|
||||
/// </summary>
|
||||
private bool effettuaConfermaProd()
|
||||
{
|
||||
bool fatto = false;
|
||||
if (confRett)
|
||||
{
|
||||
// confermo al netto dei pezzi lasciati...
|
||||
fatto = DataLayerObj.confermaProdMacchinaFull(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), numPzConfermati - numPzLasciati, numPzLasciati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
else
|
||||
{
|
||||
fatto = DataLayerObj.confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se la machcina è MULTI --> mostro selettore
|
||||
/// </summary>
|
||||
private void fixSelMacc()
|
||||
{
|
||||
divSelMacc.Visible = isMulti;
|
||||
if (isMulti)
|
||||
{
|
||||
try
|
||||
{
|
||||
// salvo selezione submacc
|
||||
ddlSubMacc.DataBind();
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
updateOdl();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset parametri x calcolo pezzi (no pezzi lasciati, dataora attuale...)
|
||||
/// </summary>
|
||||
private void resetParam()
|
||||
{
|
||||
dtReqUpdate = DateTime.Now;
|
||||
numPzLasciati = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// determina comportamento btn conferma
|
||||
/// </summary>
|
||||
private void switchBtnConferma(bool showConf)
|
||||
{
|
||||
// aggiorno valori rilevati
|
||||
resetParam();
|
||||
doUpdate();
|
||||
divInnovazioni.Visible = showConf;
|
||||
if (showConf)
|
||||
{
|
||||
try
|
||||
{
|
||||
updatePzBuoni();
|
||||
// sollevo evento!
|
||||
if (eh_inserting != null)
|
||||
{
|
||||
eh_inserting(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
txtNumPezzi.Text = "0";
|
||||
logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchinaSel), tipoLog.ERROR);
|
||||
}
|
||||
}
|
||||
if (showConf)
|
||||
{
|
||||
lblShowConfProd.Text = "Nascondi Conferma";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblShowConfProd.Text = "Mostra Conferma";
|
||||
// sollevo evento!
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// aggiorna visualizzazione pz buoni /prodotti - scarti)
|
||||
/// </summary>
|
||||
private void updatePzBuoni()
|
||||
{
|
||||
if (confRett)
|
||||
{
|
||||
// cambio le qta di pezzi confermati...
|
||||
lblPz2RecBuoni.Text = (numPzConfermati - numPzLasciati).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
// se ho dei pezzi lasciati RICALCOLO la data...
|
||||
if (numPzLasciati > 0)
|
||||
{
|
||||
// calcolo la data..
|
||||
DS_ProdTempi.TempiCicloRilevatiDataTable tab = DataLayerObj.taTempiCicloRilevati.getLastPzByMaccQta(idxMacchinaSel, DateTime.Now, numPzLasciati);
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
dtReqUpdate = tab[0].DataOraRif.AddSeconds(1);
|
||||
}
|
||||
// aggiorno
|
||||
doUpdate();
|
||||
}
|
||||
lblPz2RecBuoni.Text = numPzConfermati.ToString();
|
||||
}
|
||||
// aggiorno la data calcolo + pezzi buoni...
|
||||
lblDtRec.Text = dtReqUpdate.ToString();
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2312.1414</Version>
|
||||
<Version>6.16.2312.1416</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2312.1414</h4>
|
||||
<h4>Versione: 6.16.2312.1416</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2312.1414
|
||||
6.16.2312.1416
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2312.1414</version>
|
||||
<version>6.16.2312.1416</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user