From 91ec2da52aa26d0f1d16345ae097beb7082ce1cc Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 27 Jan 2021 15:09:36 +0100 Subject: [PATCH] fix filtraggio promesse attivate --- MP-ADM/Planner.aspx.cs | 9 +- MP-ADM/WebUserControls/cmp_PODL_OUT.ascx | 71 ++---- MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.cs | 236 ++++-------------- .../cmp_PODL_OUT.ascx.designer.cs | 98 ++------ MapoDb/DS_Plan.Designer.cs | 27 +- MapoDb/DS_Plan.xsd | 5 +- MapoDb/DS_Plan.xss | 2 +- 7 files changed, 117 insertions(+), 331 deletions(-) diff --git a/MP-ADM/Planner.aspx.cs b/MP-ADM/Planner.aspx.cs index bd37afa7..03065cf8 100644 --- a/MP-ADM/Planner.aspx.cs +++ b/MP-ADM/Planner.aspx.cs @@ -66,11 +66,16 @@ namespace MP_ADM protected void doRefreshChild() { + cmp_planApprove.CodArticolo = cmp_planStats.CodArticolo; + cmp_planApprove.CodCliente = cmp_planStats.CodCliente; cmp_planApprove.CodGruppo = cmp_planStats.CodFase; cmp_planApprove.IdxMacchina = cmp_planStats.IdxMacchina; - cmp_planApprove.CodCliente = cmp_planStats.CodCliente; - cmp_planApprove.CodArticolo = cmp_planStats.CodArticolo; cmp_planApprove.doUpdate(); + cmp_PODL_OUT.CodArticolo = cmp_planStats.CodArticolo; + cmp_PODL_OUT.CodCliente = cmp_planStats.CodCliente; + cmp_PODL_OUT.CodGruppo = cmp_planStats.CodFase; + cmp_PODL_OUT.IdxMacchina = cmp_planStats.IdxMacchina; + cmp_PODL_OUT.doUpdate(); } protected void lbtToggle_Click(object sender, EventArgs e) diff --git a/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx b/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx index 6ac4111d..800bfeb4 100644 --- a/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx +++ b/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx @@ -5,37 +5,14 @@
-
-

Filtri attivi

+
+

PODL attivi

-
- REPARTO -
- - - - +
+ btn attiva/disattiva/elimina
-
-
-
- Articolo - - -
-
-
-
-
-
- Macchina - - -
-
-
-
-
+
+
@@ -47,7 +24,7 @@
- + @@ -56,6 +33,15 @@ + + + + + + + + @@ -66,15 +52,6 @@ - - - - - - - -
@@ -154,20 +131,22 @@ - - - + + + + + - - - - + + + + diff --git a/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.cs b/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.cs index 312ea46e..c7d40ab0 100644 --- a/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.cs +++ b/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.cs @@ -26,90 +26,38 @@ namespace MP_ADM.WebUserControls #endregion Public Fields - #region Protected Properties - - /// - /// CodArt filtrato - /// - protected string CodArt - { - get - { - return lblCodArt.Text; - } - set - { - lblCodArt.Text = value; - } - } - - /// - /// CodArt filtrato - /// - protected string DescArt - { - get - { - return lblDescArt.Text; - } - set - { - lblDescArt.Text = value; - } - } - - /// - /// IdxMacchina filtrata - /// - protected string idxMacc - { - get - { - return lblIdxMacc.Text; - } - set - { - lblIdxMacc.Text = value; - } - } - - /// - /// idxOdl selezionato - /// - protected int idxPOdlSel - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(grView.SelectedValue); - } - catch - { } - return answ; - } - } - - /// - /// Nome filtrata - /// - protected string NomeMacc - { - get - { - return lblNomeMacc.Text; - } - set - { - lblNomeMacc.Text = value; - } - } - - #endregion Protected Properties - #region Public Properties + /// + /// CodArt filtrato + /// + public string CodArticolo + { + get + { + return hfCodArt.Value; + } + set + { + hfCodArt.Value = value; + } + } + + /// + /// Chiave PRE selezione tipo richiesta ordine + /// + public string CodCliente + { + get + { + return hfCodCli.Value; + } + set + { + hfCodCli.Value = value; + } + } + /// /// Gruppo selezionato /// @@ -117,41 +65,26 @@ namespace MP_ADM.WebUserControls { get { - return ddlCodGruppo.SelectedValue; + return hfCodGrp.Value; } set { - ddlCodGruppo.SelectedValue = value; + hfCodGrp.Value = value; } } /// - /// Chiave PRE selezione tipo richiesta ordine + /// IdxMacchina filtrata /// - public string codOrdPre + public string IdxMacchina { get { - return hfCodPre.Value.Trim(); + return hfIdxMacc.Value; } set { - hfCodPre.Value = value; - } - } - - /// - /// Abilitazione modifica selettore fase - /// - public bool enableSelFase - { - get - { - return ddlCodGruppo.Enabled; - } - set - { - ddlCodGruppo.Enabled = value; + hfIdxMacc.Value = value; } } @@ -253,48 +186,6 @@ namespace MP_ADM.WebUserControls return colonne; } - protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e) - { - // salvo in sessione selezione... - memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue); - } - - protected void doUpdate() - { - updateGrView(); - raiseSelNew(); - } - - /// - /// traduce gli header delle colonne - /// - /// - /// - protected void grView_DataBound(object sender, EventArgs e) - { - if (grView.Rows.Count > 0) - { - LinkButton lb; - // aggiorno gli headers - foreach (TableCell cella in grView.HeaderRow.Cells) - { - try - { - lb = (LinkButton)cella.Controls[0]; - lb.Text = traduci(lb.Text); - } - catch - { } - } - int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); - lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); - } - else - { - lblNumRec.Text = ""; - } - } - /// /// salvo comando /// @@ -323,50 +214,6 @@ namespace MP_ADM.WebUserControls raiseNewVal(); } - protected void lbtResArt_Click(object sender, EventArgs e) - { - CodArt = ""; - DescArt = ""; - updateGrView(); - } - - protected void lbtResMacc_Click(object sender, EventArgs e) - { - idxMacc = ""; - NomeMacc = ""; - updateGrView(); - } - - /// - /// Selezionato un condominio --> riporto selezione - /// - /// - /// - protected void lbtSelArt_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - string[] artData = lb.CommandArgument.Split('|'); - CodArt = artData[0]; - DescArt = artData[1]; - updateGrView(); - } - - /// - /// Selezionato un condominio --> riporto selezione - /// - /// - /// - protected void lbtSelMacc_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - string[] maccData = lb.CommandArgument.Split('|'); - idxMacc = maccData[0]; - NomeMacc = maccData[1]; - updateGrView(); - } - /// /// Richiesto abbassamento priorità = ANTICIPA /// @@ -417,11 +264,6 @@ namespace MP_ADM.WebUserControls if (!Page.IsPostBack) { grView.PageSize = pageSize; - // se ho in sessione selezione la recupero... - if (memLayer.ML.isInSessionObject("selFaseBCode") && enableSelFase) - { - ddlCodGruppo.SelectedValue = memLayer.ML.StringSessionObj("selFaseBCode"); - } } } @@ -480,6 +322,12 @@ namespace MP_ADM.WebUserControls return answ; } + public void doUpdate() + { + updateGrView(); + raiseSelNew(); + } + /// /// formatot url x stampa ODL /// diff --git a/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.designer.cs b/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.designer.cs index 02dd96b0..e23bfa64 100644 --- a/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.designer.cs +++ b/MP-ADM/WebUserControls/cmp_PODL_OUT.ascx.designer.cs @@ -14,78 +14,6 @@ namespace MP_ADM.WebUserControls public partial class cmp_PODL_OUT { - /// - /// Controllo ddlCodGruppo. - /// - /// - /// 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.DropDownList ddlCodGruppo; - - /// - /// Controllo odsCodGruppo. - /// - /// - /// 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.ObjectDataSource odsCodGruppo; - - /// - /// Controllo lbtResArt. - /// - /// - /// 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.LinkButton lbtResArt; - - /// - /// Controllo lblCodArt. - /// - /// - /// 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 lblCodArt; - - /// - /// Controllo lblDescArt. - /// - /// - /// 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 lblDescArt; - - /// - /// Controllo lbtResMacc. - /// - /// - /// 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.LinkButton lbtResMacc; - - /// - /// Controllo lblNomeMacc. - /// - /// - /// 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 lblNomeMacc; - - /// - /// Controllo lblIdxMacc. - /// - /// - /// 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 lblIdxMacc; - /// /// Controllo chkUnassigned. /// @@ -114,22 +42,40 @@ namespace MP_ADM.WebUserControls protected global::System.Web.UI.WebControls.GridView grView; /// - /// Controllo hfCodGruppo. + /// Controllo hfIdxMacc. /// /// /// 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.HiddenField hfCodGruppo; + protected global::System.Web.UI.WebControls.HiddenField hfIdxMacc; /// - /// Controllo hfCodPre. + /// Controllo hfCodGrp. /// /// /// 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.HiddenField hfCodPre; + protected global::System.Web.UI.WebControls.HiddenField hfCodGrp; + + /// + /// Controllo hfCodArt. + /// + /// + /// 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.HiddenField hfCodArt; + + /// + /// Controllo hfCodCli. + /// + /// + /// 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.HiddenField hfCodCli; /// /// Controllo ods. diff --git a/MapoDb/DS_Plan.Designer.cs b/MapoDb/DS_Plan.Designer.cs index a9a04a72..f6c368d1 100644 --- a/MapoDb/DS_Plan.Designer.cs +++ b/MapoDb/DS_Plan.Designer.cs @@ -11516,9 +11516,10 @@ SELECT idxPromessa, KeyRichiesta, KeyBCode, Attivabile, IdxODL, CodArticolo, Cod this._commandCollection[2].CommandText = "dbo.stp_PODL_OUT_getByMaccArt"; this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodGruppo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodCliente", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@onlyFree", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; @@ -11581,13 +11582,13 @@ SELECT idxPromessa, KeyRichiesta, KeyBCode, Attivabile, IdxODL, CodArticolo, Cod [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_Plan.PromesseOUTDataTable getByMaccArt(string IdxMacchina, string CodArticolo, string CodGruppo, global::System.Nullable onlyFree) { + public virtual DS_Plan.PromesseOUTDataTable getByMaccArt(string CodGruppo, string CodArticolo, string IdxMacchina, string CodCliente, global::System.Nullable onlyFree) { this.Adapter.SelectCommand = this.CommandCollection[2]; - if ((IdxMacchina == null)) { + if ((CodGruppo == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } else { - this.Adapter.SelectCommand.Parameters[1].Value = ((string)(IdxMacchina)); + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodGruppo)); } if ((CodArticolo == null)) { this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; @@ -11595,17 +11596,23 @@ SELECT idxPromessa, KeyRichiesta, KeyBCode, Attivabile, IdxODL, CodArticolo, Cod else { this.Adapter.SelectCommand.Parameters[2].Value = ((string)(CodArticolo)); } - if ((CodGruppo == null)) { + if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; } else { - this.Adapter.SelectCommand.Parameters[3].Value = ((string)(CodGruppo)); + this.Adapter.SelectCommand.Parameters[3].Value = ((string)(IdxMacchina)); } - if ((onlyFree.HasValue == true)) { - this.Adapter.SelectCommand.Parameters[4].Value = ((bool)(onlyFree.Value)); + if ((CodCliente == null)) { + this.Adapter.SelectCommand.Parameters[4].Value = global::System.DBNull.Value; } else { - this.Adapter.SelectCommand.Parameters[4].Value = global::System.DBNull.Value; + this.Adapter.SelectCommand.Parameters[4].Value = ((string)(CodCliente)); + } + if ((onlyFree.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[5].Value = ((bool)(onlyFree.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[5].Value = global::System.DBNull.Value; } DS_Plan.PromesseOUTDataTable dataTable = new DS_Plan.PromesseOUTDataTable(); this.Adapter.Fill(dataTable); diff --git a/MapoDb/DS_Plan.xsd b/MapoDb/DS_Plan.xsd index 40719ef4..002b6918 100644 --- a/MapoDb/DS_Plan.xsd +++ b/MapoDb/DS_Plan.xsd @@ -403,9 +403,10 @@ FROM v_PODL_OUT_exp dbo.stp_PODL_OUT_getByMaccArt - - + + + diff --git a/MapoDb/DS_Plan.xss b/MapoDb/DS_Plan.xss index 10a89355..c8770e13 100644 --- a/MapoDb/DS_Plan.xss +++ b/MapoDb/DS_Plan.xss @@ -12,7 +12,7 @@ - +