diff --git a/WGneu/Print/Pdf.cs b/WGneu/Print/Pdf.cs
index 9cad37b..ef5caae 100644
--- a/WGneu/Print/Pdf.cs
+++ b/WGneu/Print/Pdf.cs
@@ -30,5 +30,12 @@ namespace WGneu.Print {
await page.WaitForFunctionAsync("() => window.finished");
await page.PdfAsync(path_pdf);
}
+
+ public static void Display(string path) {
+ Process.Start(new ProcessStartInfo() {
+ FileName = path,
+ UseShellExecute = true,
+ });
+ }
}
}
diff --git a/WGneu/Print/Template.cs b/WGneu/Print/Template.cs
index 4ce9893..5839466 100644
--- a/WGneu/Print/Template.cs
+++ b/WGneu/Print/Template.cs
@@ -12,10 +12,7 @@ namespace WGneu.Print {
public static async void Test() {
await Pdf.Convert(ROOT + "din-5008.html", ROOT + "test.pdf");
- Process.Start(new ProcessStartInfo() {
- FileName = ROOT + "test.pdf",
- UseShellExecute = true,
- });
+ Pdf.Display(ROOT + "test.pdf");
}
}
}
diff --git a/WGneu/Windows/MemberListWindow.xaml b/WGneu/Windows/MemberListWindow.xaml
index c42ead9..107f1f9 100644
--- a/WGneu/Windows/MemberListWindow.xaml
+++ b/WGneu/Windows/MemberListWindow.xaml
@@ -75,7 +75,8 @@
-
+ HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,10,10,10" Width="100" Grid.Column="2"/>
diff --git a/WGneu/Windows/MemberListWindow.xaml.cs b/WGneu/Windows/MemberListWindow.xaml.cs
index 4d8f453..3fb6dd5 100644
--- a/WGneu/Windows/MemberListWindow.xaml.cs
+++ b/WGneu/Windows/MemberListWindow.xaml.cs
@@ -38,7 +38,7 @@ namespace WGneu.Windows {
}
private void Window_Loaded(object sender, RoutedEventArgs e) {
- AktiveMitgliederInput.IsChecked = true;
+ ActiveMemberInput.IsChecked = true;
BranchInput.ItemsSource = Context.Branches.OrderBy(b => b.Name).ToList();
DefaultKgInput.ItemsSource = Context.WbKgs.Select(k => k.Kg).OrderBy(k => k.Name).ToList();
}
@@ -63,8 +63,11 @@ namespace WGneu.Windows {
private void RefreshMemberList() {
Context.Members.Load();
- List members = AktiveMitgliederInput.IsChecked.Value ? Context.Members.Where(m => m.Active).ToList() : Context.Members.ToList();
+ IQueryable memberQuery = Context.Members;
+ if (ActiveMemberInput.IsChecked == true)
+ memberQuery = memberQuery.Where(m => m.Active);
+ List members = memberQuery.ToList();
members = members.OrderBy(m => m.FamilyName + " " + m.GivenName).ToList();
if (TextFilter.Count > 0) {
@@ -88,7 +91,7 @@ namespace WGneu.Windows {
foreach (var cb in Utils.FindVisualChilds(this))
Utils.ClearInputState(cb);
foreach (var cb in Utils.FindVisualChilds(this))
- if (cb.Name != "AktiveMitgliederInput") Utils.ClearInputState(cb);
+ if (cb.Name != "ActiveMemberInput") Utils.ClearInputState(cb);
foreach (var rb in Utils.FindVisualChilds(this))
Utils.ClearInputState(rb);
}
@@ -116,7 +119,7 @@ namespace WGneu.Windows {
RefreshInputs();
}
- private void ActiveMemberCheckBox_Changed(object sender, RoutedEventArgs e) {
+ private void ActiveMemberInput_Changed(object sender, RoutedEventArgs e) {
RefreshMemberList();
}
@@ -127,6 +130,7 @@ namespace WGneu.Windows {
HideNewEditDeleteButtons();
ShowSaveResetCancelButtons();
UnlockInputs();
+ LockSearchInputs();
}
private void EditMemberButton_Click(object sender, RoutedEventArgs e) {
@@ -139,6 +143,7 @@ namespace WGneu.Windows {
HideNewEditDeleteButtons();
ShowSaveResetCancelButtons();
UnlockInputs();
+ LockSearchInputs();
}
private void DeleteMemberButton_Click(object sender, RoutedEventArgs e) {
@@ -221,6 +226,7 @@ namespace WGneu.Windows {
HideSaveResetCancelButtons();
ShowNewEditDeleteButtons();
LockInputs();
+ UnlockSearchInputs();
RefreshMemberList();
}
@@ -241,6 +247,7 @@ namespace WGneu.Windows {
ShowNewEditDeleteButtons();
RefreshInputs();
LockInputs();
+ UnlockSearchInputs();
}
private void SearchInput_TextChanged(object sender, RoutedEventArgs e) {
@@ -303,7 +310,7 @@ namespace WGneu.Windows {
foreach (var cb in Utils.FindVisualChilds(this))
cb.IsEnabled = false;
foreach (var cb in Utils.FindVisualChilds(this))
- cb.IsEnabled = cb.Name == "AktiveMitgliederInput" ? true : false;
+ if (cb.Name != "ActiveMemberInput") cb.IsEnabled = false;
foreach (var rb in Utils.FindVisualChilds(this))
rb.IsEnabled = false;
}
@@ -314,11 +321,21 @@ namespace WGneu.Windows {
foreach (var cb in Utils.FindVisualChilds(this))
cb.IsEnabled = true;
foreach (var cb in Utils.FindVisualChilds(this))
- cb.IsEnabled = cb.Name == "AktiveMitgliederInput" ? false : true;
+ if (cb.Name != "ActiveMemberInput") cb.IsEnabled = true;
foreach (var rb in Utils.FindVisualChilds(this))
rb.IsEnabled = true;
}
+ private void LockSearchInputs() {
+ SearchInput.IsEnabled = false;
+ ActiveMemberInput.IsEnabled = false;
+ }
+
+ private void UnlockSearchInputs() {
+ SearchInput.IsEnabled = true;
+ ActiveMemberInput.IsEnabled = true;
+ }
+
private void FillInputs(Member m) {
OriginalValues.Clear();
@@ -375,7 +392,7 @@ namespace WGneu.Windows {
foreach (var cb in Utils.FindVisualChilds(this))
OriginalValues[cb] = cb.SelectedItem;
foreach (var cb in Utils.FindVisualChilds(this))
- if (cb.Name != "AktiveMitgliederInput") OriginalValues[cb] = (cb.IsChecked ?? false) ? bool.TrueString : null;
+ if (cb.Name != "ActiveMemberInput") OriginalValues[cb] = (cb.IsChecked ?? false) ? bool.TrueString : null;
foreach (var rb in Utils.FindVisualChilds(this))
OriginalValues[rb] = (rb.IsChecked ?? false) ? bool.TrueString : null;
}
@@ -386,7 +403,7 @@ namespace WGneu.Windows {
foreach (var cb in Utils.FindVisualChilds(this))
cb.SelectedItem = null;
foreach (var cb in Utils.FindVisualChilds(this))
- if (cb.Name != "AktiveMitgliederInput") cb.IsChecked = false;
+ if (cb.Name != "ActiveMemberInput") cb.IsChecked = false;
foreach (var rb in Utils.FindVisualChilds(this))
rb.IsChecked = false;
OriginalValues.Clear();