From 6769d82e23a96e925e6fcbcd200ef4b4c9b960ba Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 8 Jan 2024 11:05:29 -0700 Subject: [PATCH] =?UTF-8?q?-=20nuevo=20m=C3=A9todo=20SubString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/modExtensiones.vb | 4 ++++ Ventas/Ventas.aspx.vb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index d79ec8554..cdc3e0a1b 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -821,6 +821,10 @@ Namespace Extensiones End If Return Tmp End Function + + Public Function SubStringADS(Str As String, Longitud As Integer) As String + Return Str.Substring(0, If(Str.Length > 30, 30, Str.Length)) + End Function Public Function Texto2Letras(ByVal Importe As Decimal, Optional CveMoneda As Integer = 1) As String diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 0fe7531bd..a92e64d81 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5194,7 +5194,7 @@ Partial Class Ventas HdnTotalVenta.Value = DbRowVenta("Total").ToString().FormatoNumero(2) TxtMotivoDescuento.Text = DbRowVenta("MotivoDescuento").ToString() TxtObsFact.Text = DbRowVenta("Observaciones").ToString() - LblUsuario.Text = DbRowVenta("Nombre").ToString().Substring(0, If(DbRowVenta("Nombre").ToString.Length > 30, 30, DbRowVenta("Nombre").ToString.Length)) + LblUsuario.Text = DbRowVenta("Nombre").ToString().SubStringADS(30) LblFechaRegistro.Text = DbRowVenta("FechaIng").ToString().ToDate.ToShortDateString LblSeTimbro.Text = DbRowVenta("SeTimbro").ToString() LblMail.Text = DbRowVenta("EnvioMail").ToString()