Added new Models and Razor Template
This commit is contained in:
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