diff --git a/.vs/MP-MON/v14/.suo b/.vs/MP-MON/v14/.suo index d707e568..9c0cd613 100644 Binary files a/.vs/MP-MON/v14/.suo and b/.vs/MP-MON/v14/.suo differ diff --git a/.vs/MP-Tablet/v14/.suo b/.vs/MP-Tablet/v14/.suo index 5e52074b..b54c85a9 100644 Binary files a/.vs/MP-Tablet/v14/.suo and b/.vs/MP-Tablet/v14/.suo differ diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config index 6e6af3d8..5ed4a870 100644 --- a/.vs/config/applicationhost.config +++ b/.vs/config/applicationhost.config @@ -178,7 +178,7 @@ - + diff --git a/MP-Tablet/Web.config b/MP-Tablet/Web.config index ca3e9108..58e886e6 100644 --- a/MP-Tablet/Web.config +++ b/MP-Tablet/Web.config @@ -89,15 +89,22 @@ - + + + + + + - - + + + diff --git a/MP-Tablet/WebUserControls/mod_confProd.ascx b/MP-Tablet/WebUserControls/mod_confProd.ascx index cc2ac09d..f8743b0f 100644 --- a/MP-Tablet/WebUserControls/mod_confProd.ascx +++ b/MP-Tablet/WebUserControls/mod_confProd.ascx @@ -10,8 +10,19 @@ data-theme="e" data-inline="true" Visible="false" OnClick="btnSalva_Click" /> -
- +
+
+ + +
+
+ + +
+
+ + +
diff --git a/MP-Tablet/WebUserControls/mod_confProd.ascx.cs b/MP-Tablet/WebUserControls/mod_confProd.ascx.cs index a5312ead..8378fad1 100644 --- a/MP-Tablet/WebUserControls/mod_confProd.ascx.cs +++ b/MP-Tablet/WebUserControls/mod_confProd.ascx.cs @@ -33,6 +33,7 @@ namespace MoonProTablet.WebUserControls if (!Page.IsPostBack) { lblOut.Text = ""; + switchBtnConferma(false); } } /// @@ -56,34 +57,38 @@ namespace MoonProTablet.WebUserControls /// protected void btnShowConfProd_Click(object sender, EventArgs e) { - switchBtnConferma(); + switchBtnConferma(!txtNumPezzi.Enabled); } /// /// determina comportamento btn conferma /// - 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 } } /// - /// Numero pezzi confermati + /// Numero pezzi PRODOTTI /// - protected int numPzConfermati + protected int numPzProdotti { get { @@ -113,6 +118,33 @@ namespace MoonProTablet.WebUserControls } } /// + /// Numero pezzi SCARTATI + /// + protected int numPzScarto + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(txtNumScarti.Text); + } + catch + { } + return answ; + } + } + /// + /// Numero pezzi confermati (buoni - scarto) + /// + protected int numPzConfermati + { + get + { + return numPzProdotti - numPzScarto; + } + } + /// /// salvo produzione /// /// @@ -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(); + } } } \ No newline at end of file diff --git a/MP-Tablet/WebUserControls/mod_confProd.ascx.designer.cs b/MP-Tablet/WebUserControls/mod_confProd.ascx.designer.cs index d9801d61..420fdd63 100644 --- a/MP-Tablet/WebUserControls/mod_confProd.ascx.designer.cs +++ b/MP-Tablet/WebUserControls/mod_confProd.ascx.designer.cs @@ -30,6 +30,15 @@ namespace MoonProTablet.WebUserControls { /// protected global::System.Web.UI.WebControls.Button btnSalva; + /// + /// lblNumPezzi control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNumPezzi; + /// /// txtNumPezzi control. /// @@ -39,6 +48,42 @@ namespace MoonProTablet.WebUserControls { /// protected global::System.Web.UI.WebControls.TextBox txtNumPezzi; + /// + /// lblNumScarti control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNumScarti; + + /// + /// txtNumScarti control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNumScarti; + + /// + /// lblPzBuoni control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPzBuoni; + + /// + /// txtPzBuoni control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPzBuoni; + /// /// lblOut control. ///