inizio aggiunta gestione scarti + review conf produzione
This commit is contained in:
@@ -20,18 +20,50 @@
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textCondens text-right">
|
||||
<div class="row textCondens">
|
||||
<div class="col-12 py-1 text-center text-uppercase">
|
||||
<b>Dati dall'avvio produzione/ODL</b>
|
||||
</div>
|
||||
<div class="col-4 pr-1 py-0 text-right">
|
||||
<div class="alert alert-info py-1">
|
||||
Pz Prodotti TOT (contapezzi / tot ODL)
|
||||
<div style="font-size: 2em; font-weight: bold;" class="my-0">
|
||||
1525
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 px-1 py-0 text-right">
|
||||
<div class="alert alert-danger py-1">
|
||||
Scarti scaricati
|
||||
<div style="font-size: 2em; font-weight: bold;" class="my-0">
|
||||
15
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 pl-1 py-0 text-right">
|
||||
<div class="alert alert-success py-1">
|
||||
Pezzi Buoni VERSATI
|
||||
<div style="font-size: 2em; font-weight: bold;" class="my-0">
|
||||
1510
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textCondens text-right bg-secondary">
|
||||
<div class="col-12 py-1 text-center text-uppercase">
|
||||
<b>Incrementali (da ultima conferma)</b>
|
||||
</div>
|
||||
<div class="col-4 pr-1">
|
||||
<asp:Label runat="server" ID="lblNumPezzi" AssociatedControlID="txtNumPezzi" Text="Pz Prodotti" />
|
||||
<asp:TextBox runat="server" ID="txtNumPezzi" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-right" Enabled="false" AutoPostBack="True" OnTextChanged="txtNumPezzi_TextChanged" />
|
||||
<asp:TextBox runat="server" ID="txtNumPezzi" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-right alert alert-info py-0" Enabled="false" AutoPostBack="True" OnTextChanged="txtNumPezzi_TextChanged" />
|
||||
</div>
|
||||
<div class="col-4 px-1">
|
||||
<asp:Label runat="server" ID="lblNumScarti" AssociatedControlID="txtNumScarti" Text="Pz Scarto(-)" />
|
||||
<asp:TextBox runat="server" ID="txtNumScarti" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-right" Enabled="false" AutoPostBack="True" OnTextChanged="txtNumScarti_TextChanged" />
|
||||
<asp:TextBox runat="server" ID="txtNumScarti" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-right alert alert-danger py-0" Enabled="false" AutoPostBack="True" OnTextChanged="txtNumScarti_TextChanged" />
|
||||
</div>
|
||||
<div class="col-4 pl-1">
|
||||
<asp:Label runat="server" ID="lblPzBuoni" AssociatedControlID="txtPzBuoni" Text="Pezzi Buoni" />
|
||||
<asp:TextBox runat="server" ID="txtPzBuoni" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-right" Enabled="false" Text="---" />
|
||||
<asp:TextBox runat="server" ID="txtPzBuoni" Font-Size="XX-Large" TextMode="Number" CssClass="form-control text-right alert alert-success py-0" Enabled="false" Text="---" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_regScarti.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_regScarti" %>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<asp:Label runat="server" ID="lblConfScarti" CssClass="btn btn-warning btn-lg btn-block disabled">
|
||||
<i class="fa fa-bug"></i> Registra SCARTI
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" ID="lblMancaODL" Visible="false" ForeColor="Red">MANCA ODL: registrazione scarti produzione NON permessa</asp:Label>
|
||||
<asp:LinkButton runat="server" ID="lbtShowScarti" OnClick="lbtShowContr_Click" CssClass="btn btn-warning btn-lg btn-block">
|
||||
<i class="fa fa-bug"></i>
|
||||
<asp:Label runat="server" ID="lblShowScarti" />
|
||||
</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 class="row my-2" runat="server">
|
||||
<div class="col-6">
|
||||
<asp:LinkButton runat="server" ID="lbtOK" CssClass="btn btn-block btn-success" OnClick="lbtOK_Click">OK</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<asp:LinkButton runat="server" ID="lbtKO" CssClass="btn btn-block btn-danger" OnClick="lbtKO_Click">KO</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-12" runat="server" id="divNote" visible="false">
|
||||
<asp:Label runat="server" ID="Label1" CssClass="small disabled" AssociatedControlID="txtNoteContr">
|
||||
Note controllo NON superato (opzionali)
|
||||
</asp:Label>
|
||||
<asp:TextBox runat="server" ID="txtNoteContr" TextMode="MultiLine" CssClass="form-control"></asp:TextBox>
|
||||
<asp:LinkButton runat="server" ID="lbtSalva" CssClass="btn btn-danger text-light btn-lg btn-block" OnClick="lbtSalva_Click"><i class="fa fa-floppy-o"></i> CONFERMA controllo KO</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-12">
|
||||
<asp:Label runat="server" ID="lblOut" ForeColor="Red" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,255 @@
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_regScarti : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_newVal;
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_reset;
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
checkAll();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAll()
|
||||
{
|
||||
fixSelMacc();
|
||||
checkOdl();
|
||||
lblOut.Text = "";
|
||||
switchBtnConferma(false);
|
||||
lbtShowScarti.Visible = odlOk;
|
||||
lblConfScarti.Visible = !odlOk;
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se abbia un ODL ATTIVO
|
||||
/// </summary>
|
||||
private void checkOdl()
|
||||
{
|
||||
lbtShowScarti.Visible = odlOk;
|
||||
lblConfScarti.Visible = !odlOk;
|
||||
lblMancaODL.Visible = !odlOk;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
protected bool isMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchinaSession);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se la machcina è MULTI --> mostro selettore
|
||||
/// </summary>
|
||||
private void fixSelMacc()
|
||||
{
|
||||
divSelMacc.Visible = isMulti;
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce css disabled SE odl NON OK...
|
||||
/// </summary>
|
||||
public string cssBtnConf
|
||||
{
|
||||
get
|
||||
{
|
||||
return odlOk ? "" : "disabled";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica ODL OK (ovvero caricato x macchina...)
|
||||
/// </summary>
|
||||
public bool odlOk
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = true;
|
||||
// carico i dati preliminari: ODL
|
||||
int idxOdl = 0; // userò ODL del turno
|
||||
try
|
||||
{
|
||||
idxOdl = DataLayer.obj.taODL.getByMacchinaAperto(idxMacchina)[0].IdxODL;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore a recuperare ODL per la macchina {0}", idxMacchina), tipoLog.ERROR);
|
||||
}
|
||||
// se ODL > 0 è ok!!!
|
||||
answ = (idxOdl > 0);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
// verifoc: se multi uso selettore tendina...
|
||||
if (isMulti)
|
||||
{
|
||||
if (ddlSubMacc.SelectedValue == "")
|
||||
{
|
||||
ddlSubMacc.DataBind();
|
||||
}
|
||||
if (ddlSubMacc.SelectedValue != "")
|
||||
{
|
||||
answ = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchinaSession
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// cambio stato visibilità pannello e testo button
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtShowContr_Click(object sender, EventArgs e)
|
||||
{
|
||||
switchBtnConferma(!lbtOK.Visible);
|
||||
}
|
||||
/// <summary>
|
||||
/// determina comportamento btn conferma
|
||||
/// </summary>
|
||||
private void switchBtnConferma(bool showConf)
|
||||
{
|
||||
lbtOK.Visible = showConf;
|
||||
lbtKO.Visible = showConf;
|
||||
lbtSalva.Visible = showConf;
|
||||
if (showConf)
|
||||
{
|
||||
lblShowScarti.Text = "Nascondi SCARTI";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblShowScarti.Text = "Registra SCARTI";
|
||||
// sollevo evento!
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo produzione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSalva_Click(object sender, EventArgs e)
|
||||
{
|
||||
// salvo controllo KO
|
||||
DataLayer.obj.taRC.insertQuery(idxMacchina, DataLayer.MatrOpr, false, txtNoteContr.Text.Trim(), DateTime.Now);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
}
|
||||
resetControlli();
|
||||
}
|
||||
|
||||
private void resetControlli()
|
||||
{
|
||||
txtNoteContr.Text = "";
|
||||
// nascondo!
|
||||
switchBtnConferma(false);
|
||||
divNote.Visible = false;
|
||||
}
|
||||
|
||||
protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
checkAll();
|
||||
}
|
||||
|
||||
protected void ddlSubMacc_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// se ho in memoria un valore LO REIMPOSTO...
|
||||
if (subMaccSel != "")
|
||||
{
|
||||
// provo a preselezionare...
|
||||
try
|
||||
{
|
||||
ddlSubMacc.SelectedValue = subMaccSel;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Sotto sistema (macchina) selezionato
|
||||
/// </summary>
|
||||
public string subMaccSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("subMaccSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("subMaccSel", value);
|
||||
}
|
||||
}
|
||||
|
||||
protected void lbtOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Salvo controllo come OK
|
||||
DataLayer.obj.taRC.insertQuery(idxMacchina, DataLayer.MatrOpr, true, "", DateTime.Now);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
}
|
||||
resetControlli();
|
||||
}
|
||||
|
||||
protected void lbtKO_Click(object sender, EventArgs e)
|
||||
{
|
||||
divNote.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MoonProTablet.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_regScarti {
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblConfScarti.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblConfScarti;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblMancaODL.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblMancaODL;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtShowScarti.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtShowScarti;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblShowScarti.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblShowScarti;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divSelMacc.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSelMacc;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ddlSubMacc.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlSubMacc;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtOK.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtOK;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtKO.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtKO;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divNote.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divNote;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo Label1.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo txtNoteContr.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtNoteContr;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtSalva.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtSalva;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblOut.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblOut;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user