Add age to member admin window
This commit is contained in:
@ -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