diff --git a/XPS/mod_elencoComm.ascx b/XPS/mod_elencoComm.ascx index bad937a..a08f148 100644 --- a/XPS/mod_elencoComm.ascx +++ b/XPS/mod_elencoComm.ascx @@ -1,7 +1,7 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_elencoComm.ascx.cs" Inherits="mod_elencoComm" %> - <%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
@@ -54,7 +54,7 @@
- + @@ -65,28 +65,84 @@ - <%----%> - - - + + + + + + + + + + + + + + + + + + + + + + - - - + - + + + + + + + + + + + + + + + + + + + - + + + + +
+ +

Dettaglio del DDT:
- pulsanti aggiunta
diff --git a/XPS/mod_elencoComm.ascx.cs b/XPS/mod_elencoComm.ascx.cs index fce6046..a6a82bc 100644 --- a/XPS/mod_elencoComm.ascx.cs +++ b/XPS/mod_elencoComm.ascx.cs @@ -12,6 +12,136 @@ using SteamWare; public partial class mod_elencoComm : ApplicationUserControl { + #region area da NON modificare + + #region area protected + + protected string _idxGridView; + protected bool _showNewBtn = true; + + ///

+ /// aggiorna controlli datagrid e numero righe in pagina + /// + protected override void aggiornaControlliDataGL() + { + base.aggiornaControlliDataGL(); + grView.PageSize = _righeDataGridMed; + } + /// + /// 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 = ""; + } + } + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + /// + /// gestione cambio selezione valore + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in session il valore selezionato... + SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue); + // sollevo evento nuovo valore... + if (eh_selValore != null) + { + eh_selValore(this, new EventArgs()); + } + } + + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + grView.SelectedIndex = -1; + grView.DataBind(); + } + + + #endregion + + #region gestione eventi + + public event EventHandler eh_resetSelezione; + public event EventHandler eh_nuovoValore; + public event EventHandler eh_selValore; + + #endregion + + #region public + + /// + /// definisce visibilità btnNew + /// + public bool showNewBtn + { + get + { + return _showNewBtn; + } + set + { + _showNewBtn = value; + } + } + /// + /// effettua update del modulo + /// + public void doUpdate() + { + resetSelezione(); + } + + #endregion + + #endregion + + #region area codice variabile + + /// + /// elenco colonne del datagrid + /// + /// + protected DataColumnCollection colonneObj() + { + DS_applicazione.v_commesseDataTable tabella = new DS_applicazione.v_commesseDataTable(); + DataColumnCollection colonne = tabella.Columns; + return colonne; + } + /// /// inizializzazione valori di default @@ -20,6 +150,7 @@ public partial class mod_elencoComm : ApplicationUserControl protected override void OnInit(EventArgs e) { base.OnInit(e); + _idxGridView = "Cod"; if (!Page.IsPostBack) { mf_clienti.ods = odsFiltroClienti; @@ -68,13 +199,47 @@ public partial class mod_elencoComm : ApplicationUserControl protected void btnNewComm_Click(object sender, EventArgs e) { // creazione di un nuovo set... - DS_applicazioneTableAdapters.SP taSP = new DS_applicazioneTableAdapters.SP(); - taSP.sp_creaSetObj(DateTime.Now.ToString("yyyyMMdd_hhmmss"), "EQUA", mf_cliNew.valore, txtDDT.Text, txtNome.Text, user_std.UtSn.utente, "..."); - + DS_applicazioneTableAdapters.v_commesseTableAdapter taComm = new DS_applicazioneTableAdapters.v_commesseTableAdapter(); + taComm.sp_creaSetObj(DateTime.Now.ToString("yyyyMMdd_hhmmss"), "EQUA", mf_cliNew.valore, txtDDT.Text, txtNome.Text, user_std.UtSn.utente, "..."); // nascondo tutto... txtNome.Text = ""; scambiaVisibPnlNew(); // aggiorno pannello... grView.DataBind(); } + + /// + /// inserisce nuovo valore da footer + /// + /// + /// + protected void lblIns_click(object sender, EventArgs e) + { + // click su inserimento, chiamo il metodo insert dell'ObjectDataSource + ods.Insert(); + } + /// + /// gestione evento richeista nuovo valore (mostra footer, ...) + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + // reset selezione... + resetSelezione(); + // mostro il footer oppure la riga dei dettagli x nuovo... + if (grView.FooterRow != null) + { + grView.FooterRow.Visible = true; + } +#if false + // sollevo evento nuovo valore... + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } +#endif + } + + #endregion } \ No newline at end of file diff --git a/db/SteamWare_XPS.zip b/db/SteamWare_XPS.zip index bb8a1b6..6b13b98 100644 Binary files a/db/SteamWare_XPS.zip and b/db/SteamWare_XPS.zip differ