dengjunjie
2025-03-12 f43b7df8400f4fcffc9f19dca0888d61e2b33d5f
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs
@@ -1,4 +1,5 @@
锘縰sing Newtonsoft.Json;
锘縰sing NetTaste;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
@@ -78,6 +79,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;
@@ -126,7 +131,7 @@
            return reval;
        }
        /// <summary>
        /// 
        /// </summary>
@@ -361,6 +366,14 @@
            return JsonConvert.SerializeObject(value);
        }
        public static bool IsNumeric(this object value)
        {
            if (value == null)
                return false;
            bool reslut = decimal.TryParse(value.ToString(), out decimal _number);
            return reslut;
        }
        public static bool IsInt(this object obj)
        {
            if (obj == null)
@@ -440,7 +453,7 @@
            return Math.Round(ObjToDecimal(data), digits);
        }
        /// <summary>
        /// 鏋氫妇杞琇ist qy 2024-7-15