--definicion de tablas para multiples listas de precios en actualizarprecios.aspx
This commit is contained in:
@@ -21,11 +21,11 @@
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel ID="UpExportarExcel" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkExportarExcel" Text="<i class='fa fa-file-excel-o'></i> ExportarExcel" runat="server" OnClick="LnkExportarExcel_Click"></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkExportarExcel" Text="<i class='fa fa-file-excel-o'></i> ExportarExcel" runat="server" OnClick="LnkExportarExcel_Click"></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExportarExcel"/>
|
||||
<asp:PostBackTrigger ControlID="LnkExportarExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
@@ -42,6 +42,13 @@
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row v-center">
|
||||
<label class="col-md-1 v-center truncate" runat="server" visible="false">Modalidad:</label>
|
||||
<div class="col-md-1 v-center" runat="server" visible="false">
|
||||
<asp:DropDownList ID="DdlModalidad" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me">
|
||||
<asp:ListItem Selected="True" Value="1" Text="Por lista de precio"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Multiples listas de precio"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">Precio de Lista:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
|
||||
@@ -56,13 +63,12 @@
|
||||
</div>
|
||||
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate">Marca:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:ListBox ID="DdlMarca" visible="false" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;">
|
||||
</asp:ListBox>
|
||||
<asp:ListBox ID="DdlMarca" Visible="false" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;"></asp:ListBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" >
|
||||
<div class="portlet-body">
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<label class="col-md-1 v-center" id="LblProveedorCompra" runat="server" visible="false">Proveedor:</label>
|
||||
@@ -78,7 +84,7 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label id="lblModelo" runat="server" class="col-md-1 v-center truncate" visible="false">Modelo:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<div class="col-md-1 v-center">
|
||||
<asp:DropDownList ID="DdlModelo" Visible="false" runat="server" Width="100%" CssClass="select2me" DataTextField="Modelo" DataValueField="CveModelo">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
@@ -89,7 +95,7 @@
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UPPrecioLista">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="row" id="DivActualizarPrecio" runat="server">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light smmallpadding traspasorow bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
@@ -164,7 +170,7 @@
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GVPrecios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GVPrecios" runat="server" GridLines="None" DataKeyNames="CvePS, CvePrecioLista,PrecioLista,PS,Codigo,Codigo2,Porcentaje,CodigoPS"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros" >
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
@@ -173,7 +179,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Codigo" ItemStyle-Width="5%" HeaderText="Código" />
|
||||
<asp:BoundField DataField="Codigo2" ItemStyle-Width="5%" HeaderText="Código CPK" Visible="false" />
|
||||
<asp:BoundField DataField="PS" HeaderText="Producto/Servicio" />
|
||||
<asp:BoundField DataField="PS" HeaderText="Producto/Servicio" />
|
||||
<asp:BoundField DataField="Clasificacion" ItemStyle-Width="15%" HeaderText="Clasificación" />
|
||||
<asp:BoundField DataField="PrecioLista" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:TemplateField HeaderText="">
|
||||
@@ -192,13 +198,13 @@
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecioMinimo" runat="server" Text='<%# Eval("PrecioMinimo", "{0:0.######}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
<%-- <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." />
|
||||
<%-- <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." />
|
||||
<asp:RegularExpressionValidator ID="REVTxtPrecioMinimo" runat="server" ControlToValidate="TxtPrecioMinimo" Display="None" EnableClientScript="True" ErrorMessage="El campo <b>''PrecioLista''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationGroup="GrpGuardar" ValidationExpression="^[0-9]{1,15}(?:\.[0-9]{1,4})?$" />
|
||||
<ajax:ValidatorCalloutExtender ID="VCTxtPrecioMinimo" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecioMinimo" Width="300px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField DataField="UnidadMedida" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="U.M." />
|
||||
<asp:BoundField DataField="UnidadMedida" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="U.M." />
|
||||
<asp:BoundField DataField="Moneda" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Moneda" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="CostoPromedio" NullDisplayText="-" ItemStyle-Width="5%" DataFormatString="{0:N2}" Visible="false" HeaderText="C. Promedio" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="VentaMinima" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="E. Mínimo" ItemStyle-HorizontalAlign="right" />
|
||||
@@ -216,6 +222,34 @@
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
<div id="dvMultiple" runat="server" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<asp:LinkButton ID="LnkGuardarMultiple" runat="server" AlternateText="Actualizar" CausesValidation="True" CssClass="btn btn-primary" Text="Actualizar Seleccionadas" OnClick="LnkGuardarMultiple_Click" />
|
||||
<%--<button onclick="convertirTabla(); return false;"> test</button>--%>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div align="right">
|
||||
<input type="text" id="TxtBuscarM" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarM','{0}')", GvMultiple.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscarM','{0}')", GvMultiple.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<asp:GridView ID="GvMultiple" runat="server" GridLines="None" AutoGenerateColumns="true" ClientIDMode="Static"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" EmptyDataText="No se encontraron registros"
|
||||
OnRowCreated="GvMultiple_RowCreated" OnRowDataBound="GvMultiple_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkPS" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="ModalActualizaPrecios" class="modal ADS fade" role="dialog">
|
||||
@@ -255,7 +289,7 @@
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chkSucursal" runat="server" Checked="false" CssClass="CsMCheckGvSucursal" />
|
||||
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' />
|
||||
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If(IsDBNull(Eval("CvePS")), 0, 1) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="30%">
|
||||
@@ -366,18 +400,43 @@
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
|
||||
function convertirTabla(){
|
||||
let json = tableToJson($('#GvMultiple').get(0));
|
||||
}
|
||||
|
||||
function tableToJson(table) {
|
||||
var data = [];
|
||||
|
||||
// first row needs to be headers
|
||||
var headers = [];
|
||||
for (var i = 0; i < table.rows[0].cells.length; i++) {
|
||||
if (table.rows[0].cells[i].innerHTML != "") {
|
||||
headers[i] = table.rows[0].cells[i].innerText.toLowerCase().replace(/ /gi, '');
|
||||
}
|
||||
}
|
||||
// go through cells
|
||||
for (var i = 1; i < table.rows.length; i++) {
|
||||
var tableRow = table.rows[i];
|
||||
var rowData = {};
|
||||
for (var j = 1; j < tableRow.cells.length; j++) {
|
||||
rowData[headers[j]] = tableRow.cells[j].innerText;
|
||||
}
|
||||
data.push(rowData);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function onlyNumberKey(evt) {
|
||||
|
||||
// Only ASCII character in that range allowed
|
||||
var ASCIICode = (evt.which) ? evt.which : evt.keyCode
|
||||
if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57))
|
||||
{
|
||||
if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57)) {
|
||||
if (ASCIICode == 46) {
|
||||
return true
|
||||
return true
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user