Boton para la modificacion de columnas

This commit is contained in:
HECTOR RODRIGUEZ
2021-04-14 13:15:34 -07:00
parent fbd9e32492
commit 8de16c928c
2 changed files with 107 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Filtros {
padding: 10px;
@@ -45,7 +46,12 @@
transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, -webkit-box-shadow 0.15s ease;
}
</style>
.chkChoice input
{
margin-right: 5px;
}
</style>cc
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Detalle de los Acercamientos Procesos
@@ -55,7 +61,15 @@
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li></li>
<li>
<asp:LinkButton ID="LnkEditargv" runat="server" OnClick="LnkEditargv_Click"><i class="fa fa-edit" ></i><span style="padding-left:5px;">Personalizar Columnas</span></asp:LinkButton>
</li>
<%-- <li>
<asp:LinkButton ID="LnkImprimir" OnClick="LnkImprimir_Click" runat="server"><i class="fa fa-file-pdf-o"></i><span style="padding-left:5px;">PDF</span></asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimirExcel" OnClick="LnkImprimirExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i><span style="padding-left:5px;">Excel</span></asp:LinkButton>
</li>--%>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
@@ -248,7 +262,7 @@
</div>
</div>
<asp:GridView ID="GVRepAcercamientosDetalle" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVRepAcercamientosDetalle" AutoGenerateColumns="False" DataKeyNames="CveAcercamiento">
<asp:GridView ID="GVRepAcercamientosDetalle" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVRepAcercamientosDetalle" AutoGenerateColumns="False" DataKeyNames="CveAcercamiento" OnRowDataBound="GVRepAcercamientosDetalle_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Prospecto">
<ItemTemplate>
@@ -296,10 +310,53 @@
<asp:Label ID="lblcelular" runat="server" Text='<%# Eval("Celular")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaApertura" ItemStyle-Width="5%" HeaderText="Fecha Apertura" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaCierre" ItemStyle-Width="5%" HeaderText="Fecha de Cierre" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="PS" ItemStyle-Width="5%" HeaderText="Producto Servicio" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Prioridad">
<ItemTemplate>
<asp:Label ID="lblPrioridad" runat="server" Text='<%# Eval("Prioridad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Importe" ItemStyle-Width="5%" HeaderText="Importe" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:c}" />
<asp:BoundField DataField="Comision" ItemStyle-Width="5%" HeaderText="Comisión" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:c}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalEditar" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpEditargv" class="modal-dialog modal-sm rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Editar Columnas</h4>
</div>
<div class="modal-body">
<asp:CheckBoxList ID="CBLEditargv" RepeatDirection="Horizontal" RepeatColumns="3" runat="server" CssClass="chkChoice">
<asp:ListItem Text=" Fecha Apertura" Value="1"></asp:ListItem>
<asp:ListItem Text=" Fecha de Cierre" Value="2"></asp:ListItem>
<asp:ListItem Text=" Producto Servicio" Value="3"></asp:ListItem>
<asp:ListItem Text=" Prioridad" Value="4"></asp:ListItem>
<asp:ListItem Text=" Importe" Value="5"></asp:ListItem>
<asp:ListItem Text=" Comisión" Value="6"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="modal-footer">
<asp:Button id="GuardarEditargv" OnClick="GuardarEditargv_Click" type="button" class="btn btn-primary" runat="server" Text="Guardar"></asp:Button>
<button id="CancelarTiposAlmacen" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -196,6 +196,12 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
GVRepAcercamientosDetalle.DataSource = ObjRepA.DtResultados;
ObjRepA.Dispose();
GVRepAcercamientosDetalle.DataBind();
this.GVRepAcercamientosDetalle.Columns[9].Visible = false;
this.GVRepAcercamientosDetalle.Columns[10].Visible = false;
this.GVRepAcercamientosDetalle.Columns[11].Visible = false;
this.GVRepAcercamientosDetalle.Columns[12].Visible = false;
this.GVRepAcercamientosDetalle.Columns[13].Visible = false;
this.GVRepAcercamientosDetalle.Columns[14].Visible = false;
upDatosRepA.Update();
}
@@ -225,4 +231,45 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
RcveProbabilidadAcercamiento = DdlProbabilidad.SelectedValue.ToEntero();
cargarDatos();
}
protected void GVRepAcercamientosDetalle_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.FCLabel("lblPrioridad").Text.ToEntero() == 1)
{
e.Row.FCLabel("lblPrioridad").Text = "Baja";
}
else if (e.Row.FCLabel("lblPrioridad").Text.ToEntero() == 2)
{
e.Row.FCLabel("lblPrioridad").Text = "Media";
}
else if (e.Row.FCLabel("lblPrioridad").Text.ToEntero() == 3)
{
e.Row.FCLabel("lblPrioridad").Text = "Alta";
}
}
}
protected void LnkEditargv_Click(object sender, EventArgs e)
{
RegistraScript("$('#ModalEditar').modal('show')");
}
protected void GuardarEditargv_Click(object sender, EventArgs e)
{
foreach (ListItem item in CBLEditargv.Items)
{
if (item.Value.ToEntero() == 1) { if (item.Selected) { this.GVRepAcercamientosDetalle.Columns[9].Visible = true; } else { this.GVRepAcercamientosDetalle.Columns[9].Visible = false; } }
if (item.Value.ToEntero() == 2) { if (item.Selected) { this.GVRepAcercamientosDetalle.Columns[10].Visible = true; } else { this.GVRepAcercamientosDetalle.Columns[10].Visible = false; } }
if (item.Value.ToEntero() == 3) { if (item.Selected) { this.GVRepAcercamientosDetalle.Columns[11].Visible = true; } else { this.GVRepAcercamientosDetalle.Columns[11].Visible = false; } }
if (item.Value.ToEntero() == 4) { if (item.Selected) { this.GVRepAcercamientosDetalle.Columns[12].Visible = true; } else { this.GVRepAcercamientosDetalle.Columns[12].Visible = false; } }
if (item.Value.ToEntero() == 5) { if (item.Selected) { this.GVRepAcercamientosDetalle.Columns[13].Visible = true; } else { this.GVRepAcercamientosDetalle.Columns[13].Visible = false; } }
if (item.Value.ToEntero() == 6) { if (item.Selected) { this.GVRepAcercamientosDetalle.Columns[14].Visible = true; } else { this.GVRepAcercamientosDetalle.Columns[14].Visible = false; } }
}
upDatosRepA.Update();
RegistraScript("$('#ModalEditar').modal('hide')");
}
}