Added new Models and Razor Template
This commit is contained in:
@ -1,18 +1,34 @@
|
||||
using System;
|
||||
using RazorLight;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using WGneu.Models;
|
||||
|
||||
namespace WGneu.Documents {
|
||||
class Template {
|
||||
|
||||
private static readonly string ROOT = @"C:\Users\Lorenz\Desktop\";
|
||||
private static readonly string ROOT = @"C:\Users\tom\Projects\wgneu\";
|
||||
|
||||
public static async void Test() {
|
||||
await Pdf.Convert(ROOT + "din-5008.html", ROOT + "test.pdf");
|
||||
Pdf.Display("Test-Dokument", ROOT + "test.pdf");
|
||||
}
|
||||
|
||||
public static async void Generate(WgContext c) {
|
||||
var engine = new RazorLightEngineBuilder()
|
||||
.UseFileSystemProject(@"C:\Users\tom\source\repos\wgneu-cs\WGneu\Documents")
|
||||
.UseMemoryCachingProvider()
|
||||
.Build();
|
||||
|
||||
var model = new TestTemplateModel(c);
|
||||
|
||||
string result = await engine.CompileRenderAsync("TestTemplate.cshtml", model);
|
||||
|
||||
await File.WriteAllTextAsync(ROOT + "razor_test.html", result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Documents {
|
||||
internal class TestTemplate {
|
||||
}
|
||||
}
|
@ -1,9 +1,249 @@
|
||||
<!DOCTYPE html>
|
||||
@using RazorLight
|
||||
@inherits TemplatePage<WGneu.Documents.TestTemplateModel>
|
||||
@model IQueryable<WGneu.Documents.TestTemplateModel>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de-AT">
|
||||
<head>
|
||||
<title>Test Document</title>
|
||||
<title>%SUBJECT%</title>
|
||||
<!-- TODO store paged.js locally to avoid using the internet -->
|
||||
<script>
|
||||
window.finished = false;
|
||||
window.PagedConfig = {auto: navigator.webdriver, after: () => { window.finished = true; }};
|
||||
if (!navigator.webdriver) window.addEventListener("beforeprint", () => { window.PagedPolyfill.preview(); });
|
||||
</script>
|
||||
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
font-family: "Times New Roman", serif;
|
||||
line-height: 1;
|
||||
}
|
||||
* {box-sizing: border-box;}
|
||||
body {margin: 0;}
|
||||
.m1, .m2, .m3 {
|
||||
height: 0;
|
||||
width: 1cm;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
border-top: 1pt solid black;
|
||||
}
|
||||
.m1 {top: 105mm;}
|
||||
.m2 {top: 148.5mm;}
|
||||
.m3 {top: 210mm;}
|
||||
header {
|
||||
height: 45mm;
|
||||
padding: 5mm;
|
||||
position: absolute;
|
||||
top: -25mm;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
}
|
||||
.spacing {height: 20mm;}
|
||||
.info-wrapper {
|
||||
width: 100%;
|
||||
height:45mm;
|
||||
margin: 0 0 8.46mm 0;
|
||||
position: relative;
|
||||
}
|
||||
.address-wrapper {
|
||||
height: 45mm;
|
||||
width: 85mm;
|
||||
margin: 0;
|
||||
padding: 5mm;
|
||||
position: absolute;
|
||||
left: 20mm;
|
||||
top: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.address-wrapper .sender {
|
||||
flex: 17.7mm 1 1;
|
||||
font-size: 8pt;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
padding-bottom: 2mm;
|
||||
}
|
||||
|
||||
address {
|
||||
flex: 27.3mm 1 1;
|
||||
white-space: pre-line;
|
||||
font-size: 12pt;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
aside {
|
||||
height: 40mm;
|
||||
width: 75mm;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
left: 125mm;
|
||||
top: 5mm;
|
||||
}
|
||||
main {
|
||||
margin: 8.46mm 20mm 4.23mm 25mm;
|
||||
}
|
||||
main :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
main h1, main p {
|
||||
font-size: 12pt;
|
||||
margin: 1em 0;
|
||||
text-align: justify;
|
||||
widows: 3;
|
||||
orphans: 3;
|
||||
}
|
||||
main .date {
|
||||
margin-bottom: 2em;
|
||||
text-align: right;
|
||||
}
|
||||
main h1 {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
.footer-wrapper {
|
||||
padding: 0 20mm 0 25mm;
|
||||
position: running(page-footer);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.pre-footer {
|
||||
margin: 4.23mm 0;
|
||||
font-size: 10pt;
|
||||
display: flex;
|
||||
}
|
||||
.pre-footer .date, .pre-footer .page {
|
||||
flex: 100px 1 1;
|
||||
}
|
||||
.pre-footer .date {text-align: left;}
|
||||
.pre-footer .page {text-align: right;}
|
||||
.page::after {
|
||||
content: "Seite 1 von 1";
|
||||
}
|
||||
footer {
|
||||
font-size: 10pt;
|
||||
border-top: 1pt solid black;
|
||||
height: 25mm;
|
||||
padding-top: 1mm;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@page {
|
||||
size: A4;
|
||||
margin: 25mm 0 35mm 0;
|
||||
@@bottom-center {
|
||||
content: element(page-footer);
|
||||
}
|
||||
}
|
||||
@@media screen {
|
||||
body, header, .footer-wrapper {
|
||||
width: 210mm;
|
||||
}
|
||||
header, .address-wrapper, aside, main {
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
.m1, .m2, .m3 {display: none;}
|
||||
header {top: 0;}
|
||||
.spacing {height: 45mm;}
|
||||
.main-wrapper {
|
||||
margin-bottom: 40mm;
|
||||
}
|
||||
.footer-wrapper {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: white;
|
||||
}
|
||||
}
|
||||
@@media print {
|
||||
.page::after {
|
||||
content: "Seite " counter(page) " von " counter(pages);
|
||||
}
|
||||
.footer-wrapper {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test Document</h1>
|
||||
<div class="m1"></div>
|
||||
<div class="m2"></div>
|
||||
<div class="m3"></div>
|
||||
<header>
|
||||
<h1>Winzergenossenschaft Matzen</h1>
|
||||
</header>
|
||||
<div class="footer-wrapper">
|
||||
<div class="pre-footer">
|
||||
<span class="date">Samstag, 4. März 2023</span>
|
||||
<span class="page"></span>
|
||||
</div>
|
||||
<footer>
|
||||
Winzergenossenschaft für Matzen und Umgebung reg. Gen.m.b.H.
|
||||
</footer>
|
||||
</div>
|
||||
<div class="spacing"></div>
|
||||
<div class="main-wrapper">
|
||||
<div class="info-wrapper">
|
||||
<div class="address-wrapper">
|
||||
<div class="sender">
|
||||
<div>WG Matzen | Schloßstraße 6 | 2243 Matzen</div>
|
||||
<div>E Österreichische Post AG Eco Brief</div>
|
||||
</div>
|
||||
<address>Maximilian Mustermann
|
||||
Musterstraße 123
|
||||
2222 Musterort
|
||||
Österreich</address>
|
||||
</div>
|
||||
<aside></aside>
|
||||
</div>
|
||||
<main>
|
||||
<div class="date">Matzen, am 04.03.2023</div>
|
||||
<h1>%SUBJECT%</h1>
|
||||
<p>Sehr geehrtes Mitglied,</p>
|
||||
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
<p>Ich bin ein langer Paragraph.</p>
|
||||
|
||||
@foreach (var country in Model.Countries) {
|
||||
<h1>Land:</h1>
|
||||
<p>@Raw(country.Name)</p>
|
||||
<p>@country.Alpha2</p>
|
||||
<p>@country.Alpha3</p>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
Mit freundlichen Grüßen<br/>
|
||||
Ihre Winzergenossenschaft Matzen
|
||||
</p>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
19
WGneu/Documents/TestTemplateModel.cshtml.cs
Normal file
19
WGneu/Documents/TestTemplateModel.cshtml.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WGneu.Models;
|
||||
|
||||
namespace WGneu.Documents {
|
||||
public class TestTemplateModel {
|
||||
|
||||
public IQueryable<Country> Countries { get; set; }
|
||||
|
||||
public TestTemplateModel(WgContext c) {
|
||||
Countries = c.Countries;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
51
WGneu/Models/AreaCommit.cs
Normal file
51
WGneu/Models/AreaCommit.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("area_commitment"), PrimaryKey("Vnr", "KgNr", "GstNr")]
|
||||
public class AreaCommit {
|
||||
[Column("vnr")]
|
||||
public int Vnr { get; set; }
|
||||
|
||||
[Column("kgnr")]
|
||||
public int KgNr { get; set; }
|
||||
|
||||
[Column("gstnr")]
|
||||
public String? GstNr { get; set; }
|
||||
|
||||
[Column("rdnr")]
|
||||
public int RdNr { get; set; }
|
||||
|
||||
[Column("area")]
|
||||
public int Area { get; set; }
|
||||
|
||||
[Column("sortid")]
|
||||
public String SortId { get; set; }
|
||||
|
||||
[Column("attrid")]
|
||||
public String? AttrId { get; set; }
|
||||
|
||||
[Column("cultid")]
|
||||
public String CultId { get; set; }
|
||||
|
||||
[ForeignKey("Vnr")]
|
||||
public virtual Contract Contract { get; set; }
|
||||
|
||||
[ForeignKey("SortId")]
|
||||
public virtual WineVar WineVar { get; set; }
|
||||
|
||||
[ForeignKey("AttrId")]
|
||||
public virtual WineAttr WineAttr { get; set; }
|
||||
|
||||
[ForeignKey("CultId")]
|
||||
public virtual WineCult WineCult { get; set; }
|
||||
|
||||
[ForeignKey("KgNr, RdNr")]
|
||||
public virtual WbRd WbRd { get; set; }
|
||||
}
|
||||
}
|
27
WGneu/Models/Contract.cs
Normal file
27
WGneu/Models/Contract.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("contract"), PrimaryKey("Vnr")]
|
||||
public class Contract {
|
||||
[Column("vnr")]
|
||||
public int Vnr { get; set; }
|
||||
|
||||
[Column("mgnr")]
|
||||
public int MgNr { get; set; }
|
||||
|
||||
[Column("year_from")]
|
||||
public int YearFrom { get; set; }
|
||||
|
||||
[Column("year_to")]
|
||||
public int? YearTo { get; set; }
|
||||
|
||||
[ForeignKey("MgNr")]
|
||||
public virtual Member Member { get; set; }
|
||||
}
|
||||
}
|
24
WGneu/Models/WbRd.cs
Normal file
24
WGneu/Models/WbRd.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("wb_rd"), PrimaryKey("KgNr", "RdNr")]
|
||||
public class WbRd {
|
||||
[Column("kgnr")]
|
||||
public int KgNr { get; set; }
|
||||
|
||||
[Column("rdnr")]
|
||||
public int RdNr { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
|
||||
[ForeignKey("KgNr")]
|
||||
public virtual WbKg WbKg { get; set; }
|
||||
}
|
||||
}
|
21
WGneu/Models/WineAttr.cs
Normal file
21
WGneu/Models/WineAttr.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("wine_attribute"), PrimaryKey("AttrId")]
|
||||
public class WineAttr {
|
||||
[Column("attrid")]
|
||||
public String AttrId { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
|
||||
[Column("kg_per_ha")]
|
||||
public int KgPerHa { get; set; }
|
||||
}
|
||||
}
|
18
WGneu/Models/WineCult.cs
Normal file
18
WGneu/Models/WineCult.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("wine_cultivation"), PrimaryKey("CultId")]
|
||||
public class WineCult {
|
||||
[Column("cultid")]
|
||||
public String CultId { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
}
|
||||
}
|
27
WGneu/Models/WineQual.cs
Normal file
27
WGneu/Models/WineQual.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("wine_quality"), PrimaryKey("QualId")]
|
||||
public class WineQual {
|
||||
[Column("qualid")]
|
||||
public String QualId { get; set; }
|
||||
|
||||
[Column("origin_level")]
|
||||
public int OriginLevel { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
|
||||
[Column("from_kmw")]
|
||||
public double? FromKmw { get; set; }
|
||||
|
||||
[Column("to_kmw")]
|
||||
public double? ToKmw { get; set; }
|
||||
}
|
||||
}
|
24
WGneu/Models/WineVar.cs
Normal file
24
WGneu/Models/WineVar.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("wine_variety"), PrimaryKey("SortId")]
|
||||
public class WineVar {
|
||||
[Column("sortid")]
|
||||
public String SortId { get; set; }
|
||||
|
||||
[Column("type")]
|
||||
public String Type { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
|
||||
[Column("comment")]
|
||||
public String? Comment { get; set; }
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -16,6 +17,7 @@
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1587.40" />
|
||||
<PackageReference Include="ModernWpfUI" Version="0.9.6" />
|
||||
<PackageReference Include="PuppeteerSharp" Version="9.0.2" />
|
||||
<PackageReference Include="RazorLight" Version="2.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -17,9 +17,18 @@ namespace WGneu {
|
||||
public DbSet<PostalDest> PostalDestinations { get; set; }
|
||||
public DbSet<Branch> Branches { get; set; }
|
||||
public DbSet<WbKg> WbKgs { get; set; }
|
||||
public DbSet<WbRd> WbRde { get; set; }
|
||||
public DbSet<AreaCommit> AreaCommitments { get; set; }
|
||||
public DbSet<Contract> Contracts { get; set; }
|
||||
public DbSet<WineAttr> WineAttributes { get; set; }
|
||||
public DbSet<WineCult> WineCultivations { get; set; }
|
||||
public DbSet<WineQual> WineQualities { get; set; }
|
||||
public DbSet<WineVar> WineVarieties { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
|
||||
optionsBuilder.UseSqlite("Data Source=\"C:\\Users\\lorenz\\Desktop\\wgtest.sqlite3\"; foreign keys=true");
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSqlite("Data Source=\"C:\\Users\\tom\\Projects\\wgneu\\wgtest.sqlite3\"; foreign keys=true");
|
||||
optionsBuilder.UseLazyLoadingProxies();
|
||||
}
|
||||
}
|
||||
|
21
WGneu/Windows/AreaCommitmentListWindow.xaml
Normal file
21
WGneu/Windows/AreaCommitmentListWindow.xaml
Normal file
@ -0,0 +1,21 @@
|
||||
<Window x:Class="WGneu.Windows.AreaCommitmentListWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WGneu.Windows"
|
||||
mc:Ignorable="d"
|
||||
Title="Flächenbindungen" Height="450" Width="800">
|
||||
<Grid>
|
||||
<DataGrid x:Name="ContractList" AutoGenerateColumns="False" HeadersVisibility="Column" IsReadOnly="True" GridLinesVisibility="None" SelectionMode="Single"
|
||||
CanUserDeleteRows="False" CanUserResizeRows="False" CanUserAddRows="False" SelectionChanged="ContractList_SelectionChanged">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Vnr." Binding="{Binding Vnr}" Width="50"/>
|
||||
<DataGridTextColumn Header="MgNr." Binding="{Binding MgNr}" Width="50"/>
|
||||
<DataGridTextColumn Header="From" Binding="{Binding YearFrom}" Width="50"/>
|
||||
<DataGridTextColumn Header="To" Binding="{Binding YearTo}" Width="*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
42
WGneu/Windows/AreaCommitmentListWindow.xaml.cs
Normal file
42
WGneu/Windows/AreaCommitmentListWindow.xaml.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using WGneu.Models;
|
||||
|
||||
namespace WGneu.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for AreaCommitmentListWindow.xaml
|
||||
/// </summary>
|
||||
public partial class AreaCommitmentListWindow : Window {
|
||||
private readonly WgContext Context = new();
|
||||
|
||||
public AreaCommitmentListWindow(Member member) {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void RefreshContractList() {
|
||||
Context.Members.Load();
|
||||
List<Contract> contracts = Context.Contracts.OrderBy(c => c.MgNr).ToList();
|
||||
|
||||
ContractList.ItemsSource = contracts;
|
||||
if (contracts.Count == 1)
|
||||
ContractList.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void ContractList_SelectionChanged(object sender, SelectionChangedEventArgs e) {
|
||||
RefreshContractList();
|
||||
}
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
xmlns:local="clr-namespace:WGneu.Windows"
|
||||
mc:Ignorable="d"
|
||||
Title="PDF Ansicht"
|
||||
MinHeight="600" MinWidth="420" Height="600" Width="420">
|
||||
MinHeight="600" MinWidth="420" Height="970" Width="670">
|
||||
<Grid>
|
||||
<wv2:WebView2 Name="WebView"/>
|
||||
</Grid>
|
||||
|
@ -19,5 +19,6 @@
|
||||
<ComboBox HorizontalAlignment="Left" Margin="175,149,0,0" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Source={StaticResource countryViewSource}}" ItemTemplate="{StaticResource asdf}" SelectionChanged="ComboBox_SelectionChanged" IsEditable="True"/>
|
||||
<Button x:Name="Button2" Content="Mitglieder" Margin="472,182,178,0" VerticalAlignment="Top" Click="Button2_Click"/>
|
||||
<Button x:Name="Button3" Content="Print" Margin="425,255,225,0" VerticalAlignment="Top" Click="Button3_Click"/>
|
||||
<Button x:Name="Button4" Content="Generate" Margin="425,300,225,0" VerticalAlignment="Top" Click="Button4_Click"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@ -47,6 +47,10 @@ namespace WGneu.Windows {
|
||||
Documents.Template.Test();
|
||||
}
|
||||
|
||||
private void Button4_Click(object sender, EventArgs e) {
|
||||
Documents.Template.Generate(_context);
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e) {
|
||||
|
||||
}
|
||||
|
@ -287,6 +287,8 @@
|
||||
<RadioButton x:Name="ContactEmailInput" GroupName="DefaultContact" Content="E-Mail" IsEnabled="False"
|
||||
Checked="RadioButton_Changed" Unchecked="RadioButton_Changed"
|
||||
HorizontalAlignment="Left" Margin="60,225,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.ColumnSpan="2"/>
|
||||
<Button x:Name="AreaCommitmentButton" Content="Flächenbindungen" Click="AreaCommitmentButton_Click"
|
||||
HorizontalAlignment="Left" Margin="10,245,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
@ -256,6 +256,11 @@ namespace WGneu.Windows {
|
||||
UnlockSearchInputs();
|
||||
}
|
||||
|
||||
private void AreaCommitmentButton_Click(object sender, RoutedEventArgs e) {
|
||||
var w = new AreaCommitmentListWindow((Member) MemberList.SelectedItem);
|
||||
w.Show();
|
||||
}
|
||||
|
||||
private void SearchInput_TextChanged(object sender, RoutedEventArgs e) {
|
||||
TextFilter = SearchInput.Text.ToLower().Split(" ").ToList().FindAll(s => s != "");
|
||||
RefreshMemberList();
|
||||
|
Reference in New Issue
Block a user