diff --git a/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx b/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx index 539c83d3..aed8c2bd 100644 --- a/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx +++ b/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx @@ -20,7 +20,8 @@
- + + @@ -151,8 +152,10 @@
-
- +
+
+ +
diff --git a/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.cs b/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.cs index 0bdb04d8..6d9e4d22 100644 --- a/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.cs @@ -5,6 +5,25 @@ namespace MP_MAG.WebUserControls { public partial class cmp_AnagCliFor : BaseUserControl { + #region Protected Properties + + protected bool showDet + { + get + { + bool answ = false; + bool.TryParse(hfShowDet.Value, out answ); + return answ; + } + set + { + hfShowDet.Value = $"{value}"; + fixDetailView(value); + } + } + + #endregion Protected Properties + #region Private Methods private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e) @@ -16,51 +35,19 @@ namespace MP_MAG.WebUserControls #region Protected Methods - /// - /// comando reset - /// - /// - /// - protected void lbtReset_Click(object sender, EventArgs e) + protected void fixDetailView(bool showDetail) { - doReset(); - raiseReset(); - } - - /// - /// Aggiunta nuovo record - /// - /// - /// - protected void lbtAddNew_Click(object sender, EventArgs e) - { - MagDataLayerObj.taACF.insertQuery("__CodiceCliente", "Nuova Ragione Sociale", "Nuovo Indirizzo", "Nuova Località", "00000", "BA", "IT", false, true); - doReset(); - } - - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) + divMain.Visible = true; + divDetail.Visible = showDetail; + string mainCss = showDetail ? "col-7 pr-0" : "col-12"; + divMain.Attributes.Remove("class"); + divMain.Attributes.Add("class", mainCss); + for (int i = 7; i < 11; i++) { - grView.PageSize = cmp_numRow.numRow; - fixDetailView(false); + grView.Columns[i].Visible = !showDet; } - cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh; } - #endregion Protected Methods - - #region Public Methods - - public void doReset() - { - grView.SelectedIndex = -1; - grView.DataBind(); - fixDetailView(false); - } - - #endregion Public Methods - protected void grView_RowDeleted(object sender, System.Web.UI.WebControls.GridViewDeletedEventArgs e) { doReset(); @@ -74,16 +61,64 @@ namespace MP_MAG.WebUserControls protected void grView_SelectedIndexChanging(object sender, System.Web.UI.WebControls.GridViewSelectEventArgs e) { cmp_destClienti.codCli = $"{grView.SelectedValue}"; - fixDetailView(true); + showDet = true; } - protected void fixDetailView(bool showDetail) + /// + /// Aggiunta nuovo record + /// + /// + /// + protected void lbtAddNew_Click(object sender, EventArgs e) { - divMain.Visible = true; - divDetail.Visible = showDetail; - string mainCss = showDetail? "col-8": "col-12"; - divMain.Attributes.Remove("class"); - divMain.Attributes.Add("class", mainCss); + MagDataLayerObj.taACF.insertQuery("__CodiceCliente", "Nuova Ragione Sociale", "Nuovo Indirizzo", "Nuova Località", "00000", "BA", "IT", false, true); + doReset(); + } + + /// + /// comando reset + /// + /// + /// + protected void lbtReset_Click(object sender, EventArgs e) + { + doReset(); + raiseReset(); + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + grView.PageSize = cmp_numRow.numRow; + showDet = false; + } + cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh; + } + + #endregion Protected Methods + + #region Public Methods + + public void doReset() + { + grView.SelectedIndex = -1; + grView.DataBind(); + showDet = false; + } + + #endregion Public Methods + + protected void grView_RowCreated(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) + { + //// determino visibilità conollse in caso di selezione dettaglio + //for (int i = 7; i < 10; i++) + //{ + // e.Row.Cells[i].Visible = showDet; + //} + //e.Row.Cells[8].Visible = showDet; + //e.Row.Cells[9].Visible = showDet; + //e.Row.Cells[10].Visible = showDet; } } } \ No newline at end of file diff --git a/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.designer.cs b/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.designer.cs index 1a972436..aae52bfd 100644 --- a/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.designer.cs +++ b/MP-MAG/WebUserControls/cmp_AnagCliFor.ascx.designer.cs @@ -41,6 +41,15 @@ namespace MP_MAG.WebUserControls /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMain; + /// + /// hfShowDet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfShowDet; + /// /// grView control. /// diff --git a/MP-MAG/WebUserControls/cmp_destClienti.ascx b/MP-MAG/WebUserControls/cmp_destClienti.ascx index b2007911..ba3c8c89 100644 --- a/MP-MAG/WebUserControls/cmp_destClienti.ascx +++ b/MP-MAG/WebUserControls/cmp_destClienti.ascx @@ -1,6 +1,11 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_destClienti.ascx.cs" Inherits="MP_MAG.WebUserControls.cmp_destClienti" %> + +
+

0 Record Found

+
+
diff --git a/MP-MAG/WebUserControls/cmp_destClienti.ascx.cs b/MP-MAG/WebUserControls/cmp_destClienti.ascx.cs index e269599f..d7af8c2e 100644 --- a/MP-MAG/WebUserControls/cmp_destClienti.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_destClienti.ascx.cs @@ -23,6 +23,7 @@ namespace MP_MAG.WebUserControls set { hfCodCli.Value = value; + grView.DataBind(); } } }