Add age to member admin window
This commit is contained in:
@ -142,6 +142,9 @@
|
||||
<TextBox x:Name="BirthdayInput" Margin="0,100,0,0" Grid.Column="1" Width="78" TextAlignment="Right" HorizontalAlignment="Left"
|
||||
TextChanged="PartialDateInput_TextChanged" LostFocus="PartialDateInput_LostFocus"/>
|
||||
|
||||
<Label Content="Alter:" Margin="85,100,0,0" Grid.Column="1"/>
|
||||
<TextBlock x:Name="Age" Text="-" Margin="119,104,0,0" Grid.Column="1" TextWrapping="NoWrap" VerticalAlignment="Top"/>
|
||||
|
||||
<Label Content="Adresse:" Margin="10,130,0,0"/>
|
||||
<TextBox x:Name="AddressInput" Margin="0,130,10,0" Grid.Column="1" Grid.ColumnSpan="3"
|
||||
TextChanged="TextBox_TextChanged"/>
|
||||
|
@ -347,6 +347,13 @@ namespace Elwig.Windows {
|
||||
FamilyNameInput.Text = m.FamilyName;
|
||||
SuffixInput.Text = m.Suffix;
|
||||
BirthdayInput.Text = (m.Birthday != null) ? string.Join(".", m.Birthday.Split("-").Reverse()) : null;
|
||||
if (m.Birthday?.Length == 10) {
|
||||
Age.Text = Utils.GetAge(DateOnly.ParseExact(m.Birthday, "yyyy-MM-dd")).ToString();
|
||||
} else if (m.Birthday != null) {
|
||||
Age.Text = "ca. " + (DateTime.Now.Year - int.Parse(m.Birthday[^4..])).ToString();
|
||||
} else {
|
||||
Age.Text = "-";
|
||||
}
|
||||
AddressInput.Text = m.Address;
|
||||
AT_PlzDest? p = m.PostalDest.AtPlz;
|
||||
if (p != null) {
|
||||
@ -412,6 +419,7 @@ namespace Elwig.Windows {
|
||||
new protected void ClearInputs() {
|
||||
Menu_Member_SendEmail.IsEnabled = false;
|
||||
AreaCommitment.Text = "- m²";
|
||||
Age.Text = "-";
|
||||
base.ClearInputs();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user