More input validation
This commit is contained in:
@ -251,7 +251,8 @@ namespace WGneu.Helpers {
|
||||
}
|
||||
|
||||
public static ValidationResult CheckUstId(TextBox input, bool optional) {
|
||||
return new(false, "Not implemented yet");
|
||||
// TODO
|
||||
return new(true, "Not implemented yet");
|
||||
}
|
||||
|
||||
public static ValidationResult CheckMgNr(TextBox input, bool optional, AppDbContext ctx, Member m) {
|
||||
@ -282,5 +283,15 @@ namespace WGneu.Helpers {
|
||||
|
||||
return new(true, null);
|
||||
}
|
||||
|
||||
public static ValidationResult CheckDate(TextBox input, bool optional) {
|
||||
// TODO
|
||||
return new(true, "Not implemented yet");
|
||||
}
|
||||
|
||||
public static ValidationResult CheckPartialDate(TextBox input, bool optional) {
|
||||
// TODO
|
||||
return new(true, "Not implemented yet");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,8 @@
|
||||
TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
<Label Content="Geburtstag:" Margin="10,100,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="BirthdayInput" Margin="0,100,0,0" Grid.Column="1" Width="78" TextAlignment="Right" HorizontalAlignment="Left"/>
|
||||
<TextBox x:Name="BirthdayInput" Margin="0,100,0,0" Grid.Column="1" Width="78" TextAlignment="Right" HorizontalAlignment="Left"
|
||||
TextChanged="BirthdayInput_TextChanged"/>
|
||||
|
||||
<Label Content="Adresse:" Margin="10,130,0,0"/>
|
||||
<TextBox x:Name="AddressInput" Margin="0,130,10,0" Grid.Column="1" Grid.ColumnSpan="3"
|
||||
@ -246,13 +247,16 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Content="Eintritt:" Margin="10,10,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="EntryDateInput" Margin="0,10,10,0" Width="76" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"/>
|
||||
<TextBox x:Name="EntryDateInput" Margin="0,10,10,0" Width="76" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
TextChanged="DateInput_TextChanged"/>
|
||||
|
||||
<Label Content="Austritt:" Margin="10,40,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="ExitDateInput" Margin="0,40,10,0" Width="76" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"/>
|
||||
<TextBox x:Name="ExitDateInput" Margin="0,40,10,0" Width="76" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
TextChanged="DateInput_TextChanged"/>
|
||||
|
||||
<Label Content="Geschäftsanteile:" Margin="10,70,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="BusinessSharesInput" Margin="0,70,10,0" Width="48" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"/>
|
||||
<TextBox x:Name="BusinessSharesInput" Margin="0,70,10,0" Width="48" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
TextChanged="NumericInput_TextChanged"/>
|
||||
|
||||
<Label Content="BH-Konto:" Margin="10,100,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="AccountingNrInput" Margin="0,100,10,0" Grid.Column="1"
|
||||
@ -281,7 +285,7 @@
|
||||
Margin="0,160,10,0" Grid.Column="1" Grid.ColumnSpan="2"/>
|
||||
|
||||
<Label Content="Anmerkung:" Margin="10,190,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="CommentInput" Margin="0,190,10,0" Grid.Column="1" Grid.ColumnSpan="2" TextAlignment="Right"
|
||||
<TextBox x:Name="CommentInput" Margin="0,190,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
<Label Content="Kontaktart:" Margin="10,220,0,0" Grid.Column="0"/>
|
||||
|
@ -546,6 +546,10 @@ namespace WGneu.Windows {
|
||||
UpdateButtons();
|
||||
}
|
||||
|
||||
private void NumericInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, false, Validator.CheckNumeric);
|
||||
}
|
||||
|
||||
private void MgNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, false, Validator.CheckMgNr);
|
||||
}
|
||||
@ -562,6 +566,10 @@ namespace WGneu.Windows {
|
||||
InputLostFocus((TextBox)sender, true, Validator.CheckPredecessorMgNr);
|
||||
}
|
||||
|
||||
private void BirthdayInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, true, Validator.CheckPartialDate);
|
||||
}
|
||||
|
||||
private void PlzInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, false, Validator.CheckPlz);
|
||||
UpdatePlz((TextBox)sender, OrtInput);
|
||||
@ -629,5 +637,9 @@ namespace WGneu.Windows {
|
||||
InputLostFocus((TextBox)sender, true, Validator.CheckPlz);
|
||||
UpdatePlz((TextBox)sender, BillingOrtInput);
|
||||
}
|
||||
|
||||
private void DateInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, true, Validator.CheckDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user