Update model
This commit is contained in:
@ -10,32 +10,33 @@ using Microsoft.Extensions.Logging;
|
|||||||
namespace Elwig.Helpers {
|
namespace Elwig.Helpers {
|
||||||
public class AppDbContext : DbContext {
|
public class AppDbContext : DbContext {
|
||||||
|
|
||||||
public DbSet<Country> Countries { get; set; }
|
public DbSet<Country> Countries { get; private set; }
|
||||||
public DbSet<Currency> Currencies { get; set; }
|
public DbSet<Currency> Currencies { get; private set; }
|
||||||
public DbSet<ClientParam> ClientParameters { get; set; }
|
public DbSet<AT_Gem> Gemeinden { get; private set; }
|
||||||
public DbSet<Member> Members { get; set; }
|
public DbSet<AT_Kg> Katastralgemeinden { get; private set; }
|
||||||
public DbSet<BillingAddr> BillingAddresses { get; set; }
|
public DbSet<AT_Ort> Orte { get; private set; }
|
||||||
public DbSet<AT_Gem> Gemeinden { get; set; }
|
public DbSet<AT_Plz> Postleitzahlen { get; private set; }
|
||||||
public DbSet<AT_Kg> Katastralgemeinden { get; set; }
|
public DbSet<AT_PlzDest> PlzDestinations { get; private set; }
|
||||||
public DbSet<AT_Ort> Orte { get; set; }
|
public DbSet<PostalDest> PostalDestinations { get; private set; }
|
||||||
public DbSet<AT_Plz> Postleitzahlen { get; set; }
|
public DbSet<WineOrigin> WineOrigins { get; private set; }
|
||||||
public DbSet<AT_PlzDest> PlzDestinations { get; set; }
|
public DbSet<WineQualLevel> WineQualityLevels { get; private set; }
|
||||||
public DbSet<PostalDest> PostalDestinations { get; set; }
|
public DbSet<WineVar> WineVarieties { get; private set; }
|
||||||
public DbSet<Branch> Branches { get; set; }
|
|
||||||
public DbSet<WbKg> WbKgs { get; set; }
|
public DbSet<ClientParam> ClientParameters { get; private set; }
|
||||||
public DbSet<WbRd> WbRde { get; set; }
|
public DbSet<WbKg> WbKgs { get; private set; }
|
||||||
public DbSet<AreaCom> AreaCommitments { get; set; }
|
public DbSet<WbRd> WbRde { get; private set; }
|
||||||
public DbSet<AreaComAttr> AreaCommitmentAttributes { get; set; }
|
public DbSet<WineAttr> WineAttributes { get; private set; }
|
||||||
public DbSet<WineOrigin> WineOrigins { get; set; }
|
public DbSet<WineCult> WineCultivations { get; private set; }
|
||||||
public DbSet<WineAttr> WineAttributes { get; set; }
|
public DbSet<Branch> Branches { get; private set; }
|
||||||
public DbSet<WineCult> WineCultivations { get; set; }
|
public DbSet<Member> Members { get; private set; }
|
||||||
public DbSet<WineQual> WineQualities { get; set; }
|
public DbSet<BillingAddr> BillingAddresses { get; private set; }
|
||||||
public DbSet<WineVar> WineVarieties { get; set; }
|
public DbSet<AreaCom> AreaCommitments { get; private set; }
|
||||||
public DbSet<Season> Seasons { get; set; }
|
public DbSet<AreaComAttr> AreaCommitmentAttributes { get; private set; }
|
||||||
public DbSet<Delivery> Deliveries { get; set; }
|
public DbSet<Season> Seasons { get; private set; }
|
||||||
public DbSet<DeliveryPart> DeliveryParts { get; set; }
|
public DbSet<Delivery> Deliveries { get; private set; }
|
||||||
public DbSet<DeliveryPartAttr> DeliveryPartAttributes { get; set; }
|
public DbSet<DeliveryPart> DeliveryParts { get; private set; }
|
||||||
public DbSet<DeliveryPartModifier> DeliveryPartModifiers { get; set; }
|
public DbSet<DeliveryPartAttr> DeliveryPartAttributes { get; private set; }
|
||||||
|
public DbSet<DeliveryPartModifier> DeliveryPartModifiers { get; private set; }
|
||||||
|
|
||||||
private readonly StreamWriter? LogFile = null;
|
private readonly StreamWriter? LogFile = null;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ namespace Elwig.Helpers {
|
|||||||
return new(false, "PLZ zu kurz");
|
return new(false, "PLZ zu kurz");
|
||||||
}
|
}
|
||||||
int plz = int.Parse(input.Text);
|
int plz = int.Parse(input.Text);
|
||||||
if (!ctx.Postleitzahlen.Any(p => p.Plz == plz)) {
|
if (ctx.Postleitzahlen.Find(plz) == null) {
|
||||||
return new(false, "Ungültige PLZ");
|
return new(false, "Ungültige PLZ");
|
||||||
}
|
}
|
||||||
return new(true, null);
|
return new(true, null);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Elwig.Models {
|
namespace Elwig.Models {
|
||||||
@ -9,5 +10,11 @@ namespace Elwig.Models {
|
|||||||
|
|
||||||
[Column("name")]
|
[Column("name")]
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
[InverseProperty("Gem")]
|
||||||
|
public virtual ISet<AT_Kg> Kgs { get; private set; }
|
||||||
|
|
||||||
|
[InverseProperty("AtGem")]
|
||||||
|
public virtual WbGem? WbGem { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,5 +15,8 @@ namespace Elwig.Models {
|
|||||||
|
|
||||||
[ForeignKey("Gkz")]
|
[ForeignKey("Gkz")]
|
||||||
public virtual AT_Gem Gem { get; private set; }
|
public virtual AT_Gem Gem { get; private set; }
|
||||||
|
|
||||||
|
[InverseProperty("AtKg")]
|
||||||
|
public virtual WbKg WbKg { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ namespace Elwig.Models {
|
|||||||
public string QualId { get; set; }
|
public string QualId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("QualId")]
|
[ForeignKey("QualId")]
|
||||||
public virtual WineQual Quality { get; private set; }
|
public virtual WineQualLevel Quality { get; private set; }
|
||||||
|
|
||||||
[Column("hkid")]
|
[Column("hkid")]
|
||||||
public string HkId { get; set; }
|
public string HkId { get; set; }
|
||||||
|
19
Elwig/Models/WbGem.cs
Normal file
19
Elwig/Models/WbGem.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace Elwig.Models {
|
||||||
|
[Table("wb_gem"), PrimaryKey("Gkz")]
|
||||||
|
public class WbGem {
|
||||||
|
[Column("gkz")]
|
||||||
|
public int Gkz { get; private set; }
|
||||||
|
|
||||||
|
[Column("hkid")]
|
||||||
|
public string HkId { get; private set; }
|
||||||
|
|
||||||
|
[ForeignKey("Gkz")]
|
||||||
|
public virtual AT_Gem AtGem { get; private set; }
|
||||||
|
|
||||||
|
[ForeignKey("HkId")]
|
||||||
|
public virtual WineOrigin Origin { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
17
Elwig/Models/WbGl.cs
Normal file
17
Elwig/Models/WbGl.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace Elwig.Models {
|
||||||
|
[Table("wb_gl"), PrimaryKey("GlNr")]
|
||||||
|
public class WbGl {
|
||||||
|
[Column("glnr")]
|
||||||
|
public int GlNr { get; private set; }
|
||||||
|
|
||||||
|
[Column("name")]
|
||||||
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
[InverseProperty("Gl")]
|
||||||
|
public virtual ISet<WbKg> Kgs { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Elwig.Models {
|
namespace Elwig.Models {
|
||||||
@ -11,6 +12,18 @@ namespace Elwig.Models {
|
|||||||
public int? GlNr { get; set; }
|
public int? GlNr { get; set; }
|
||||||
|
|
||||||
[ForeignKey("KgNr")]
|
[ForeignKey("KgNr")]
|
||||||
public virtual AT_Kg Kg { get; private set; }
|
public virtual AT_Kg AtKg { get; private set; }
|
||||||
|
|
||||||
|
[ForeignKey("GlNr")]
|
||||||
|
public virtual WbGl Gl { get; private set; }
|
||||||
|
|
||||||
|
[InverseProperty("Kg")]
|
||||||
|
public virtual ISet<WbRd> Rds { get; private set; }
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public WbGem Gem => AtKg.Gem.WbGem;
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public WineOrigin Origin => Gem.Origin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ namespace Elwig.Models {
|
|||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
[ForeignKey("KgNr")]
|
[ForeignKey("KgNr")]
|
||||||
public virtual WbKg WbKg { get; private set; }
|
public virtual WbKg Kg { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Elwig.Models {
|
namespace Elwig.Models {
|
||||||
@ -18,5 +19,8 @@ namespace Elwig.Models {
|
|||||||
|
|
||||||
[Column("blnr")]
|
[Column("blnr")]
|
||||||
public int? BlNr { get; private set; }
|
public int? BlNr { get; private set; }
|
||||||
|
|
||||||
|
[InverseProperty("Origin")]
|
||||||
|
public virtual ISet<WbGem> Gems { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
|
|
||||||
namespace Elwig.Models {
|
namespace Elwig.Models {
|
||||||
[Table("wine_quality"), PrimaryKey("QualId")]
|
[Table("wine_quality"), PrimaryKey("QualId")]
|
||||||
public class WineQual {
|
public class WineQualLevel {
|
||||||
[Column("qualid")]
|
[Column("qualid")]
|
||||||
public string QualId { get; private set; }
|
public string QualId { get; private set; }
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
private async void Window_Loaded(object sender, RoutedEventArgs e) {
|
private async void Window_Loaded(object sender, RoutedEventArgs e) {
|
||||||
await RefreshContractList();
|
await RefreshContractList();
|
||||||
KgInput.ItemsSource = Context.WbKgs.Select(k => k.Kg).OrderBy(k => k.Name).ToList();
|
KgInput.ItemsSource = Context.WbKgs.Select(k => k.AtKg).OrderBy(k => k.Name).ToList();
|
||||||
SortInput.ItemsSource = Context.WineVarieties.OrderBy(s => s.Name).ToList();
|
SortInput.ItemsSource = Context.WineVarieties.OrderBy(s => s.Name).ToList();
|
||||||
AttrInput.ItemsSource = Context.WineAttributes.OrderBy(a => a.Name).ToList();
|
AttrInput.ItemsSource = Context.WineAttributes.OrderBy(a => a.Name).ToList();
|
||||||
CultInput.ItemsSource = Context.WineCultivations.OrderBy(c => c.Name).ToList();
|
CultInput.ItemsSource = Context.WineCultivations.OrderBy(c => c.Name).ToList();
|
||||||
|
12
Elwig/Windows/ClientParamWindow.xaml
Normal file
12
Elwig/Windows/ClientParamWindow.xaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<local:AdministrationWindow x:Class="Elwig.Windows.ClientParamWindow"
|
||||||
|
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:Elwig.Windows"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="ClientParamWindow" Height="450" Width="800">
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</local:AdministrationWindow>
|
12
Elwig/Windows/ClientParamWindow.xaml.cs
Normal file
12
Elwig/Windows/ClientParamWindow.xaml.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
namespace Elwig.Windows {
|
||||||
|
public partial class ClientParamWindow : AdministrationWindow {
|
||||||
|
public ClientParamWindow() {
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void UpdateButtons() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -36,7 +36,7 @@ namespace Elwig.Windows {
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs evt) {
|
private void Window_Loaded(object sender, RoutedEventArgs evt) {
|
||||||
ActiveMemberInput.IsChecked = true;
|
ActiveMemberInput.IsChecked = true;
|
||||||
BranchInput.ItemsSource = Context.Branches.OrderBy(b => b.Name).ToList();
|
BranchInput.ItemsSource = Context.Branches.OrderBy(b => b.Name).ToList();
|
||||||
DefaultKgInput.ItemsSource = Context.WbKgs.Select(k => k.Kg).OrderBy(k => k.Name).ToList();
|
DefaultKgInput.ItemsSource = Context.WbKgs.Select(k => k.AtKg).OrderBy(k => k.Name).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshMemberList() {
|
private async Task RefreshMemberList() {
|
||||||
|
Reference in New Issue
Block a user