| | |
| | | 锘縰sing Newtonsoft.Json; |
| | | 锘縰sing NetTaste; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | { |
| | | 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; |
| | |
| | | |
| | | return reval; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | 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) |
| | |
| | | return Math.Round(ObjToDecimal(data), digits); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 鏋氫妇杞琇ist qy 2024-7-15 |