ok filtro data x MPP (visualizzazione, manca excel) --> da verificare elencoInterventi...
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<%@ Register Src="~/WebUserControls/mod_periodoAnalisi.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc1" %>
|
||||
|
||||
<div style="width: 100%; background-color: #cdcdcd; clear: both; font-size: 0.8em; height: 2em;" class="bg_plus">
|
||||
<div style="background-color: #cdcdcd; clear: both; font-size: 0.8em; height: 2em;" class="bg_plus">
|
||||
<div style="float: left;">
|
||||
<asp:CheckBox runat="server" ID="chkMostraIntChiusi" AutoPostBack="true" OnCheckedChanged="chkMostraIntChiusi_CheckedChanged"
|
||||
Checked="false" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<%@ Register Src="~/WebUserControls/mod_periodoAnalisi.ascx" TagPrefix="uc1" TagName="mod_periodoAnalisi" %>
|
||||
|
||||
|
||||
<div class="row txtMini" style="width: 100%; background: #cdcdcd; font-size: 0.8em;">
|
||||
<div class="row txtMini" style="background: #cdcdcd; font-size: 0.8em;">
|
||||
<div class="col-sm-2 text-left">
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblFiltTipo" />
|
||||
|
||||
@@ -31,13 +31,20 @@ public partial class WebUserControls_mod_filtraMtzProg : SteamWare.UserControl
|
||||
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);
|
||||
mod_periodoAnalisi.eh_doUpdate += new EventHandler(Mod_periodoAnalisi_eh_doUpdate);
|
||||
}
|
||||
|
||||
private void Mod_periodoAnalisi_eh_doUpdate(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verifica se sia possibile preimpostare i valori filtrati...
|
||||
/// </summary>
|
||||
private void checkSelVal()
|
||||
{
|
||||
if(memLayer.ML.isInSessionObject("idxMacchina_filt"))
|
||||
if (memLayer.ML.isInSessionObject("idxMacchina_filt"))
|
||||
{
|
||||
mod_filtroMacchina.Visible = true;
|
||||
}
|
||||
@@ -155,4 +162,18 @@ public partial class WebUserControls_mod_filtraMtzProg : SteamWare.UserControl
|
||||
mod_periodoAnalisi.Visible = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Imposta periodo del selettore
|
||||
/// </summary>
|
||||
public datario.periodo periodo
|
||||
{
|
||||
get
|
||||
{
|
||||
return mod_periodoAnalisi.periodo;
|
||||
}
|
||||
set
|
||||
{
|
||||
mod_periodoAnalisi.periodo = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<asp:HyperLink ID="hlExportExcel" runat="server" Target="_blank" />
|
||||
</div>
|
||||
<div style="font-size: 8pt;">
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" PageSize="10" CssClass="table table-striped" DataKeyNames="idxPending" DataSourceID="ods" OnDataBound="grView_DataBound" EnableModelValidation="True" OnPageIndexChanged="grView_PageIndexChanged">
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="table table-striped" DataKeyNames="idxPending" DataSourceID="ods" OnDataBound="grView_DataBound" OnPageIndexChanged="grView_PageIndexChanged">
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="info" />
|
||||
@@ -37,15 +37,16 @@
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="GIM_data.DS_utilityTableAdapters.v_mtzProgPendingExpTableAdapter"
|
||||
OldValuesParameterFormatString="Original_{0}" FilterExpression=" (codImpianto LIKE '%{0}%') OR (nomeImpianto LIKE '%{0}%') OR (codMacchina LIKE '%{0}%') OR (nomeMacchina LIKE '%{0}%') OR (descrizione LIKE '%{0}%') OR (descrPriorita LIKE '%{0}%') OR (descrTipo LIKE '%{0}%') ">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
|
||||
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getBySearch" TypeName="GIM_data.DS_utilityTableAdapters.v_mtzProgPendingExpTableAdapter"
|
||||
OldValuesParameterFormatString="original_{0}">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="%" Name="ricerca" SessionField="valoreCercato" Type="String" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxTipo" SessionField="idxTipo_filt" Type="Int32" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxImpianto" SessionField="idxImpianto_filt" Type="Int32" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxMacchina" SessionField="idxMacchina_filt" Type="Int32" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="inizio" SessionField="_inizio" Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="fine" SessionField="_fine" Type="DateTime" />
|
||||
</FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="" Name="inizio" SessionField="_inizio" Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="" Name="fine" SessionField="_fine" Type="DateTime" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -71,27 +71,6 @@ public partial class mod_mtzPrevPending : ApplicationUserControl
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )";
|
||||
if (memLayer.ML.isInSessionObject("idxTipo_filt"))
|
||||
{
|
||||
ods.FilterExpression += " AND (idxTipo = {1})";
|
||||
}
|
||||
if (memLayer.ML.isInSessionObject("idxImpianto_filt"))
|
||||
{
|
||||
ods.FilterExpression += " AND (idxImpianto = {2})";
|
||||
}
|
||||
if (memLayer.ML.isInSessionObject("idxMacchina_filt"))
|
||||
{
|
||||
ods.FilterExpression += " AND (idxMacchina = {3})";
|
||||
}
|
||||
if (memLayer.ML.isInSessionObject("_inizio"))
|
||||
{
|
||||
ods.FilterExpression += " AND (data >= {4})";
|
||||
}
|
||||
if (memLayer.ML.isInSessionObject("_fine"))
|
||||
{
|
||||
ods.FilterExpression += " AND (data <= {5})";
|
||||
}
|
||||
ods.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -22,14 +22,16 @@
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="!!!" ControlToValidate="txtFine" />
|
||||
</div>
|
||||
<div style="float: left;">
|
||||
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
|
||||
<asp:DropDownList ID="ddlPeriodo" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPeriodo_SelectedIndexChanged"
|
||||
DataSourceID="odsPeriodi" DataTextField="label" DataValueField="value">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsPeriodi" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="getByConditio" TypeName="GIM_data.DS_utilityTableAdapters.v_selPeriodiTradTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="IT" Name="conditio" SessionField="lingua" Type="String" />
|
||||
<asp:ControlParameter ControlID="hfTPer" DefaultValue="0" Type="Int32" Name="tPeriodo" PropertyName="Value" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfTPer" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,8 +17,7 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl
|
||||
protected intervalloDate _intervallo;
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
{ base.OnInit(e);
|
||||
setIntervallo();
|
||||
}
|
||||
|
||||
@@ -27,12 +26,12 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
protected void ddlPeriodo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
intervalloDate _intervallo = new intervalloDate();
|
||||
// verifico cosa sia cambiato ed imposto date...
|
||||
datario _datario = new datario();
|
||||
switch (DropDownList1.SelectedValue)
|
||||
switch (ddlPeriodo.SelectedValue)
|
||||
{
|
||||
case "1_today":
|
||||
_intervallo = _datario.giornata(DateTime.Now);
|
||||
@@ -94,8 +93,17 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl
|
||||
catch
|
||||
{
|
||||
_intervallo = new intervalloDate();
|
||||
_intervallo.fine = DateTime.Now.Subtract(DateTime.Now.TimeOfDay).AddDays(1);
|
||||
_intervallo.inizio = _intervallo.fine.AddMonths(-1);
|
||||
// in base al tipo intervallo (futuro/all) decido cosa mostrare...
|
||||
if(periodo== datario.periodo.future)
|
||||
{
|
||||
_intervallo.inizio = DateTime.Now.Subtract(DateTime.Now.TimeOfDay);
|
||||
_intervallo.fine = _intervallo.inizio.AddDays(7);
|
||||
}
|
||||
else
|
||||
{
|
||||
_intervallo.fine = DateTime.Now.Subtract(DateTime.Now.TimeOfDay).AddDays(1);
|
||||
_intervallo.inizio = _intervallo.fine.AddMonths(-1);
|
||||
}
|
||||
Session["_intervallo"] = _intervallo;
|
||||
Session["_inizio"] = _intervallo.inizio;
|
||||
Session["_fine"] = _intervallo.fine;
|
||||
@@ -126,7 +134,7 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl
|
||||
protected void txtInizio_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
// imposto il selettore a discesa...
|
||||
DropDownList1.SelectedIndex = 0;
|
||||
ddlPeriodo.SelectedIndex = 0;
|
||||
// se campo vuoto imposto oggi...
|
||||
if (txtInizio.Text == "")
|
||||
{
|
||||
@@ -153,7 +161,7 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl
|
||||
protected void txtFine_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
// imposto il selettore a discesa...
|
||||
DropDownList1.SelectedIndex = 0;
|
||||
ddlPeriodo.SelectedIndex = 0;
|
||||
// se campo vuoto imposto oggi...
|
||||
if (txtFine.Text == "")
|
||||
{
|
||||
@@ -202,9 +210,43 @@ public partial class mod_periodoAnalisi : System.Web.UI.UserControl
|
||||
|
||||
public void setPeriodoFree()
|
||||
{
|
||||
DropDownList1.SelectedIndex = 0;
|
||||
ddlPeriodo.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
protected datario.periodo _periodo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia periodo mostrato...
|
||||
/// </summary>
|
||||
public datario.periodo periodo
|
||||
{
|
||||
get
|
||||
{
|
||||
return _periodo;
|
||||
}
|
||||
set
|
||||
{
|
||||
_periodo = value;
|
||||
switch (_periodo)
|
||||
{
|
||||
case datario.periodo.past:
|
||||
hfTPer.Value = "-1";
|
||||
break;
|
||||
case datario.periodo.future:
|
||||
hfTPer.Value = "1";
|
||||
break;
|
||||
case datario.periodo.all:
|
||||
case datario.periodo.nd:
|
||||
default:
|
||||
hfTPer.Value = "0";
|
||||
break;
|
||||
}
|
||||
ddlPeriodo.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_doUpdate;
|
||||
|
||||
+11
-2
@@ -75,13 +75,13 @@ public partial class mod_periodoAnalisi {
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList1 control.
|
||||
/// ddlPeriodo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList DropDownList1;
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlPeriodo;
|
||||
|
||||
/// <summary>
|
||||
/// odsPeriodi control.
|
||||
@@ -91,4 +91,13 @@ public partial class mod_periodoAnalisi {
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsPeriodi;
|
||||
|
||||
/// <summary>
|
||||
/// hfTPer control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfTPer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user