From 8c6fd742db249ad4cc819cf041eb98d880a3ef73 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期四, 02 一月 2025 15:09:07 +0800 Subject: [PATCH] 1 --- WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/UtilConvert.cs | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/UtilConvert.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/UtilConvert.cs index 352dd93..e8b5d75 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/UtilConvert.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/UtilConvert.cs @@ -75,6 +75,10 @@ { int reval = 0; if (thisValue == null) return 0; + if (thisValue is Enum && thisValue != DBNull.Value && Enum.TryParse(thisValue.GetType(), thisValue.ToString(), out var val)) + { + return Convert.ToInt32(val.ChangeType(typeof(int))); + } if (thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval)) { return reval; -- Gitblit v1.9.3