mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Synchronization code
This commit is contained in:
@@ -504,6 +504,7 @@ namespace SqlSugar
|
|||||||
addValue =UtilMethods.GetFormatValue(addValue,valueFomatInfo);
|
addValue =UtilMethods.GetFormatValue(addValue,valueFomatInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var type = UtilMethods.GetUnderType(item.PropertyType);
|
||||||
if (addValue == DBNull.Value || addValue == null)
|
if (addValue == DBNull.Value || addValue == null)
|
||||||
{
|
{
|
||||||
if (item.PropertyType.IsIn(UtilConstants.IntType, UtilConstants.DecType, UtilConstants.DobType, UtilConstants.ByteType))
|
if (item.PropertyType.IsIn(UtilConstants.IntType, UtilConstants.DecType, UtilConstants.DobType, UtilConstants.ByteType))
|
||||||
@@ -527,19 +528,19 @@ namespace SqlSugar
|
|||||||
addValue = null;
|
addValue = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (UtilMethods.GetUnderType(item.PropertyType) == UtilConstants.IntType)
|
else if (type == UtilConstants.IntType)
|
||||||
{
|
{
|
||||||
addValue = Convert.ToInt32(addValue);
|
addValue = Convert.ToInt32(addValue);
|
||||||
}
|
}
|
||||||
else if (UtilMethods.GetUnderType(item.PropertyType) == UtilConstants.LongType)
|
else if (type == UtilConstants.LongType)
|
||||||
{
|
{
|
||||||
addValue = Convert.ToInt64(addValue);
|
addValue = Convert.ToInt64(addValue);
|
||||||
}
|
}
|
||||||
else if (UtilMethods.GetUnderType(item.PropertyType).IsEnum() && addValue is decimal)
|
else if (type.IsEnum() && addValue is decimal)
|
||||||
{
|
{
|
||||||
addValue = Convert.ToInt64(addValue);
|
addValue = Convert.ToInt64(addValue);
|
||||||
}
|
}
|
||||||
else if (item.PropertyType.FullName == "System.DateOnly")
|
else if (type.FullName == "System.DateOnly")
|
||||||
{
|
{
|
||||||
addValue = Convert.ToDateTime(addValue).ToString("yyyy-MM-dd");
|
addValue = Convert.ToDateTime(addValue).ToString("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user