Compare commits
2 Commits
v0.4.0
...
c4dd56075d
| Author | SHA1 | Date | |
|---|---|---|---|
| c4dd56075d | |||
| f1084c716a |
@@ -6,9 +6,10 @@
|
|||||||
xmlns:local="clr-namespace:Elwig.Windows"
|
xmlns:local="clr-namespace:Elwig.Windows"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
|
Loaded="Window_Loaded"
|
||||||
Title="Anlieferungsbestätingungen - Elwig" Height="400" Width="600">
|
Title="Anlieferungsbestätingungen - Elwig" Height="400" Width="600">
|
||||||
<Grid>
|
<Grid>
|
||||||
<GroupBox Header="Sortieren nach" Margin="10,10,10,10" Width="150" Height="80" VerticalAlignment="Top" HorizontalAlignment="Left">
|
<GroupBox Header="Sortieren nach" Margin="10,10,10,10" Width="180" Height="80" VerticalAlignment="Top" HorizontalAlignment="Left">
|
||||||
<StackPanel Margin="5,5,0,5">
|
<StackPanel Margin="5,5,0,5">
|
||||||
<RadioButton GroupName="Order" x:Name="OrderMgNrInput" Content="Mitgliedsnummer" IsChecked="True"/>
|
<RadioButton GroupName="Order" x:Name="OrderMgNrInput" Content="Mitgliedsnummer" IsChecked="True"/>
|
||||||
<RadioButton GroupName="Order" x:Name="OrderNameInput" Content="Name"/>
|
<RadioButton GroupName="Order" x:Name="OrderNameInput" Content="Name"/>
|
||||||
@@ -16,16 +17,20 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<TextBox x:Name="TextElement" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" AcceptsReturn="True"
|
<CheckBox x:Name="AllMembersInput" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,100,10,10">
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="170,10,10,10" Height="Auto"/>
|
<TextBlock>Auch Mitglieder ohne<LineBreak/>Lieferungen miteinbeziehen</TextBlock>
|
||||||
|
</CheckBox>
|
||||||
|
|
||||||
<Button x:Name="TestButton" Content="Stichprobe" FontSize="14" Width="150" Margin="10,10,10,74" Height="27"
|
<TextBox x:Name="TextElement" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" AcceptsReturn="True"
|
||||||
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="200,10,10,10" Height="Auto"/>
|
||||||
|
|
||||||
|
<Button x:Name="TestButton" Content="Stichprobe" FontSize="14" Width="150" Margin="10,10,10,74" Height="27" Tag="Print" IsEnabled="False"
|
||||||
Click="TestButton_Click"
|
Click="TestButton_Click"
|
||||||
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
||||||
<Button x:Name="ShowButton" Content="Vorschau" FontSize="14" Width="150" Margin="10,10,10,42" Height="27"
|
<Button x:Name="ShowButton" Content="Vorschau" FontSize="14" Width="150" Margin="10,10,10,42" Height="27" Tag="Print" IsEnabled="False"
|
||||||
Click="ShowButton_Click"
|
Click="ShowButton_Click"
|
||||||
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
||||||
<Button x:Name="PrintButton" Content="Drucken" FontSize="14" Width="150" Margin="10,10,10,10" Height="27"
|
<Button x:Name="PrintButton" Content="Drucken" FontSize="14" Width="150" Margin="10,10,10,10" Height="27" Tag="Print" IsEnabled="False"
|
||||||
Click="PrintButton_Click"
|
Click="PrintButton_Click"
|
||||||
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ namespace Elwig.Dialogs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs evt) {
|
||||||
|
TestButton.IsEnabled = App.IsPrintingReady;
|
||||||
|
ShowButton.IsEnabled = App.IsPrintingReady;
|
||||||
|
PrintButton.IsEnabled = App.IsPrintingReady;
|
||||||
|
}
|
||||||
|
|
||||||
protected override async Task OnRenewContext() { }
|
protected override async Task OnRenewContext() { }
|
||||||
|
|
||||||
private async Task UpdateTextParameter() {
|
private async Task UpdateTextParameter() {
|
||||||
@@ -40,13 +46,19 @@ namespace Elwig.Dialogs {
|
|||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
await UpdateTextParameter();
|
await UpdateTextParameter();
|
||||||
|
|
||||||
var members = Context.Members.FromSqlRaw($"""
|
IQueryable<Member> members;
|
||||||
|
if (AllMembersInput.IsChecked == true) {
|
||||||
|
members = Context.Members.Where(m => m.IsActive);
|
||||||
|
} else {
|
||||||
|
members = Context.Members.FromSqlRaw($"""
|
||||||
SELECT m.*
|
SELECT m.*
|
||||||
FROM member m
|
FROM member m
|
||||||
INNER JOIN delivery d ON d.mgnr = m.mgnr
|
INNER JOIN delivery d ON d.mgnr = m.mgnr
|
||||||
WHERE d.year = {Year}
|
WHERE d.year = {Year}
|
||||||
GROUP BY m.mgnr
|
GROUP BY m.mgnr
|
||||||
""");
|
""");
|
||||||
|
}
|
||||||
|
|
||||||
if (OrderMgNrInput.IsChecked == true) {
|
if (OrderMgNrInput.IsChecked == true) {
|
||||||
members = members
|
members = members
|
||||||
.OrderBy(m => m.MgNr);
|
.OrderBy(m => m.MgNr);
|
||||||
|
|||||||
Reference in New Issue
Block a user