protected static object GetValueByType(PropertyInfo info,T obj)
{
if (info.PropertyType.Name == "DateTime" && Convert.ToDateTime(info.GetValue(obj, null))==DateTime.MinValue)
{
return DateTime.Parse("1900/1/1");
}
object newObj = info.GetValue(obj, null);
if (newObj != null)
{
return newObj;
}
if (info.PropertyType.Name == "String")
{
return String.Empty;
}
return null;
}
{
if (info.PropertyType.Name == "DateTime" && Convert.ToDateTime(info.GetValue(obj, null))==DateTime.MinValue)
{
return DateTime.Parse("1900/1/1");
}
object newObj = info.GetValue(obj, null);
if (newObj != null)
{
return newObj;
}
if (info.PropertyType.Name == "String")
{
return String.Empty;
}
return null;
}

浙公网安备 33010602011771号