MemberListWindow Validator
This commit is contained in:
@ -171,6 +171,7 @@
|
||||
|
||||
<Label Content="BetriebsNr.:" HorizontalAlignment="Left" Margin="10,42,0,0" VerticalAlignment="Top" Padding="2"/>
|
||||
<TextBox x:Name="LfbisNrInput" IsReadOnly="True"
|
||||
TextChanged="LfbisNrInput_TextChanged" LostFocus="LfbisNrInput_LostFocus"
|
||||
Margin="0,40,10,0" VerticalAlignment="Top" FontSize="14" Padding="2" Grid.Column="1" Height="25" Width="64" HorizontalAlignment="Left"/>
|
||||
|
||||
<CheckBox x:Name="BuchführendInput" Content="Buchführend" IsEnabled="False"
|
||||
|
@ -294,26 +294,26 @@ namespace WGneu.Windows
|
||||
|
||||
private void LockInputs()
|
||||
{
|
||||
MgNrInput.IsReadOnly = true;
|
||||
GivenNameInput.IsReadOnly = true;
|
||||
FamilyNameInput.IsReadOnly = true;
|
||||
AddressInput.IsReadOnly = true;
|
||||
PlzInput.IsReadOnly = true;
|
||||
OrtInput.IsEnabled = false;
|
||||
BranchInput.IsEnabled = false;
|
||||
DefaultKgInput.IsEnabled = false;
|
||||
foreach (var tb in Utils.FindVisualChilds<TextBox>(this))
|
||||
if (tb.Name != "SearchInput") tb.IsReadOnly = true;
|
||||
foreach (var cb in Utils.FindVisualChilds<ComboBox>(this))
|
||||
cb.IsEnabled = false;
|
||||
foreach (var cb in Utils.FindVisualChilds<CheckBox>(this))
|
||||
cb.IsEnabled = false;
|
||||
foreach (var rb in Utils.FindVisualChilds<RadioButton>(this))
|
||||
rb.IsEnabled = false;
|
||||
}
|
||||
|
||||
private void UnlockInputs()
|
||||
{
|
||||
MgNrInput.IsReadOnly = false;
|
||||
GivenNameInput.IsReadOnly = false;
|
||||
FamilyNameInput.IsReadOnly = false;
|
||||
AddressInput.IsReadOnly = false;
|
||||
PlzInput.IsReadOnly = false;
|
||||
OrtInput.IsEnabled = true;
|
||||
BranchInput.IsEnabled = true;
|
||||
DefaultKgInput.IsEnabled = true;
|
||||
foreach (var tb in Utils.FindVisualChilds<TextBox>(this))
|
||||
if (tb.Name != "SearchInput") tb.IsReadOnly = false;
|
||||
foreach (var cb in Utils.FindVisualChilds<ComboBox>(this))
|
||||
cb.IsEnabled = true;
|
||||
foreach (var cb in Utils.FindVisualChilds<CheckBox>(this))
|
||||
cb.IsEnabled = true;
|
||||
foreach (var rb in Utils.FindVisualChilds<RadioButton>(this))
|
||||
rb.IsEnabled = true;
|
||||
}
|
||||
|
||||
private void FillInputs(Member m)
|
||||
@ -341,14 +341,24 @@ namespace WGneu.Windows
|
||||
|
||||
private void ClearInputs()
|
||||
{
|
||||
MgNrInput.Text = "";
|
||||
GivenNameInput.Text = "";
|
||||
FamilyNameInput.Text = "";
|
||||
BranchInput.SelectedItem = null;
|
||||
PlzInput.Text = "";
|
||||
OrtInput.SelectedItem = null;
|
||||
AddressInput.Text = "";
|
||||
DefaultKgInput.SelectedItem = null;
|
||||
foreach (var tb in Utils.FindVisualChilds<TextBox>(this))
|
||||
if (tb.Name != "SearchInput") tb.Text = "";
|
||||
foreach (var cb in Utils.FindVisualChilds<ComboBox>(this))
|
||||
cb.SelectedItem = null;
|
||||
}
|
||||
|
||||
private void LfbisNrInput_TextChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var res = Validator.CheckLfbisNr(LfbisNrInput);
|
||||
if (res.IsValid) Validator.SetInputValid(LfbisNrInput);
|
||||
else Validator.SetInputInvalid(LfbisNrInput);
|
||||
}
|
||||
|
||||
private void LfbisNrInput_LostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var res = Validator.CheckLfbisNr(LfbisNrInput);
|
||||
if (!res.IsValid)
|
||||
MessageBox.Show(res.ErrorContent.ToString(), "Betriebsnummer ungültig", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user