Added new Models and Razor Template
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user