modifiche per portare filtro fuori dalle tab in mtz programmata

git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@151 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
ermanno
2009-11-25 16:11:11 +00:00
parent 3b55d8bf81
commit 6c9518711c
7 changed files with 185 additions and 3087 deletions
File diff suppressed because it is too large Load Diff
@@ -3,7 +3,7 @@
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/WebUserControls/mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
<div style="width: 100%; background: #cdcdcd;" class="txtMini">
<table cellpadding="5px">
<%-- <table cellpadding="5px">
<tr valign="top">
<td style="width: 250px;">
<div>
@@ -38,7 +38,7 @@
</div>
</td>
</tr>
</table>
</table>--%>
<asp:Button ID="btnShowNew" runat="server" OnClick="btnShowNew_Click" />
</div>
<div style="font-size:9pt;">
@@ -110,10 +110,13 @@
DeleteMethod="Delete" InsertMethod="Insert" UpdateMethod="Update">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
<asp:ControlParameter ControlID="mod_filtroTipo" DefaultValue="0" Name="idxTipo"
<asp:SessionParameter DefaultValue="0" Name="idxTipo" SessionField="idxTipo_filt" Type="Int32"/>
<asp:SessionParameter DefaultValue="0" Name="idxMacchina" SessionField="idxMacchina_filt" Type="Int32"/>
<%--<asp:ControlParameter ControlID="mod_filtroTipo" DefaultValue="0" Name="idxTipo"
PropertyName="valoreInt" Type="Int32" />
<asp:ControlParameter ControlID="mod_filtroMacchina" DefaultValue="0" Name="idxMacchina"
PropertyName="valoreInt" Type="Int32" />
PropertyName="valoreInt" Type="Int32" />--%>
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxIntPro" Type="Int32" />
@@ -24,8 +24,8 @@ public partial class mod_elencoMtzProg : ApplicationUserControl
{
base.traduciObj();
btnShowNew.Text = traduci("btnShowNew");
lblFiltMacchina.Text = traduci("lblFiltMacchina");
lblFiltTipo.Text = traduci("lblFiltTipo");
//lblFiltMacchina.Text = traduci("lblFiltMacchina");
//lblFiltTipo.Text = traduci("lblFiltTipo");
}
/// <summary>
@@ -54,6 +54,7 @@ public partial class mod_elencoMtzProg : ApplicationUserControl
/// </summary>
public void doUpdate()
{
checkFixOds();
grView.DataBind();
}
/// <summary>
@@ -205,14 +206,14 @@ public partial class mod_elencoMtzProg : ApplicationUserControl
{
base.OnInit(e);
_idxGridView = "idxIntPro";
if (!Page.IsPostBack)
{
mod_filtroImpianto.ods = odsImpianti;
mod_filtroMacchina.ods = odsMacchine;
mod_filtroTipo.ods = odsTipo;
}
mod_filtroTipo.eh_selValore += new EventHandler(mod_filtroTipo_eh_selValore);
mod_filtroMacchina.eh_selValore += new EventHandler(mod_filtroMacchina_eh_selValore);
//if (!Page.IsPostBack)
//{
// mod_filtroImpianto.ods = odsImpianti;
// mod_filtroMacchina.ods = odsMacchine;
// mod_filtroTipo.ods = odsTipo;
//}
//mod_filtroTipo.eh_selValore += new EventHandler(mod_filtroTipo_eh_selValore);
//mod_filtroMacchina.eh_selValore += new EventHandler(mod_filtroMacchina_eh_selValore);
}
void mod_filtroMacchina_eh_selValore(object sender, EventArgs e)
@@ -231,39 +232,14 @@ public partial class mod_elencoMtzProg : ApplicationUserControl
private void checkFixOds()
{
ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )";
if (mod_filtroTipo.valoreInt != 0)
if (memLayer.ML.isInSessionObject("idxTipo_filt"))
{
ods.FilterExpression += " AND (idxTipo = {1})";
}
if (mod_filtroMacchina.valoreInt != 0)
if (memLayer.ML.isInSessionObject("idxMacchina_filt"))
{
ods.FilterExpression += " AND (idxMacchina = {2})";
}
ods.DataBind();
}
/// <summary>
/// chiamato post modifica valore check/selezione nel selettore filtro impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void eh_selectedImpianto(object sender, EventArgs e)
{
if (mod_filtroImpianto.valoreInt != 0)
{
if (!mod_filtroMacchina.Visible)
{
mod_filtroMacchina.Visible = true;
}
else
{
mod_filtroMacchina.reset();
}
mod_filtroMacchina.ods = odsMacchine;
}
else
{
mod_filtroMacchina.reset();
mod_filtroMacchina.Visible = false;
}
}
}
@@ -0,0 +1,40 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_filtraMtzProg.ascx.cs" Inherits="WebUserControls_mod_filtraMtzProg" %>
<%@ Register src="mod_filtro.ascx" tagname="mod_filtro" tagprefix="uc1" %>
<div style="width: 100%; background: #cdcdcd;" class="txtMini">
<table cellpadding="5px">
<tr valign="top">
<td style="width: 250px;">
<div>
<asp:Label runat="server" ID="lblFiltTipo" />
</div>
<div>
<uc1:mod_filtro ID="mod_filtroTipo" runat="server" css="txtMini" />
<asp:ObjectDataSource ID="odsTipo" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selTipoGuastoTableAdapter">
</asp:ObjectDataSource>
</div>
</td>
<td>
<div>
<asp:Label runat="server" ID="lblFiltMacchina" />
</div>
<div>
<uc1:mod_filtro ID="mod_filtroImpianto" runat="server" css="txtMini" Oneh_selValore="eh_selectedImpianto" />
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
</div>
<div>
<uc1:mod_filtro ID="mod_filtroMacchina" runat="server" css="txtMini" Visible="false" />
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="mod_filtroImpianto" DefaultValue="0" Name="conditio"
PropertyName="valoreInt" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</td>
</tr>
</table>
</div>
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class WebUserControls_mod_filtraMtzProg : ApplicationUserControl
{
/// <summary>
/// evento che segnala la disponibilità di un nuovo stato di filtraggio salvato in sessione...
/// </summary>
public event EventHandler eh_newFiltroSel;
// variabile per gridview - potrebbe non servire più FARE!!!
protected string _idxGridView;
/// <summary>
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "idxIntPro";
if (!Page.IsPostBack)
{
mod_filtroImpianto.ods = odsImpianti;
mod_filtroMacchina.ods = odsMacchine;
mod_filtroTipo.ods = odsTipo;
}
mod_filtroTipo.eh_selValore += new EventHandler(mod_filtroTipo_eh_selValore);
mod_filtroMacchina.eh_selValore += new EventHandler(mod_filtroMacchina_eh_selValore);
mod_filtroImpianto.eh_selValore += new EventHandler(mod_filtroImpianto_eh_selValore);
}
void mod_filtroImpianto_eh_selValore(object sender, EventArgs e)
{
// salvo in sessione il valore selezionato...
if (mod_filtroImpianto.valoreInt == 0)
{
memLayer.ML.emptySessionVal("idxMacchina_filt");
}
// chiamo procedura che innalza l'evento
raiseEvent();
}
/// <summary>
/// chiamato post modifica valore check/selezione nel selettore filtro impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void eh_selectedImpianto(object sender, EventArgs e)
{
if (mod_filtroImpianto.valoreInt != 0)
{
if (!mod_filtroMacchina.Visible)
{
mod_filtroMacchina.Visible = true;
}
else
{
mod_filtroMacchina.reset();
}
mod_filtroMacchina.ods = odsMacchine;
}
else
{
mod_filtroMacchina.reset();
mod_filtroMacchina.Visible = false;
}
}
void mod_filtroMacchina_eh_selValore(object sender, EventArgs e)
{
// salvo in sessione il valore selezionato...
if (mod_filtroMacchina.valoreInt != 0)
{
memLayer.ML.setSessionVal("idxMacchina_filt", mod_filtroMacchina.valoreInt);
}
else
{
memLayer.ML.emptySessionVal("idxMacchina_filt");
}
// chiamo procedura che innalza l'evento
raiseEvent();
}
void mod_filtroTipo_eh_selValore(object sender, EventArgs e)
{
// salvo in sessione il valore selezionato...
if (mod_filtroTipo.valoreInt != 0)
{
memLayer.ML.setSessionVal("idxTipo_filt", mod_filtroTipo.valoreInt);
}
else
{
memLayer.ML.emptySessionVal("idxTipo_filt");
}
// chiamo procedura che innalza l'evento
raiseEvent();
}
private void raiseEvent()
{
if (eh_newFiltroSel != null)
{
eh_newFiltroSel(this, new EventArgs());
}
}
}
+2
View File
@@ -6,7 +6,9 @@
<%@ Register Src="~/WebUserControls/mod_dettMtzProg.ascx" TagName="mod_dettMtzProg" TagPrefix="uc2" %>
<%@ Register Src="~/WebUserControls/mod_fixCal.ascx" TagName="mod_fixCal" TagPrefix="uc3" %>
<%@ Register Src="~/WebUserControls/mod_mtzPrevPending.ascx" tagname="mod_mtzPrevPending" tagprefix="uc4" %>
<%@ Register src="WebUserControls/mod_filtraMtzProg.ascx" tagname="mod_filtraMtzProg" tagprefix="uc5" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<uc5:mod_filtraMtzProg ID="mod_filtraMtzProg1" runat="server" />
<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
<cc1:TabPanel runat="server" HeaderText="Programmazione Intervento" ID="TabProgrammaMtz">
<ContentTemplate>
+12
View File
@@ -11,9 +11,21 @@ public partial class mtzProg : System.Web.UI.Page
{
mod_elencoMtzProg1.eh_newReq += new EventHandler(mod_elencoMtzProg1_eh_newReq);
mod_dettMtzProg1.eh_newInserted += new EventHandler(mod_dettMtzProg1_eh_newInserted);
mod_filtraMtzProg1.eh_newFiltroSel += new EventHandler(mod_filtraMtzProg1_eh_newFiltroSel);
traduciObj();
}
/// <summary>
/// è stato chiamato evento "nuovo filtro" e quindi aggiorno
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_filtraMtzProg1_eh_newFiltroSel(object sender, EventArgs e)
{
// richiamo update delle varie parti del mio modulo
mod_elencoMtzProg1.doUpdate();
}
private void traduciObj()
{
((AjaxControlToolkit.TabPanel)TabContainer1.FindControl("TabProgrammaMtz")).HeaderText = traduci("TabProgrammaMtz");