Se agregó un label del total de importe

This commit is contained in:
Antonio Gonzalez
2019-12-17 16:41:28 -07:00
parent 7fab89521f
commit ff1e3af3cc
2 changed files with 22 additions and 2 deletions

View File

@@ -110,14 +110,17 @@
<br /> <br />
<br /> <br />
<div runat="server" id="divLabelTotal" style="width:100%;text-align:right;font-size:1.5em" visible="false">
<asp:label runat="server">Importe seleccionado: $</asp:label><asp:label runat="server" ID="lblValorTotal">00.00</asp:label>
</div>
<br />
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None"> <asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="ChkFactura" runat="server" Checked="false" Enabled="True" /> <asp:CheckBox ID="ChkFactura" OnCheckedChanged="ChkFactura_Click" runat="server" Checked="false" Enabled="True" AutoPostBack="True"/>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Factura"> <asp:TemplateField HeaderText="Factura">

View File

@@ -48,6 +48,7 @@ Partial Class Bancos_DepositosCaja
UpGvFacturas.Update() UpGvFacturas.Update()
GvFacturas.DataBind() GvFacturas.DataBind()
divLabelTotal.Visible = True
End Sub End Sub
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
@@ -157,4 +158,20 @@ Partial Class Bancos_DepositosCaja
ObjContabilidad.Dispose() ObjContabilidad.Dispose()
End Sub End Sub
Private Sub ObtenerTotalImporta()
Dim Total As Double = 0
For Each Gvr As GridViewRow In GvFacturas.Rows
If Gvr.FCCheckBox("ChkFactura").Checked Then
Total += Gvr.DataKey("Importe").ToDouble
End If
Next
lblValorTotal.Text = Total.ToString
UpGvFacturas.Update()
End Sub
Public Sub ChkFactura_Click(sender As Object, e As EventArgs)
ObtenerTotalImporta()
End Sub
End Class End Class