[#15] MailWindow: Small quality fixes
This commit is contained in:
@ -252,7 +252,7 @@ namespace Elwig {
|
||||
}
|
||||
|
||||
public static MailWindow FocusMailWindow(int? year = null) {
|
||||
return FocusWindow<MailWindow>(() => new(year));
|
||||
return FocusWindow<MailWindow>(() => new(year), w => year == null || w.Year == year);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ namespace Elwig.Windows {
|
||||
CreditNote.Name,
|
||||
];
|
||||
|
||||
protected readonly int? Year;
|
||||
public readonly int? Year;
|
||||
public ObservableCollection<SelectedDoc> SelectedDocs = [];
|
||||
public IEnumerable<Member> Recipients = [];
|
||||
|
||||
@ -102,7 +102,7 @@ namespace Elwig.Windows {
|
||||
public MailWindow(int? year = null) {
|
||||
InitializeComponent();
|
||||
Year = year ?? Context.Seasons.OrderBy(s => s.Year).LastOrDefault()?.Year;
|
||||
Title = $"Rundschreiben {Year} - Elwig";
|
||||
Title = $"Rundschreiben - Lese {Year} - Elwig";
|
||||
|
||||
AvaiableDocumentsList.ItemsSource = AvaiableDocuments;
|
||||
SelectedDocumentsList.ItemsSource = SelectedDocs;
|
||||
@ -559,7 +559,7 @@ namespace Elwig.Windows {
|
||||
|
||||
public void AddDeliveryConfirmation() {
|
||||
AvaiableDocumentsList.SelectedIndex = 1;
|
||||
if (AvaiableDocumentsList.SelectedItem is not string s)
|
||||
if (AvaiableDocumentsList.SelectedItem is not string s || SelectedDocs.Any(d => d.Type == DocType.DeliveryConfirmation))
|
||||
return;
|
||||
SelectedDocs.Add(new(DocType.DeliveryConfirmation, s, ((int)Year!, DocumentNonDeliverersInput.IsChecked == true)));
|
||||
SelectedDocumentsList.SelectedIndex = SelectedDocs.Count - 1;
|
||||
|
Reference in New Issue
Block a user