diff --git a/MP-ADM/Planner.aspx.cs b/MP-ADM/Planner.aspx.cs index 2a75274c..f17de81c 100644 --- a/MP-ADM/Planner.aspx.cs +++ b/MP-ADM/Planner.aspx.cs @@ -37,6 +37,7 @@ namespace MP_ADM mod_planCreate.CodGruppo = mod_planStats.CodGruppo; mod_planCreate.IdxMacchina = mod_planStats.IdxMacchina; mod_planCreate.CodArticolo = mod_planStats.CodArticolo; + mod_planCreate.doUpdate(); } private void checkEnabled() diff --git a/MP-ADM/WebUserControls/mod_planCreate.ascx b/MP-ADM/WebUserControls/mod_planCreate.ascx index a0fc0386..f8eedfa7 100644 --- a/MP-ADM/WebUserControls/mod_planCreate.ascx +++ b/MP-ADM/WebUserControls/mod_planCreate.ascx @@ -31,10 +31,10 @@ + OnCheckedChanged="btnSelAll_Click" CssClass="btn btn-default btn-sm" AutoPostBack="true"> - + @@ -70,15 +70,25 @@ - - + + + + + + + + - + - + + + + + @@ -90,10 +100,20 @@
- Tot pezzi -
- Tot ore -
+
+
+
Tot PEZZI (num)
+
+ +
+
+
+
Tot Tempo (ore)
+
+ +
+
+
CREA PODL Gruppo Selezionare LA MACCHINA ESATTA su cui creare... diff --git a/MP-ADM/WebUserControls/mod_planCreate.ascx.cs b/MP-ADM/WebUserControls/mod_planCreate.ascx.cs index 11e41faa..a2220c57 100644 --- a/MP-ADM/WebUserControls/mod_planCreate.ascx.cs +++ b/MP-ADM/WebUserControls/mod_planCreate.ascx.cs @@ -47,6 +47,11 @@ namespace MP_ADM.WebUserControls hfIdxMacchina.Value = value; } } + public void doUpdate() + { + grView.DataBind(); + calcTotali(); + } /// /// seleziona/deseleziona le righe indicate... /// @@ -69,6 +74,7 @@ namespace MP_ADM.WebUserControls { ((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked; } + calcTotali(); } @@ -93,5 +99,43 @@ namespace MP_ADM.WebUserControls divDetail.Visible = !divDetail.Visible; tgIcon.Attributes["class"] = divDetail.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down"; } + + protected void chkSelect_CheckedChanged(object sender, EventArgs e) + { + calcTotali(); + } + + private void calcTotali() + { + // update valori calcolati in base a selezione... + int numPzOrd = 0; + decimal tempoMinOrd = 0; + int numPzTot = 0; + decimal tempoMinTot = 0; + int idxPromessa = 0; + foreach (GridViewRow riga in grView.Rows) + { + numPzOrd = 0; + tempoMinOrd = 0; + DateTime DataRif = DateTime.Now.Date; + if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible) + { + try + { + // idxPromessa = Convert.ToInt32(((Label)riga.FindControl("lblIdxODL")).Text); + int.TryParse(((Label)riga.FindControl("lblNumPezzi")).Text.Replace(".", ""), out numPzOrd); + decimal.TryParse(((Label)riga.FindControl("lblTotMinuti")).Text, out tempoMinOrd); + } + catch + { } + numPzTot += numPzOrd; + tempoMinTot += tempoMinOrd; + //MapoDb.DataLayer.obj.taAs400.insProdAs400(IdxODL, DataRif); + } + } + //grView.DataBind(); + lblNumPzTot.Text = $"{numPzTot:N0}"; + lblOreTot.Text = $"{tempoMinTot / 60:N2}"; + } } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs b/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs index a62bd01e..49d73485 100644 --- a/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs @@ -93,6 +93,24 @@ namespace MP_ADM.WebUserControls { /// protected global::System.Web.UI.WebControls.ObjectDataSource odsPromIN; + /// + /// Controllo lblNumPzTot. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblNumPzTot; + + /// + /// Controllo lblOreTot. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblOreTot; + /// /// Controllo lbtCreaGrp. ///