BDH. Generación de txt en Reporte de Ajustes/Garantia
This commit is contained in:
@@ -385,12 +385,13 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div style="overflow-y: auto; height: 400px; width: 1200px;" runat="server">
|
||||
<asp:GridView ID="GvGarantiasDetalle" runat="server" AutoGenerateColumns="false" Width="100%" EmptyDataText="No se encontraron datos" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
|
||||
<asp:GridView ID="GvGarantiasDetalle" runat="server" AutoGenerateColumns="false" Width="100%" EmptyDataText="No se encontraron datos" CssClass="table table-striped table-hover Widthall"
|
||||
DataKeyNames="Consecutivo,CodigoCliente,CodigoProducto,CodigoTipoUso,CodigoTipoDefecto,CodigoEnsamble,CodigoLinea,CodigoInspeccion,FechaVenta,FechaReclamacion,TipoComprobante,Comprobante,Autorizo,Comentarios,ClaveAutorizacion" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Consecutivo" HeaderText="Consecutivo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="FolioFactura" HeaderText="Factura" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
|
||||
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="CodigoProducto" HeaderText="Código" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="PS" HeaderText="Producto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
<asp:BoundField DataField="TipoUso" HeaderText="Tipo Uso" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="CodigoEnsamble" HeaderText="Código Ensamble" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
@@ -408,9 +409,13 @@
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnGenerarTxt" Text="Generar Archivo" CssClass="btn btn-primary" runat="server" OnClick="BtnGenerarTxt_Click" />
|
||||
<asp:Button ID="BtnExportarExcel" Text="Generar Excel" CssClass="btn btn-success" runat="server" OnClick="BtnExportarExcel_Click" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnGenerarTxt" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -255,4 +255,54 @@ Partial Class Acumuladores_CatFoliosGarantia
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
Protected Sub BtnGenerarTxt_Click(sender As Object, e As EventArgs)
|
||||
Dim SbTxt As New StringBuilder
|
||||
|
||||
For Each GvRow As GridViewRow In GvGarantiasDetalle.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
'1.- Consecutivo Partida-->1
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Consecutivo"))
|
||||
'2.- Cliente-->100407
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoCliente"))
|
||||
'3. Codigo De Articulo --> 171402
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoProducto"))
|
||||
'4. Tipo De Uso --> A
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoUso"))
|
||||
'5. Defecto --> P
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoDefecto"))
|
||||
'6. Codigo De Ensamble --> 1X
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoEnsamble"))
|
||||
'7. Codigo De Linea/Termico --> 9000
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoLinea"))
|
||||
'8. Codigo De Inspeccion --> J8K
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoInspeccion"))
|
||||
'9. Fecha De Venta --> 05/09/2009
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaVenta").ToDateTime().ToString("dd/MM/yyyy"))
|
||||
'10. Fecha De Reclamacion --> 05/07/2010
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaReclamacion").ToDateTime().ToString("dd/MM/yyyy"))
|
||||
'11. TipoComprobante --> 1
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("TipoComprobante"))
|
||||
'12. Comprobante --> N/A
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comprobante"))
|
||||
'13. Autorizo --> STAN7490
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Autorizo"))
|
||||
'14. Comentarios --> Cliente 100407
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comentarios"))
|
||||
'15. Clave De Autorizacion / Codigo Error --> P05TRBGX
|
||||
SbTxt.AppendFormat("{0}", GvRow.DataKey("ClaveAutorizacion"))
|
||||
|
||||
SbTxt.Append(vbCrLf)
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim text As String = SbTxt.ToString
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.AddHeader("Content-Length", text.Length.ToString)
|
||||
Response.ContentType = "text/plain"
|
||||
Response.AppendHeader("content-disposition", $"attachment;filename=""{LblFolio.Text}.txt""")
|
||||
Response.Write(text)
|
||||
Response.End()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user