From 6360d5a8282bb5422207a75e076a34f76e171c31 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 28 Jul 2025 08:36:32 +0200 Subject: [PATCH] =?UTF-8?q?=20-=202025-07-28=201.0.7=20Nueva=20funci=C3=B3?= =?UTF-8?q?n=20=20de=20ObtenerValorDesdeNombre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utilidades.vb | 9 +++++++++ tsUtilidades.vbproj | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Utilidades.vb b/Utilidades.vb index a575404..ef5f51b 100644 --- a/Utilidades.vb +++ b/Utilidades.vb @@ -836,4 +836,13 @@ Public Class DescripcionValor Return lista End Function + Public Function ObtenerValorDesdeNombre(Of TEnum As Structure)(nombre As String) As Integer? + Dim resultado As TEnum + If [Enum].TryParse(nombre, True, resultado) Then + Return Convert.ToInt32(resultado) + End If + Return Nothing ' Devuelve Nothing si no hay coincidencia + End Function + + End Class diff --git a/tsUtilidades.vbproj b/tsUtilidades.vbproj index 505e2e0..d4b93ba 100644 --- a/tsUtilidades.vbproj +++ b/tsUtilidades.vbproj @@ -16,11 +16,12 @@ net8.0 tsUtilidades net8.0, libreria - 1.0.6 + 1.0.7 Manuel Tecnosis S.A Utilidades varias Entity Framework compatibles con EF Core 8. + - 2025-07-28 1.0.7 Nueva función de ObtenerValorDesdeNombre - 2025-07-22 1.0.6 Nuevas funciones de encriptartexto y desencriptartexto - Se traslada a tecnosis.git no hay cambios respecto a la 1.0.1