aggiunti elementi grafici x salvare num pezzi buoni/scarto
This commit is contained in:
@@ -10,8 +10,19 @@
|
||||
data-theme="e" data-inline="true" Visible="false" OnClick="btnSalva_Click" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-grid-solo">
|
||||
<asp:TextBox runat="server" ID="txtNumPezzi" Font-Size="XX-Large" Width="5em" Visible="false" />
|
||||
<div class="ui-grid-b">
|
||||
<div class="ui-block-a" data-role="content">
|
||||
<asp:Label runat="server" ID="lblNumPezzi" AssociatedControlID="txtNumPezzi" Text="Pezzi Prodotti" />
|
||||
<asp:TextBox runat="server" ID="txtNumPezzi" Font-Size="XX-Large" Width="5em" Enabled="false" AutoPostBack="True" OnTextChanged="txtNumPezzi_TextChanged" />
|
||||
</div>
|
||||
<div class="ui-block-b" data-role="content">
|
||||
<asp:Label runat="server" ID="lblNumScarti" AssociatedControlID="txtNumScarti" Text="Pezzi Scarto" />
|
||||
<asp:TextBox runat="server" ID="txtNumScarti" Font-Size="XX-Large" Width="5em" Enabled="false" AutoPostBack="True" OnTextChanged="txtNumScarti_TextChanged" />
|
||||
</div>
|
||||
<div class="ui-block-c" data-role="content">
|
||||
<asp:Label runat="server" ID="lblPzBuoni" AssociatedControlID="txtPzBuoni" Text="Pezzi Buoni" />
|
||||
<asp:TextBox runat="server" ID="txtPzBuoni" Font-Size="XX-Large" Width="5em" Enabled="false" Text="---" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-grid-solo">
|
||||
<asp:Label runat="server" ID="lblOut" ForeColor="Red" />
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace MoonProTablet.WebUserControls
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
lblOut.Text = "";
|
||||
switchBtnConferma(false);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -56,34 +57,38 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnShowConfProd_Click(object sender, EventArgs e)
|
||||
{
|
||||
switchBtnConferma();
|
||||
switchBtnConferma(!txtNumPezzi.Enabled);
|
||||
}
|
||||
/// <summary>
|
||||
/// determina comportamento btn conferma
|
||||
/// </summary>
|
||||
private void switchBtnConferma()
|
||||
private void switchBtnConferma(bool showConf)
|
||||
{
|
||||
txtNumPezzi.Visible = !txtNumPezzi.Visible;
|
||||
btnSalva.Visible = txtNumPezzi.Visible;
|
||||
if (txtNumPezzi.Visible)
|
||||
txtNumPezzi.Enabled = showConf;
|
||||
txtNumScarti.Enabled = showConf;
|
||||
//txtPzBuoni.Visible = showConf;
|
||||
btnSalva.Visible = showConf;
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
|
||||
rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
|
||||
try
|
||||
{
|
||||
txtNumPezzi.Text = rigaProd.pezziNonConfermati.ToString();
|
||||
txtNumScarti.Text = "0";
|
||||
txtPzBuoni.Text = numPzConfermati.ToString();
|
||||
// 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}", idxMacchina), tipoLog.ERROR);
|
||||
}
|
||||
if (showConf)
|
||||
{
|
||||
btnShowConfProd.Text = "Nascondi Conferma";
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
|
||||
rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
|
||||
try
|
||||
{
|
||||
txtNumPezzi.Text = rigaProd.pezziNonConfermati.ToString();
|
||||
// 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}", idxMacchina), tipoLog.ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -96,9 +101,9 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi confermati
|
||||
/// Numero pezzi PRODOTTI
|
||||
/// </summary>
|
||||
protected int numPzConfermati
|
||||
protected int numPzProdotti
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -113,6 +118,33 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi SCARTATI
|
||||
/// </summary>
|
||||
protected int numPzScarto
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(txtNumScarti.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi confermati (buoni - scarto)
|
||||
/// </summary>
|
||||
protected int numPzConfermati
|
||||
{
|
||||
get
|
||||
{
|
||||
return numPzProdotti - numPzScarto;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo produzione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
@@ -132,7 +164,7 @@ namespace MoonProTablet.WebUserControls
|
||||
// mostro output
|
||||
lblOut.Text = string.Format("Confermata la produzione per {0} pezzi!", numPzConfermati);
|
||||
// cambio button conferma...
|
||||
switchBtnConferma();
|
||||
switchBtnConferma(!txtNumPezzi.Enabled);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
@@ -262,5 +294,20 @@ namespace MoonProTablet.WebUserControls
|
||||
#endif
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina.ToString(), memLayer.ML.confReadInt("modoConfProd"), numPzConfermati);
|
||||
}
|
||||
|
||||
protected void txtNumPezzi_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
updatePzBuoni();
|
||||
}
|
||||
|
||||
private void updatePzBuoni()
|
||||
{
|
||||
txtPzBuoni.Text = numPzConfermati.ToString();
|
||||
}
|
||||
|
||||
protected void txtNumScarti_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
updatePzBuoni();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,15 @@ namespace MoonProTablet.WebUserControls {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnSalva;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumPezzi control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumPezzi;
|
||||
|
||||
/// <summary>
|
||||
/// txtNumPezzi control.
|
||||
/// </summary>
|
||||
@@ -39,6 +48,42 @@ namespace MoonProTablet.WebUserControls {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtNumPezzi;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumScarti control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumScarti;
|
||||
|
||||
/// <summary>
|
||||
/// txtNumScarti control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtNumScarti;
|
||||
|
||||
/// <summary>
|
||||
/// lblPzBuoni control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPzBuoni;
|
||||
|
||||
/// <summary>
|
||||
/// txtPzBuoni control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtPzBuoni;
|
||||
|
||||
/// <summary>
|
||||
/// lblOut control.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user