45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.Intrinsics.X86;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using Elwig.Documents;
|
|
using Elwig.Helpers;
|
|
|
|
namespace Elwig.Windows {
|
|
public partial class MainWindow : Window {
|
|
private readonly AppDbContext Context = new();
|
|
|
|
public MainWindow() {
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Window_Loaded(object sender, RoutedEventArgs evt) {
|
|
Context.Countries.Load();
|
|
Button4.IsEnabled = App.IsPrintingReady;
|
|
}
|
|
|
|
protected override void OnClosing(CancelEventArgs evt) {
|
|
Context.Dispose();
|
|
base.OnClosing(evt);
|
|
}
|
|
|
|
private void Button2_Click(object sender, RoutedEventArgs evt) {
|
|
var w = new MemberListWindow();
|
|
w.Show();
|
|
}
|
|
|
|
private void Button4_Click(object sender, RoutedEventArgs evt) {
|
|
Utils.RunBackground("PDF Generation", async () => {
|
|
using var letter = new BusinessLetter("Test Dokument", Context.Members.First());
|
|
await letter.Generate();
|
|
letter.Show();
|
|
});
|
|
}
|
|
}
|
|
}
|