diff --git a/Base/BaseObject.cs b/Base/BaseObject.cs index 09beac1..6eb1a26 100644 --- a/Base/BaseObject.cs +++ b/Base/BaseObject.cs @@ -59,21 +59,21 @@ void OnDeserialized(StreamingContext ctx) { object value = objValue.GetValue(this); - if (!(value == null || value.ToString() == string.Empty)) + if (!(value == null || value.ToString() == string.Empty || value.ToString() == "-")) pi.SetValue(this, decimal.Parse(value.ToString(), Culture)); } else if (pi.PropertyType == typeof(int?)) { object value = objValue.GetValue(this); - if (!(value == null || value.ToString() == string.Empty)) + if (!(value == null || value.ToString() == string.Empty || value.ToString() == "-")) pi.SetValue(this, int.Parse(value.ToString(), Culture)); } else if (pi.PropertyType == typeof(DateTime?)) { object value = objValue.GetValue(this); - if (!(value == null || value.ToString() == string.Empty)) + if (!(value == null || value.ToString() == string.Empty || value.ToString() == "-")) pi.SetValue(this, DateTime.Parse(value.ToString())); } }