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