Ok editing tag assegnati
This commit is contained in:
@@ -4,12 +4,19 @@
|
||||
<asp:HiddenField runat="server" ID="hfInizio" />
|
||||
<asp:HiddenField runat="server" ID="hfFine" />
|
||||
|
||||
<asp:GridView runat="server" ID ="grView" AutoGenerateColumns="False" DataKeyNames="IdxTagDD" DataSourceID="ods" CssClass="table table-sm table-striped" >
|
||||
<EmptyDataTemplate>-</EmptyDataTemplate>
|
||||
<asp:GridView runat="server" ID="grView" AutoGenerateColumns="False" DataKeyNames="IdxTagDD" DataSourceID="ods" CssClass="table table-sm table-striped" OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<EmptyDataTemplate>No Record</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:BoundField DataField="DtRif" HeaderText="DtRif" SortExpression="DtRif" DataFormatString="{0:yyyy.MM.dd}" />
|
||||
<asp:BoundField DataField="CodTag" HeaderText="CodTag" SortExpression="CodTag" />
|
||||
<asp:CheckBoxField DataField="IsActive" HeaderText="IsActive" SortExpression="IsActive" />
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtToggleOn" runat="server" Visible='<%# toBool(Eval("IsActive")) %>' CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-primary"><i class="fa fa-thumbs-up" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton ID="lbtToggleOff" runat="server" Visible='<%# !toBool(Eval("IsActive")) %>' CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-secondary"><i class="fa fa-thumbs-down" aria-hidden="true"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--<asp:BoundField DataField="idxDipendente" HeaderText="idxDipendente" SortExpression="idxDipendente" />--%>
|
||||
<asp:BoundField DataField="DtRif" HeaderText="Data" SortExpression="DtRif" DataFormatString="{0:yyyy.MM.dd - dddd}" />
|
||||
<asp:BoundField DataField="CodTag" HeaderText="Tag" SortExpression="CodTag" />
|
||||
<%--<asp:CheckBoxField DataField="IsActive" HeaderText="IsActive" SortExpression="IsActive" />--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getByUserDate" TypeName="GPW_data.DS_ApplicazioneTableAdapters.ListTagDDTableAdapter">
|
||||
@@ -18,4 +25,4 @@
|
||||
<asp:ControlParameter ControlID="hfInizio" DefaultValue="" Name="dataFrom" PropertyName="Value" Type="DateTime" />
|
||||
<asp:ControlParameter ControlID="hfFine" Name="dataTo" PropertyName="Value" Type="DateTime" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</asp:ObjectDataSource>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using GPW_data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -10,8 +11,6 @@ namespace GPW_Admin.WebUserControls
|
||||
public partial class cmp_tagUserPeriodo : BaseUserControl
|
||||
{
|
||||
|
||||
public event EventHandler eh_reportUpdate;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -45,17 +44,24 @@ namespace GPW_Admin.WebUserControls
|
||||
/// </summary>
|
||||
public void reportUpdate()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
if (eh_reportUpdate != null)
|
||||
{
|
||||
eh_reportUpdate(this, new EventArgs());
|
||||
}
|
||||
doUpdate();
|
||||
raiseEvent();
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// prendo riga selezionata
|
||||
int idxTagDD = Convert.ToInt32(grView.SelectedDataKey["IdxTagDD"].ToString());
|
||||
// eseguo toggle
|
||||
DataProxy.DP.taListTDD.toggleActive(idxTagDD);
|
||||
// aggiorno
|
||||
reportUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,12 @@
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:LinkButton ID="lbtReset" runat="server" CausesValidation="False" CssClass="btn btn-sm btn-info" OnClick="lbtReset_Click"><i class="fa fa-refresh" aria-hidden="true"></i></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtSel" runat="server" CausesValidation="False" CommandName="Select" Text="Select" CommandArgument='<%# Eval("idxDipendente") %>'></asp:LinkButton>
|
||||
<asp:LinkButton ID="lbtSel" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-info"><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="anno" HeaderText="anno" SortExpression="anno" ControlStyle-Width="7em" ReadOnly="True" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace GPW_Admin.WebUserControls
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
cmp_tagUserPeriodo.idxDip = -1;
|
||||
cmp_tagUserPeriodo.doUpdate();
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
if (eh_resetSelezione != null)
|
||||
@@ -40,16 +42,6 @@ namespace GPW_Admin.WebUserControls
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
@@ -94,50 +86,6 @@ namespace GPW_Admin.WebUserControls
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// caricamento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
filtroDip.ods = odsDip;
|
||||
memLayer.ML.emptySessionVal("idxDip_sel");
|
||||
filtroDip.reselFirst();
|
||||
}
|
||||
filtroDip.eh_selValore += new EventHandler(filtroDip_eh_selValore);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// imposto ODS
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxDip_sel", filtroDip.valoreInt);
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// seleziono
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void filtroDip_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
// imposto ods
|
||||
checkFixOds();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
int anno = Convert.ToInt32(grView.SelectedDataKey["anno"].ToString());
|
||||
@@ -169,5 +117,64 @@ namespace GPW_Admin.WebUserControls
|
||||
DataProxy.DP.taTagMese.checkCreateByDipDate("BP", filtroDip.valoreInt, inizio, fine, 270);
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// caricamento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
filtroDip.ods = odsDip;
|
||||
memLayer.ML.emptySessionVal("idxDip_sel");
|
||||
filtroDip.reselFirst();
|
||||
}
|
||||
filtroDip.eh_selValore += new EventHandler(filtroDip_eh_selValore);
|
||||
cmp_tagUserPeriodo.eh_doRefresh += Cmp_tagUserPeriodo_eh_doRefresh;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// imposto ODS
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxDip_sel", filtroDip.valoreInt);
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
private void Cmp_tagUserPeriodo_eh_doRefresh(object sender, EventArgs e)
|
||||
{
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// seleziono
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void filtroDip_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
// imposto ods
|
||||
checkFixOds();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user