Inizio gest componente ProdConfirm
This commit is contained in:
@@ -1,5 +1,138 @@
|
||||
<h3>ProdConfirm</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
<div class="card bg-secondary">
|
||||
<div class="card-header p-0">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<asp:Label runat="server" ID="lblConfProd" CssClass="btn btn-secondary btn-lg w-100 disabled">
|
||||
<i class="fa fa-check"></i> MOSTRA Conferma
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" ID="lblMancaODL" Visible="false" ForeColor="Red">MANCA ODL: conferma NON permessa</asp:Label>
|
||||
<asp:LinkButton runat="server" ID="lbtShowConfProd" OnClick="lbtShowConfProd_Click" CssClass="btn btn-success btn-lg w-100">
|
||||
<i class="fa fa-check"></i>
|
||||
<asp:Label runat="server" ID="lblShowConfProd" />
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-12" runat="server" id="divSelMacc">
|
||||
<asp:DropDownList runat="server" ID="ddlSubMacc" DataSourceID="ods" CssClass="form-control" DataTextField="CodMaccArticolo" DataValueField="IdxMacchina" AutoPostBack="True" OnSelectedIndexChanged="ddlSubMacc_SelectedIndexChanged" OnDataBound="ddlSubMacc_DataBound"></asp:DropDownList>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getMulti" TypeName="MapoDb.DS_applicazioneTableAdapters.MSFDTableAdapter" FilterExpression="idxMacchina LIKE '%#%'">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="IdxMacchina" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="row textCondens text-end bg-dark m-1 p-1" runat="server" id="divInnovazioni" onloadeddata="showConfirmButton()">
|
||||
<div class="col-6 py-1 text-start text-uppercase">
|
||||
<b>Dati Incrementali</b>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<sub>ultima conferma -->
|
||||
<asp:Label runat="server" ID="lblDtRec"></asp:Label></sub>
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 pr-1 align-self-end fw-bold">
|
||||
<asp:Label runat="server" ID="lblNumPezzi" CssClass="mb-0" AssociatedControlID="txtNumPezzi" Text="Pz Prodotti CONFERMATI" />
|
||||
<asp:TextBox runat="server" ID="txtNumPezzi" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-end alert alert-warning py-0 mb-0" Enabled="true" AutoPostBack="True" OnTextChanged="txtNumPezzi_TextChanged" onfocus="hideConfirmButton()" onblur="showConfirmButton()" />
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 px-1 align-self-end fw-bold">
|
||||
<div class="px-2">
|
||||
<asp:Label runat="server" ID="lblPzSca2Rec" CssClass="text-danger" Text="Pz Scarto" />
|
||||
+
|
||||
<asp:Label runat="server" ID="lblPzBuo2Rec" CssClass="text-success" Text="Pz Buoni" />
|
||||
</div>
|
||||
<div class="px-2" style="font-size: 2em;">
|
||||
<asp:Label runat="server" ID="lblPz2RecScarto" CssClass="text-danger py-0">[B2]</asp:Label>
|
||||
+
|
||||
<asp:Label runat="server" ID="lblPz2RecBuoni" CssClass="text-success py-0">[C2]</asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 pr-1 align-self-end fw-bold">
|
||||
<asp:Label runat="server" ID="lblNumLasciati" CssClass="mb-0" AssociatedControlID="txtNumPezzi" Text="Pz Prodotti LASCIATI" />
|
||||
<asp:TextBox runat="server" ID="txtNumLasciati" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-end alert alert-secondary py-0 mb-0" Enabled="true" AutoPostBack="True" OnTextChanged="txtNumLasciati_TextChanged" onfocus="hideConfirmButton()" onblur="showConfirmButton()" />
|
||||
<asp:Label runat="server" ID="lblEmptyNumLasciati" CssClass="btn btn-dark text-light btn-lg w-100" Visible="false"> </asp:Label>
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 pl-1 align-self-end fw-bold">
|
||||
<asp:LinkButton runat="server" ID="lbtSalva" CssClass="btn btn-success text-light btn-lg w-100" OnClick="lbtSalva_Click"><i class="fa fa-floppy-o"></i> CONFERMA</asp:LinkButton>
|
||||
<asp:Label runat="server" ID="lblUpdating" CssClass="btn btn-dark text-light btn-lg w-100" Visible="false"><i class="fa fa-circle-o-notch fa-spin"></i> USER INPUT</asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textCondens">
|
||||
<div class="col-12">
|
||||
<asp:UpdateProgress ID="updtRicerca" runat="server" DisplayAfter="10" DynamicLayout="true">
|
||||
<ProgressTemplate>
|
||||
<div id="progress_back">
|
||||
</div>
|
||||
<div id="progress_top" class="text-center text-warning align-middle">
|
||||
<i class="fa fa-spinner fa-pulse"></i>
|
||||
<b>ELABORAZIONE IN CORSO</b>
|
||||
<i class="fa fa-spinner fa-pulse"></i>
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped bg-success progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textCondens">
|
||||
<div class="col-6 py-1 text-start text-uppercase">
|
||||
<b>Dati Globali ODL</b>
|
||||
</div>
|
||||
<div class="col-6 text-end" id="divPeriodo">
|
||||
<sub>Periodo ODL calcolato:
|
||||
<asp:Label runat="server" ID="lblInizio">[dtInizio]</asp:Label>
|
||||
-
|
||||
<asp:Label runat="server" ID="lblFine">[dtFine]</asp:Label></sub>
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 pr-1 py-0 text-end">
|
||||
<div class="alert alert-warning py-1">
|
||||
<div class="text-truncate">
|
||||
[A] NUOVI Pz.Prod
|
||||
</div>
|
||||
<div style="font-size: 2em; font-weight: bold;" class="my-0">
|
||||
<asp:Label runat="server" ID="lblPz2RecTot">[A]</asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 pl-1 px-sm-1 py-0 text-end">
|
||||
<div class="alert alert-info py-1">
|
||||
<div class="text-truncate">
|
||||
Pz Prodotti TOT [A+B+C]
|
||||
</div>
|
||||
<div style="font-size: 2em; font-weight: bold;" class="my-0">
|
||||
<asp:Label runat="server" ID="lblPzTotODL">[A+B+C]</asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 pr-1 px-sm-1 py-0 text-end">
|
||||
<div class="alert alert-danger py-1">
|
||||
<div class="text-truncate">
|
||||
[B] Scarti VERS.
|
||||
</div>
|
||||
<div style="font-size: 2em; font-weight: bold;" class="my-0">
|
||||
<asp:Label runat="server" ID="lblPzConfScarto">[B]</asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-3 pl-1 py-0 text-end">
|
||||
<div class="alert alert-success py-1">
|
||||
<div class="text-truncate">
|
||||
[C] Pz Buoni VERS.
|
||||
</div>
|
||||
<div style="font-size: 2em; font-weight: bold;" class="my-0">
|
||||
<asp:Label runat="server" ID="lblPzConfBuoni">[C]</asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row my-2">
|
||||
<div class="col-12">
|
||||
<asp:Label runat="server" ID="lblOut" ForeColor="Red" />
|
||||
</div>
|
||||
</div>
|
||||
<asp:HiddenField runat="server" ID="hfDtReqUpdate" />
|
||||
@@ -0,0 +1,563 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
|
||||
namespace MP_TAB_SERV.Components
|
||||
{
|
||||
public partial class ProdConfirm
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public MappaStatoExpl? RecMSE { get; set; } = null;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
|
||||
|
||||
|
||||
#if false
|
||||
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Dati produzioen rilevati
|
||||
/// </summary>
|
||||
public DS_ProdTempi.StatoProdRow datiProdAct;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Events
|
||||
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_inserting;
|
||||
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_newVal;
|
||||
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_reset;
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <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}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica ODL OK (ovvero caricato x macchina...)
|
||||
/// </summary>
|
||||
public bool odlOk
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = true;
|
||||
// se ODL > 0 è ok!!!
|
||||
answ = (idxOdl > 0);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorno valori produzione alla data richiesta...
|
||||
/// </summary>
|
||||
/// <param name="newDate"></param>
|
||||
public void doUpdate()
|
||||
{
|
||||
datiProdAct = DataLayerObj.taStatoProd.GetData(idxMacchinaSel, dtReqUpdate)[0];
|
||||
// aggiorno visualizzazione...
|
||||
numPzProdotti = datiProdAct.PzTotODL;
|
||||
numPz2Rec = datiProdAct.Pz2RecTot;
|
||||
numPzScaConf = datiProdAct.PzConfScarto;
|
||||
numPzBuoniConf = datiProdAct.PzConfBuoni;
|
||||
numPzProdotti2Rec = datiProdAct.Pz2RecTot;
|
||||
numPzScarto2Rec = datiProdAct.Pz2RecScarto;
|
||||
dtInizio = inizioOdl;
|
||||
dtFine = dtReqUpdate;
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
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 bool showInnov
|
||||
{
|
||||
get
|
||||
{
|
||||
return divInnovazioni.Visible;
|
||||
}
|
||||
set
|
||||
{
|
||||
divInnovazioni.Visible = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
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>
|
||||
/// cambio stato visibilità pannello e testo button
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtShowConfProd_Click(object sender, EventArgs e)
|
||||
{
|
||||
showInnov = !showInnov;
|
||||
switchBtnConferma(showInnov);
|
||||
}
|
||||
|
||||
/// <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;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
@page "/machine-detail"
|
||||
|
||||
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
@@ -8,11 +7,11 @@
|
||||
else
|
||||
{
|
||||
<div>
|
||||
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
|
||||
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
|
||||
</div>
|
||||
<ProdStat RecMSE="CurrMSE"></ProdStat>
|
||||
<PrintMag></PrintMag>
|
||||
<ProdConfirm></ProdConfirm>
|
||||
<PrintMag RecMSE="CurrMSE"></PrintMag>
|
||||
<ProdConfirm RecMSE="CurrMSE"></ProdConfirm>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<a class="btn btn-info btn-lg w-100" href="scrap"><i class="fa fa-bug"></i> Reg. SCARTI</a>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using NLog.Fluent;
|
||||
|
||||
namespace MP_TAB_SERV.Pages
|
||||
{
|
||||
@@ -14,6 +13,7 @@ namespace MP_TAB_SERV.Pages
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TabServ { get; set; } = null!;
|
||||
|
||||
@@ -28,10 +28,22 @@ namespace MP_TAB_SERV.Pages
|
||||
if (enableSchedaTecnica)
|
||||
{
|
||||
checkLottiOdl();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<ConfigModel>? CurrConfig = null;
|
||||
|
||||
private bool enableSchedaTecnica = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void checkLottiOdl()
|
||||
{
|
||||
#if false
|
||||
@@ -52,14 +64,10 @@ namespace MP_TAB_SERV.Pages
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
@@ -90,14 +98,10 @@ namespace MP_TAB_SERV.Pages
|
||||
getConfValInt("pageRefreshSec", ref slowRefreshSec);
|
||||
getConfVal("sART", ref showArt);
|
||||
Log.Info($"setupConf | Effettuato setup parametri | keepAlive: {keepAliveMin} | MaxCol: {maxCol} | doAnimate: {doAnimate} | slowRefreshSec: {slowRefreshSec}");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private List<ConfigModel>? CurrConfig = null;
|
||||
|
||||
private bool enableSchedaTecnica = false;
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user