Add Buchhaltungskonto in MemberListWindow

This commit is contained in:
2023-02-27 19:47:58 +01:00
parent 210d85bdc9
commit c7bcf2aa00
2 changed files with 26 additions and 19 deletions

View File

@ -137,8 +137,6 @@ namespace WGneu.Windows {
}
private void SaveButton_Click(object sender, RoutedEventArgs e) {
// TODO only allow to click button, if values were checked
Member? m = new();
if (IsEditing)
m = (Member)MemberList.SelectedItem;
@ -173,6 +171,7 @@ namespace WGneu.Windows {
m.EntryDate = (EntryDateInput.Text == "") ? null : string.Join("-", EntryDateInput.Text.Split(".").Reverse());
m.ExitDate = (ExitDateInput.Text == "") ? null : string.Join("-", ExitDateInput.Text.Split(".").Reverse());
m.BusinessShares = (BusinessSharesInput.Text == "") ? 0 : int.Parse(BusinessSharesInput.Text);
m.AccountingNr = (AccountingNrInput.Text == "") ? null : AccountingNrInput.Text;
m.Active = ActiveInput.IsChecked ?? false;
m.VollLieferant = VollLieferantInput.IsChecked ?? false;
m.Funktionär = FunkionärInput.IsChecked ?? false;
@ -181,7 +180,6 @@ namespace WGneu.Windows {
m.Comment = (CommentInput.Text == "") ? null : CommentInput.Text;
if (ContactPostInput.IsChecked ?? false) m.DefaultContact = "post";
if (ContactEmailInput.IsChecked ?? false) m.DefaultContact = "email";
// TODO Buchhaltungskonto
try {
if (IsEditing)
@ -337,6 +335,7 @@ namespace WGneu.Windows {
EntryDateInput.Text = (m.EntryDate != null) ? string.Join(".", m.EntryDate.Split("-").Reverse()) : null;
ExitDateInput.Text = (m.ExitDate != null) ? string.Join(".", m.ExitDate.Split("-").Reverse()) : null;
BusinessSharesInput.Text = m.BusinessShares.ToString();
AccountingNrInput.Text = m.AccountingNr;
BranchInput.SelectedItem = m.Branch;
DefaultKgInput.SelectedItem = m.DefaultKg;
CommentInput.Text = m.Comment;