Move more input checker methods to AdminWindow
This commit is contained in:
@ -30,10 +30,10 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs evt) {
|
||||
TextBoxInputs = Utils.FindVisualChilds<TextBox>(this, ExemptInputs).ToArray();
|
||||
ComboBoxInputs = Utils.FindVisualChilds<ComboBox>(this, ExemptInputs).ToArray();
|
||||
CheckBoxInputs = Utils.FindVisualChilds<CheckBox>(this, ExemptInputs).ToArray();
|
||||
RadioButtonInputs = Utils.FindVisualChilds<RadioButton>(this, ExemptInputs).ToArray();
|
||||
TextBoxInputs = Utils.FindAllChildren<TextBox>(this, ExemptInputs).ToArray();
|
||||
ComboBoxInputs = Utils.FindAllChildren<ComboBox>(this, ExemptInputs).ToArray();
|
||||
CheckBoxInputs = Utils.FindAllChildren<CheckBox>(this, ExemptInputs).ToArray();
|
||||
RadioButtonInputs = Utils.FindAllChildren<RadioButton>(this, ExemptInputs).ToArray();
|
||||
foreach (var tb in TextBoxInputs)
|
||||
Valid[tb] = true;
|
||||
}
|
||||
@ -250,5 +250,76 @@ namespace Elwig.Windows {
|
||||
UpdateButtons();
|
||||
}
|
||||
|
||||
protected void IntegerInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckInteger);
|
||||
}
|
||||
|
||||
protected void PartialDateInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckPartialDate);
|
||||
}
|
||||
|
||||
protected void DateInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckDate);
|
||||
}
|
||||
|
||||
protected void PlzInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
var plz = (TextBox)sender;
|
||||
InputTextChanged(plz, Validator.CheckPlz);
|
||||
UpdatePlz(plz, Utils.FindNextSibling<ComboBox>(plz));
|
||||
}
|
||||
|
||||
protected void PlzInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||
var plz = (TextBox)sender;
|
||||
InputLostFocus(plz, Validator.CheckPlz);
|
||||
UpdatePlz(plz, Utils.FindNextSibling<ComboBox>(plz));
|
||||
}
|
||||
|
||||
protected void EmailInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckEmailAddress);
|
||||
}
|
||||
|
||||
protected void EmailInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckEmailAddress);
|
||||
}
|
||||
|
||||
protected void PhoneNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckPhoneNumber);
|
||||
}
|
||||
|
||||
protected void PhoneNrInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckPhoneNumber);
|
||||
}
|
||||
|
||||
protected void IbanInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckIban);
|
||||
}
|
||||
|
||||
protected void IbanInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckIban);
|
||||
}
|
||||
|
||||
protected void BicInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckBic);
|
||||
}
|
||||
|
||||
protected void BicInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckBic);
|
||||
}
|
||||
|
||||
protected void UstIdInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckUstId);
|
||||
}
|
||||
|
||||
protected void UstIdInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckUstId);
|
||||
}
|
||||
|
||||
protected void LfbisNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckLfbisNr);
|
||||
}
|
||||
|
||||
protected void LfbisNrInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckLfbisNr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user