Da verificare in certi casi ma aggiunti filtraggi interventi mtz programmata
git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@48 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
@@ -1,8 +1,42 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_elencoMtzProg.ascx.cs"
|
||||
Inherits="mod_elencoMtzProg" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<div style="width: 100%; background: #cdcdcd;">
|
||||
area filtraggi vari
|
||||
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
|
||||
<div style="width: 100%; background: #cdcdcd;" class="txtMini">
|
||||
<table cellpadding="5px">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label runat="server" ID="lblFiltTipo" />
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<asp:Label runat="server" ID="lblFiltMacchina" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:Button ID="btnShowNew" runat="server" OnClick="btnShowNew_Click" />
|
||||
</div>
|
||||
<div>
|
||||
@@ -70,6 +104,10 @@
|
||||
DeleteMethod="Delete" InsertMethod="Insert" UpdateMethod="Update">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
|
||||
<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" />
|
||||
</FilterParameters>
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxIntPro" Type="Int32" />
|
||||
|
||||
@@ -25,16 +25,10 @@ public partial class mod_elencoMtzProg : ApplicationUserControl
|
||||
{
|
||||
base.traduciObj();
|
||||
btnShowNew.Text = traduci("btnShowNew");
|
||||
lblFiltMacchina.Text = traduci("lblFiltMacchina");
|
||||
lblFiltTipo.Text = traduci("lblFiltTipo");
|
||||
}
|
||||
/// <summary>
|
||||
/// wrap traduzione
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(object lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cambio visibilità pannello new data
|
||||
/// </summary>
|
||||
@@ -212,5 +206,70 @@ 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);
|
||||
}
|
||||
|
||||
void mod_filtroMacchina_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo procedura ricostruzione ods con filtri...
|
||||
checkFixOds();
|
||||
}
|
||||
void mod_filtroTipo_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo procedura ricostruzione ods con filtri...
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistemo filtraggio con valori selezionati
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )";
|
||||
//ods.FilterParameters.Clear();
|
||||
//SessionParameter ricerca = new SessionParameter("ricerca","valoreCercato");
|
||||
//ods.FilterParameters.Add(ricerca);
|
||||
if (mod_filtroTipo.valoreInt != 0)
|
||||
{
|
||||
ods.FilterExpression += " AND (idxTipo = {1})";
|
||||
}
|
||||
if (mod_filtroMacchina.valoreInt != 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
lblFiltMacchina.Visible = true;
|
||||
mod_filtroMacchina.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mod_filtroMacchina.reset();
|
||||
}
|
||||
mod_filtroMacchina.ods = odsMacchine;
|
||||
}
|
||||
else
|
||||
{
|
||||
mod_filtroMacchina.reset();
|
||||
lblFiltMacchina.Visible = false;
|
||||
mod_filtroMacchina.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_filtro.ascx.cs" Inherits="mod_filtro" %>
|
||||
<asp:CheckBox ID="chkFilt" runat="server" Text="---" Checked="false" AutoPostBack="True"
|
||||
<asp:CheckBox ID="chkFilt" runat="server" Text="---" Checked="false" AutoPostBack="True" CssClass='<%# css %>'
|
||||
OnCheckedChanged="chkFilt_CheckedChanged" />
|
||||
<asp:DropDownList ID="dlFilt" runat="server" Visible="False" DataTextField="label"
|
||||
<asp:DropDownList ID="dlFilt" runat="server" Visible="False" DataTextField="label" CssClass='<%# css %>'
|
||||
DataValueField="value" AutoPostBack="True" OnSelectedIndexChanged="dlFilt_SelectedIndexChanged">
|
||||
</asp:DropDownList>
|
||||
<asp:Label ID="where" runat="server" Visible="false" Text="" />
|
||||
@@ -12,6 +12,7 @@ using SteamWare;
|
||||
|
||||
public partial class mod_filtro : ApplicationUserControl
|
||||
{
|
||||
protected string _css;
|
||||
protected ObjectDataSource _ods;
|
||||
protected string _valore
|
||||
{
|
||||
@@ -215,6 +216,7 @@ public partial class mod_filtro : ApplicationUserControl
|
||||
|
||||
public event EventHandler eh_selValore;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// determina se sia possibile (de)selezionare il check di filtraggio, altrimenti sempre attivo
|
||||
/// </summary>
|
||||
@@ -281,4 +283,27 @@ public partial class mod_filtro : ApplicationUserControl
|
||||
bindControlli();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// css applicato agli elementi del controllo
|
||||
/// </summary>
|
||||
public string css
|
||||
{
|
||||
get
|
||||
{
|
||||
return _css;
|
||||
}
|
||||
set
|
||||
{
|
||||
_css = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta il controllo (un-checked)
|
||||
/// </summary>
|
||||
public void reset()
|
||||
{
|
||||
chkFilt.Checked = false;
|
||||
dlFilt.Visible = false;
|
||||
memLayer.ML.emptySessionVal(string.Format("valFiltro_{0}", this.ID));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user