Abfangen und null setzen falls falsche Tastatureingabe (Datum, Datetime)
This commit is contained in:
parent
32ede83fd2
commit
652644bcb0
@ -109,7 +109,7 @@ namespace ENI2.Controls
|
|||||||
thePicker.Value = new DateTime(year, month, day, hour, minute, 0);
|
thePicker.Value = new DateTime(year, month, day, hour, minute, 0);
|
||||||
}
|
}
|
||||||
catch (FormatException) { }
|
catch (FormatException) { }
|
||||||
catch (ArgumentOutOfRangeException) { thePicker.Value = DateTime.Now; }
|
catch (ArgumentOutOfRangeException) { thePicker.Value = null; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ namespace ENI2.Controls
|
|||||||
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
||||||
}
|
}
|
||||||
catch (FormatException) { }
|
catch (FormatException) { }
|
||||||
catch (ArgumentOutOfRangeException) { thePicker.SelectedDate = DateTime.Now; }
|
catch (ArgumentOutOfRangeException) { thePicker.SelectedDate = null; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -298,7 +298,9 @@ namespace ENI2
|
|||||||
int year = Int32.Parse(timevalText.Substring(4, 4));
|
int year = Int32.Parse(timevalText.Substring(4, 4));
|
||||||
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
||||||
}
|
}
|
||||||
catch (FormatException) { }
|
catch (Exception) {
|
||||||
|
thePicker.SelectedDate = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user