Update Main Window
This commit is contained in:
@ -28,6 +28,10 @@
|
|||||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
|
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="elwig.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
<Exec Command="call fetch-resources.bat" />
|
<Exec Command="call fetch-resources.bat" />
|
||||||
</Target>
|
</Target>
|
||||||
|
@ -7,9 +7,35 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Elwig" Height="450" Width="800" ResizeMode="CanResize" SizeToContent="Manual"
|
Title="Elwig" Height="450" Width="800" ResizeMode="CanResize" SizeToContent="Manual"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded">
|
||||||
|
<Window.Resources>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="FontSize" Value="14"/>
|
||||||
|
<Setter Property="Padding" Value="9,3"/>
|
||||||
|
<Setter Property="Height" Value="27"/>
|
||||||
|
<Setter Property="Width" Value="200"/>
|
||||||
|
</Style>
|
||||||
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button x:Name="Button2" Content="Mitgliederverwaltung" Margin="472,182,178,0" VerticalAlignment="Top" Click="Button2_Click"/>
|
<Grid Height="100" VerticalAlignment="Top">
|
||||||
<Button x:Name="Button3" Content="Mitgliederliste" Margin="472,217,178,0" VerticalAlignment="Top" Click="Button3_Click"/>
|
<Grid.ColumnDefinitions>
|
||||||
<Button x:Name="Button4" Content="Generate" Margin="425,300,225,0" VerticalAlignment="Top" Click="Button4_Click" Tag="Print"/>
|
<ColumnDefinition Width="100"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="/elwig.png" RenderOptions.BitmapScalingMode="HighQuality" Grid.Column="0"
|
||||||
|
HorizontalAlignment="Left" Margin="5,5,5,5" VerticalAlignment="Top"/>
|
||||||
|
<Label Grid.Column="1" Content="Elwig" FontSize="32"
|
||||||
|
HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top"/>
|
||||||
|
<Label Grid.Column="1" Content="Elektonische Winzer-"
|
||||||
|
HorizontalAlignment="Left" Margin="0,55,0,0" VerticalAlignment="Top"/>
|
||||||
|
<Label Grid.Column="1" Content="genossenschaftsverwaltung"
|
||||||
|
HorizontalAlignment="Left" Margin="0,70,0,0" VerticalAlignment="Top"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Button x:Name="Button2" Content="Mitgliederverwaltung" Click="Button2_Click"
|
||||||
|
Margin="50,160,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
||||||
|
<Button x:Name="Button3" Content="Mitgliederliste" Click="Button3_Click"
|
||||||
|
Margin="50,200,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
||||||
|
<Button x:Name="Button4" Content="PDF Erzeugen" Click="Button4_Click" Tag="Print"
|
||||||
|
Margin="50,240,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
@ -6,7 +6,6 @@ using Elwig.Helpers;
|
|||||||
|
|
||||||
namespace Elwig.Windows {
|
namespace Elwig.Windows {
|
||||||
public partial class MainWindow : Window {
|
public partial class MainWindow : Window {
|
||||||
private readonly AppDbContext Context = new();
|
|
||||||
|
|
||||||
public MainWindow() {
|
public MainWindow() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -16,11 +15,6 @@ namespace Elwig.Windows {
|
|||||||
Button4.IsEnabled = App.IsPrintingReady;
|
Button4.IsEnabled = App.IsPrintingReady;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosing(CancelEventArgs evt) {
|
|
||||||
Context.Dispose();
|
|
||||||
base.OnClosing(evt);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button2_Click(object sender, RoutedEventArgs evt) {
|
private void Button2_Click(object sender, RoutedEventArgs evt) {
|
||||||
var w = new MemberAdminWindow();
|
var w = new MemberAdminWindow();
|
||||||
w.Show();
|
w.Show();
|
||||||
@ -33,7 +27,8 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
private void Button4_Click(object sender, RoutedEventArgs evt) {
|
private void Button4_Click(object sender, RoutedEventArgs evt) {
|
||||||
Utils.RunBackground("PDF Generation", async () => {
|
Utils.RunBackground("PDF Generation", async () => {
|
||||||
using var doc = new DeliveryNote(Context.Deliveries.OrderBy(d => d.Year).ThenBy(d => d.DId).Last());
|
using var ctx = new AppDbContext();
|
||||||
|
using var doc = new DeliveryNote(ctx.Deliveries.OrderBy(d => d.Parts.Count).ThenBy(d => d.Year).ThenBy(d => d.DId).Last());
|
||||||
await doc.Generate();
|
await doc.Generate();
|
||||||
doc.Show();
|
doc.Show();
|
||||||
});
|
});
|
||||||
|
BIN
Elwig/elwig.png
Normal file
BIN
Elwig/elwig.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Reference in New Issue
Block a user