From 27a32d5d6dc9b77f765e0415301b7c2ae2e4d530 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:52:31 -0700 Subject: [PATCH] =?UTF-8?q?BDH.=20Generaci=C3=B3n=20de=20txt=20en=20Report?= =?UTF-8?q?e=20de=20Ajustes/Garantia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Acumuladores/CatFoliosGarantia.aspx | 9 +++-- Acumuladores/CatFoliosGarantia.aspx.vb | 50 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 81001388a..5ca6a7a2a 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -385,12 +385,13 @@
- + - + @@ -408,9 +409,13 @@
diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb index 9172d5c1e..512e7e593 100644 --- a/Acumuladores/CatFoliosGarantia.aspx.vb +++ b/Acumuladores/CatFoliosGarantia.aspx.vb @@ -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