Helpers/Export: Add Dto file export

This commit is contained in:
2023-11-13 00:22:21 +01:00
parent 2cdde60644
commit db8a449785
5 changed files with 233 additions and 21 deletions

View File

@ -18,6 +18,8 @@
<TextBlock x:Name="Output" Height="20" Width="200" Margin="470,329,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Button x:Name="ChartButton" Content="Chart" Click="ChartButton_Click"
Margin="50,240,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<Button x:Name="ZipButton" Content="ZIP-File" Click="ZipButton_Click"
Margin="50,270,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<Button x:Name="PdfDeliveryButton" Content="Lieferschein Erzeugen" Click="PdfDeliveryButton_Click" Tag="Print" IsEnabled="False"
Margin="260,190,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/>

View File

@ -1,8 +1,12 @@
using Elwig.Documents;
using Elwig.Helpers;
using Elwig.Helpers.Billing;
using Elwig.Helpers.Export;
using Elwig.Models.Dtos;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Input;
@ -51,6 +55,12 @@ namespace Elwig.Windows {
w.Show();
}
private async void ZipButton_Click(object sender, RoutedEventArgs evt) {
using var ctx = new AppDbContext();
using var ods = new OdsFile(@"C:\Users\Lorenz\Desktop\test.ods");
await ods.AddTable(await DeliveryConfirmationData.ForMember(ctx.DeliveryParts, 2023, 2948));
}
private async void PdfDeliveryButton_Click(object sender, RoutedEventArgs evt) {
Mouse.OverrideCursor = Cursors.AppStarting;
using var ctx = new AppDbContext();