Update models because contracts were removed
This commit is contained in:
@ -25,9 +25,7 @@ namespace Elwig.Helpers {
|
|||||||
public DbSet<WbKg> WbKgs { get; set; }
|
public DbSet<WbKg> WbKgs { get; set; }
|
||||||
public DbSet<WbRd> WbRde { get; set; }
|
public DbSet<WbRd> WbRde { get; set; }
|
||||||
public DbSet<AreaCom> AreaCommitments { get; set; }
|
public DbSet<AreaCom> AreaCommitments { get; set; }
|
||||||
public DbSet<AreaComParcel> AreaCommitmentParcels { get; set; }
|
|
||||||
public DbSet<AreaComAttr> AreaCommitmentAttributes { get; set; }
|
public DbSet<AreaComAttr> AreaCommitmentAttributes { get; set; }
|
||||||
public DbSet<Contract> Contracts { get; set; }
|
|
||||||
public DbSet<WineOrigin> WineOrigins { get; set; }
|
public DbSet<WineOrigin> WineOrigins { get; set; }
|
||||||
public DbSet<WineAttr> WineAttributes { get; set; }
|
public DbSet<WineAttr> WineAttributes { get; set; }
|
||||||
public DbSet<WineCult> WineCultivations { get; set; }
|
public DbSet<WineCult> WineCultivations { get; set; }
|
||||||
@ -75,8 +73,8 @@ namespace Elwig.Helpers {
|
|||||||
return await Members.FindAsync(mgnr) != null;
|
return await Members.FindAsync(mgnr) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> VNrExists(int vnr) {
|
public async Task<bool> FbNrExists(int fbnr) {
|
||||||
return await Contracts.FindAsync(vnr) != null;
|
return await AreaCommitments.FindAsync(fbnr) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> NextMgNr() {
|
public async Task<int> NextMgNr() {
|
||||||
@ -86,9 +84,9 @@ namespace Elwig.Helpers {
|
|||||||
return c + 1;
|
return c + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> NextVNr() {
|
public async Task<int> NextFbNr() {
|
||||||
int c = await Contracts.Select(co => co.VNr).MinAsync();
|
int c = await AreaCommitments.Select(ac => ac.FbNr).MinAsync();
|
||||||
(await Contracts.OrderBy(co => co.VNr).Select(co => co.VNr).ToListAsync())
|
(await AreaCommitments.OrderBy(ac => ac.FbNr).Select(ac => ac.FbNr).ToListAsync())
|
||||||
.ForEach(a => { if (a <= c + 100) c = a; });
|
.ForEach(a => { if (a <= c + 100) c = a; });
|
||||||
return c + 1;
|
return c + 1;
|
||||||
}
|
}
|
||||||
|
@ -411,7 +411,7 @@ namespace Elwig.Helpers {
|
|||||||
return new(true, null);
|
return new(true, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ValidationResult CheckVNr(TextBox input, bool required, AppDbContext ctx, Contract? c) {
|
public static ValidationResult CheckFbNr(TextBox input, bool required, AppDbContext ctx, AreaCom? c) {
|
||||||
var res = CheckInteger(input, required);
|
var res = CheckInteger(input, required);
|
||||||
if (!res.IsValid) {
|
if (!res.IsValid) {
|
||||||
return res;
|
return res;
|
||||||
@ -420,8 +420,8 @@ namespace Elwig.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nr = int.Parse(input.Text);
|
int nr = int.Parse(input.Text);
|
||||||
if (nr != c?.VNr && ctx.VNrExists(nr).GetAwaiter().GetResult()) {
|
if (nr != c?.FbNr && ctx.FbNrExists(nr).GetAwaiter().GetResult()) {
|
||||||
return new(false, "Vertragsnummer wird bereits verwendet");
|
return new(false, "Flächenbindungsnummer wird bereits verwendet");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new(true, null);
|
return new(true, null);
|
||||||
|
@ -4,13 +4,13 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Elwig.Models {
|
namespace Elwig.Models {
|
||||||
[Table("area_commitment"), PrimaryKey("VNr")]
|
[Table("area_commitment"), PrimaryKey("FbNr")]
|
||||||
public class AreaCom {
|
public class AreaCom {
|
||||||
[Column("vnr")]
|
[Column("fbnr")]
|
||||||
public int VNr { get; set; }
|
public int FbNr { get; set; }
|
||||||
|
|
||||||
[Column("area")]
|
[Column("mgnr")]
|
||||||
public int Area { get; set; }
|
public int MgNr { get; set; }
|
||||||
|
|
||||||
[Column("sortid")]
|
[Column("sortid")]
|
||||||
public string SortId { get; set; }
|
public string SortId { get; set; }
|
||||||
@ -18,8 +18,29 @@ namespace Elwig.Models {
|
|||||||
[Column("cultid")]
|
[Column("cultid")]
|
||||||
public string CultId { get; set; }
|
public string CultId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("VNr")]
|
[Column("area")]
|
||||||
public virtual Contract Contract { get; private set; }
|
public int Area { get; set; }
|
||||||
|
|
||||||
|
[Column("kgnr")]
|
||||||
|
public int KgNr { get; set; }
|
||||||
|
|
||||||
|
[Column("gstnr")]
|
||||||
|
public string GstNr { get; set; }
|
||||||
|
|
||||||
|
[Column("rdnr")]
|
||||||
|
public int RdNr { get; set; }
|
||||||
|
|
||||||
|
[Column("year_from")]
|
||||||
|
public int YearFrom { get; set; }
|
||||||
|
|
||||||
|
[Column("year_to")]
|
||||||
|
public int? YearTo { get; set; }
|
||||||
|
|
||||||
|
[Column("comment")]
|
||||||
|
public string? Comment { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("MgNr")]
|
||||||
|
public virtual Member Member { get; private set; }
|
||||||
|
|
||||||
[ForeignKey("SortId")]
|
[ForeignKey("SortId")]
|
||||||
public virtual WineVar WineVar { get; private set; }
|
public virtual WineVar WineVar { get; private set; }
|
||||||
@ -27,8 +48,11 @@ namespace Elwig.Models {
|
|||||||
[ForeignKey("CultId")]
|
[ForeignKey("CultId")]
|
||||||
public virtual WineCult WineCult { get; private set; }
|
public virtual WineCult WineCult { get; private set; }
|
||||||
|
|
||||||
[InverseProperty("AreaCom")]
|
[ForeignKey("KgNr")]
|
||||||
public virtual ISet<AreaComParcel> Parcels { get; private set; }
|
public virtual WbKg Kg { get; private set; }
|
||||||
|
|
||||||
|
[ForeignKey("KgNr, RdNr")]
|
||||||
|
public virtual WbRd? Rd { get; private set; }
|
||||||
|
|
||||||
[InverseProperty("AreaCom")]
|
[InverseProperty("AreaCom")]
|
||||||
public virtual ISet<AreaComAttr> AttributeEntries { get; private set; }
|
public virtual ISet<AreaComAttr> AttributeEntries { get; private set; }
|
||||||
|
@ -2,15 +2,15 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Elwig.Models {
|
namespace Elwig.Models {
|
||||||
[Table("area_commitment_attribute"), PrimaryKey("VNr", "AttrId")]
|
[Table("area_commitment_attribute"), PrimaryKey("FbNr", "AttrId")]
|
||||||
public class AreaComAttr {
|
public class AreaComAttr {
|
||||||
[Column("vnr")]
|
[Column("fbnr")]
|
||||||
public int VNr { get; set; }
|
public int FbNr { get; set; }
|
||||||
|
|
||||||
[Column("attrid")]
|
[Column("attrid")]
|
||||||
public string AttrId { get; set; }
|
public string AttrId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("VNr")]
|
[ForeignKey("FbNr")]
|
||||||
public virtual AreaCom AreaCom { get; private set; }
|
public virtual AreaCom AreaCom { get; private set; }
|
||||||
|
|
||||||
[ForeignKey("AttrId")]
|
[ForeignKey("AttrId")]
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace Elwig.Models {
|
|
||||||
[Table("area_commitment_parcel"), PrimaryKey("VNr", "KgNr", "GstNr")]
|
|
||||||
public class AreaComParcel {
|
|
||||||
[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; }
|
|
||||||
|
|
||||||
[ForeignKey("KgNr")]
|
|
||||||
public virtual WbKg Kg { get; private set; }
|
|
||||||
|
|
||||||
[ForeignKey("KgNr, RdNr")]
|
|
||||||
public virtual WbRd? Rd { get; private set; }
|
|
||||||
|
|
||||||
[ForeignKey("VNr")]
|
|
||||||
public virtual AreaCom AreaCom { get; private set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using System;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace Elwig.Models {
|
|
||||||
[Table("contract"), PrimaryKey("VNr")]
|
|
||||||
public class Contract {
|
|
||||||
[Column("vnr")]
|
|
||||||
public int VNr { get; set; }
|
|
||||||
|
|
||||||
[Column("mgnr")]
|
|
||||||
public int MgNr { get; set; }
|
|
||||||
|
|
||||||
[Column("date")]
|
|
||||||
public string? DateString { get; set; }
|
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public DateOnly? Date {
|
|
||||||
get {
|
|
||||||
return DateString != null ? DateOnly.ParseExact(DateString, "yyyy-MM-dd") : null;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
DateString = value?.ToString("yyyy-MM-dd");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Column("year_from")]
|
|
||||||
public int YearFrom { get; set; }
|
|
||||||
|
|
||||||
[Column("year_to")]
|
|
||||||
public int? YearTo { get; set; }
|
|
||||||
|
|
||||||
[Column("comment")]
|
|
||||||
public string? Comment { get; set; }
|
|
||||||
|
|
||||||
[ForeignKey("MgNr")]
|
|
||||||
public virtual Member Member { get; private set; }
|
|
||||||
|
|
||||||
[InverseProperty("Contract")]
|
|
||||||
public virtual AreaCom? AreaCom { get; private set; }
|
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public int? Area => AreaCom?.Area;
|
|
||||||
}
|
|
||||||
}
|
|
@ -162,10 +162,10 @@ namespace Elwig.Models {
|
|||||||
public virtual Branch? Branch { get; private set; }
|
public virtual Branch? Branch { get; private set; }
|
||||||
|
|
||||||
[InverseProperty("Member")]
|
[InverseProperty("Member")]
|
||||||
public virtual ISet<Contract> Contracts { get; private set; }
|
public virtual ISet<AreaCom> AreaCommitments { get; private set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public virtual IEnumerable<Contract> ActiveContracts => Contracts
|
public virtual IEnumerable<AreaCom> ActiveAreaCommitments => AreaCommitments
|
||||||
.Where(c => c.YearFrom <= Utils.CurrentSeason && (c.YearTo ?? int.MaxValue) >= Utils.CurrentSeason);
|
.Where(c => c.YearFrom <= Utils.CurrentSeason && (c.YearTo ?? int.MaxValue) >= Utils.CurrentSeason);
|
||||||
|
|
||||||
[InverseProperty("Member")]
|
[InverseProperty("Member")]
|
||||||
|
@ -18,7 +18,7 @@ namespace Elwig.Windows {
|
|||||||
public AreaComAdminWindow(Member member) {
|
public AreaComAdminWindow(Member member) {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.member = member;
|
this.member = member;
|
||||||
Title = $"Flächenbindungen - {member.FamilyName} {member.GivenName} - Elwig";
|
Title = $"Flächenbindungen - {member.AdministrativeName} - Elwig";
|
||||||
ExemptInputs = new Control[] {
|
ExemptInputs = new Control[] {
|
||||||
MgNrInput, ContractList, AreaCommitmentList, NewContractButton, DeleteContractButton,
|
MgNrInput, ContractList, AreaCommitmentList, NewContractButton, DeleteContractButton,
|
||||||
ContractSaveButton, ContractCancelButton, NewAreaCommitmentButton,
|
ContractSaveButton, ContractCancelButton, NewAreaCommitmentButton,
|
||||||
@ -40,8 +40,10 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshContractList() {
|
private async Task RefreshContractList() {
|
||||||
|
/*
|
||||||
await Context.Contracts.LoadAsync();
|
await Context.Contracts.LoadAsync();
|
||||||
await RefreshContractListQuery();
|
await RefreshContractListQuery();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshAreaCommitmentList() {
|
private async Task RefreshAreaCommitmentList() {
|
||||||
@ -50,6 +52,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshContractListQuery() {
|
private async Task RefreshContractListQuery() {
|
||||||
|
/*
|
||||||
List<Contract> contracts = await Context.Contracts.Where(c => c.MgNr == member.MgNr).ToListAsync();
|
List<Contract> contracts = await Context.Contracts.Where(c => c.MgNr == member.MgNr).ToListAsync();
|
||||||
|
|
||||||
ContractList.ItemsSource = contracts;
|
ContractList.ItemsSource = contracts;
|
||||||
@ -59,9 +62,11 @@ namespace Elwig.Windows {
|
|||||||
// TODO notwendig?
|
// TODO notwendig?
|
||||||
await RefreshAreaCommitmentList();
|
await RefreshAreaCommitmentList();
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshAreaCommitmentListQuery() {
|
private async Task RefreshAreaCommitmentListQuery() {
|
||||||
|
/*
|
||||||
Contract? contract = (Contract)ContractList.SelectedItem;
|
Contract? contract = (Contract)ContractList.SelectedItem;
|
||||||
|
|
||||||
if (contract == null) {
|
if (contract == null) {
|
||||||
@ -75,9 +80,11 @@ namespace Elwig.Windows {
|
|||||||
if (parcels.Count == 1)
|
if (parcels.Count == 1)
|
||||||
AreaCommitmentList.SelectedIndex = 0;
|
AreaCommitmentList.SelectedIndex = 0;
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshInputs(bool validate = false) {
|
private void RefreshInputs(bool validate = false) {
|
||||||
|
/*
|
||||||
ClearInputStates();
|
ClearInputStates();
|
||||||
Contract? c = (Contract)ContractList.SelectedItem;
|
Contract? c = (Contract)ContractList.SelectedItem;
|
||||||
AreaComParcel? a = (AreaComParcel)AreaCommitmentList.SelectedItem;
|
AreaComParcel? a = (AreaComParcel)AreaCommitmentList.SelectedItem;
|
||||||
@ -102,8 +109,10 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
if (!validate) ClearInputStates();
|
if (!validate) ClearInputStates();
|
||||||
GC.Collect();
|
GC.Collect();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private void FillInputs(AreaComParcel a) {
|
private void FillInputs(AreaComParcel a) {
|
||||||
ClearOriginalValues();
|
ClearOriginalValues();
|
||||||
|
|
||||||
@ -124,6 +133,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
FillOriginalValues();
|
FillOriginalValues();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private void NewAreaCommitmentButton_Click(object sender, RoutedEventArgs evt) {
|
private void NewAreaCommitmentButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
IsCreating = true;
|
IsCreating = true;
|
||||||
@ -155,6 +165,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async void DeleteAreaCommitmentButton_Click(object sender, RoutedEventArgs evt) {
|
private async void DeleteAreaCommitmentButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
/*
|
||||||
AreaComParcel a = (AreaComParcel)AreaCommitmentList.SelectedItem;
|
AreaComParcel a = (AreaComParcel)AreaCommitmentList.SelectedItem;
|
||||||
if (a == null) return;
|
if (a == null) return;
|
||||||
|
|
||||||
@ -166,6 +177,7 @@ namespace Elwig.Windows {
|
|||||||
Context.SaveChanges();
|
Context.SaveChanges();
|
||||||
await RefreshAreaCommitmentList();
|
await RefreshAreaCommitmentList();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NewContractButton_Click(object sender, RoutedEventArgs evt) {
|
private void NewContractButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
@ -182,6 +194,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async void DeleteContractButton_Click(object sender, RoutedEventArgs evt) {
|
private async void DeleteContractButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
/*
|
||||||
Contract c = (Contract)ContractList.SelectedItem;
|
Contract c = (Contract)ContractList.SelectedItem;
|
||||||
if (c == null) return;
|
if (c == null) return;
|
||||||
|
|
||||||
@ -193,8 +206,10 @@ namespace Elwig.Windows {
|
|||||||
Context.SaveChanges();
|
Context.SaveChanges();
|
||||||
await RefreshContractList();
|
await RefreshContractList();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private async Task<Contract> UpdateContract(Contract c) {
|
private async Task<Contract> UpdateContract(Contract c) {
|
||||||
int newVNr = int.Parse(VNrInput.Text);
|
int newVNr = int.Parse(VNrInput.Text);
|
||||||
c.MgNr = int.Parse(MgNrInput.Text);
|
c.MgNr = int.Parse(MgNrInput.Text);
|
||||||
@ -255,8 +270,10 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private async void AreaCommitmentSaveButton_Click(object sender, RoutedEventArgs evt) {
|
private async void AreaCommitmentSaveButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
/*
|
||||||
Contract c = await UpdateContract((Contract)ContractList.SelectedItem);
|
Contract c = await UpdateContract((Contract)ContractList.SelectedItem);
|
||||||
AreaComParcel a = await UpdateaAreaComParcel(IsEditing ? (AreaComParcel)AreaCommitmentList.SelectedItem : Context.CreateProxy<AreaComParcel>());
|
AreaComParcel a = await UpdateaAreaComParcel(IsEditing ? (AreaComParcel)AreaCommitmentList.SelectedItem : Context.CreateProxy<AreaComParcel>());
|
||||||
|
|
||||||
@ -272,6 +289,7 @@ namespace Elwig.Windows {
|
|||||||
await RefreshAreaCommitmentList();
|
await RefreshAreaCommitmentList();
|
||||||
ContractList.SelectedItem = c;
|
ContractList.SelectedItem = c;
|
||||||
AreaCommitmentList.SelectedItem = a;
|
AreaCommitmentList.SelectedItem = a;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AreaCommitmentResetButton_Click(object sender, RoutedEventArgs evt) {
|
private void AreaCommitmentResetButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
@ -297,6 +315,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async void ContractSaveButton_Click(object sender, RoutedEventArgs evt) {
|
private async void ContractSaveButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
/*
|
||||||
Contract c = await UpdateContract(Context.CreateProxy<Contract>());
|
Contract c = await UpdateContract(Context.CreateProxy<Contract>());
|
||||||
AreaComParcel a = await UpdateaAreaComParcel(Context.CreateProxy<AreaComParcel>());
|
AreaComParcel a = await UpdateaAreaComParcel(Context.CreateProxy<AreaComParcel>());
|
||||||
|
|
||||||
@ -312,6 +331,7 @@ namespace Elwig.Windows {
|
|||||||
await RefreshAreaCommitmentList();
|
await RefreshAreaCommitmentList();
|
||||||
ContractList.SelectedItem = c;
|
ContractList.SelectedItem = c;
|
||||||
AreaCommitmentList.SelectedItem = a;
|
AreaCommitmentList.SelectedItem = a;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ContractCancelButton_Click(object sender, RoutedEventArgs evt) {
|
private void ContractCancelButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
@ -336,10 +356,12 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async void InitInputs() {
|
private async void InitInputs() {
|
||||||
|
/*
|
||||||
VNrInput.Text = ContractList.SelectedItem == null ? (await Context.NextVNr()).ToString() : ((Contract)ContractList.SelectedItem).VNr.ToString();
|
VNrInput.Text = ContractList.SelectedItem == null ? (await Context.NextVNr()).ToString() : ((Contract)ContractList.SelectedItem).VNr.ToString();
|
||||||
MgNrInput.Text = member.MgNr.ToString();
|
MgNrInput.Text = member.MgNr.ToString();
|
||||||
FillOriginalValues();
|
FillOriginalValues();
|
||||||
ValidateRequiredInputs();
|
ValidateRequiredInputs();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnableContractNewDeleteButtons() {
|
private void EnableContractNewDeleteButtons() {
|
||||||
@ -439,6 +461,7 @@ namespace Elwig.Windows {
|
|||||||
ComboBox_SelectionChanged(sender, evt);
|
ComboBox_SelectionChanged(sender, evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
protected void InputTextChanged(TextBox input, Func<TextBox, bool, AppDbContext, Contract?, ValidationResult> checker) {
|
protected void InputTextChanged(TextBox input, Func<TextBox, bool, AppDbContext, Contract?, ValidationResult> checker) {
|
||||||
InputTextChanged(input, checker(input, SenderIsRequired(input), Context, (Contract)ContractList.SelectedItem));
|
InputTextChanged(input, checker(input, SenderIsRequired(input), Context, (Contract)ContractList.SelectedItem));
|
||||||
}
|
}
|
||||||
@ -446,17 +469,22 @@ namespace Elwig.Windows {
|
|||||||
protected void InputLostFocus(TextBox input, Func<TextBox, bool, AppDbContext, Contract?, ValidationResult> checker, string? msg = null) {
|
protected void InputLostFocus(TextBox input, Func<TextBox, bool, AppDbContext, Contract?, ValidationResult> checker, string? msg = null) {
|
||||||
InputLostFocus(input, checker(input, SenderIsRequired(input), Context, (Contract)ContractList.SelectedItem), msg);
|
InputLostFocus(input, checker(input, SenderIsRequired(input), Context, (Contract)ContractList.SelectedItem), msg);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private void NumericInput_TextChanged(object sender, RoutedEventArgs evt) {
|
private void NumericInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||||
InputTextChanged((TextBox)sender, Validator.CheckInteger);
|
InputTextChanged((TextBox)sender, Validator.CheckInteger);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
private void VNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||||
|
/*
|
||||||
InputTextChanged((TextBox)sender, Validator.CheckVNr);
|
InputTextChanged((TextBox)sender, Validator.CheckVNr);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VNrInput_LostFocus(object sender, RoutedEventArgs evt) {
|
private void VNrInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||||
|
/*
|
||||||
InputLostFocus((TextBox)sender, Validator.CheckVNr);
|
InputLostFocus((TextBox)sender, Validator.CheckVNr);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void YearFromInput_TextChanged(object sender, RoutedEventArgs evt) {
|
private void YearFromInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||||
|
@ -409,7 +409,7 @@ namespace Elwig.Windows {
|
|||||||
ContactPostalInput.IsChecked = m.ContactViaPost;
|
ContactPostalInput.IsChecked = m.ContactViaPost;
|
||||||
ContactEmailInput.IsChecked = m.ContactViaEmail;
|
ContactEmailInput.IsChecked = m.ContactViaEmail;
|
||||||
|
|
||||||
AreaCommitment.Text = $"{m.ActiveContracts.Select(c => c.Area).Sum():N0} m²";
|
AreaCommitment.Text = $"{m.ActiveAreaCommitments.Select(c => c.Area).Sum():N0} m²";
|
||||||
|
|
||||||
Menu_Member_SendEmail.IsEnabled = m.Email != null;
|
Menu_Member_SendEmail.IsEnabled = m.Email != null;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user