WIP Member List
This commit is contained in:
20
WGneu/Models/AT_Gem.cs
Normal file
20
WGneu/Models/AT_Gem.cs
Normal file
@ -0,0 +1,20 @@
|
||||
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("AT_gem"), PrimaryKey("Gkz")]
|
||||
public class AT_Gem
|
||||
{
|
||||
[Column("gkz")]
|
||||
public int Gkz { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
}
|
||||
}
|
26
WGneu/Models/AT_Kg.cs
Normal file
26
WGneu/Models/AT_Kg.cs
Normal file
@ -0,0 +1,26 @@
|
||||
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("AT_kg"), PrimaryKey("KgNr")]
|
||||
public class AT_Kg
|
||||
{
|
||||
[Column("kgnr")]
|
||||
public int KgNr { get; set; }
|
||||
|
||||
[Column("gkz")]
|
||||
public int Gkz { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
|
||||
[ForeignKey("Gkz")]
|
||||
public virtual AT_Gem Gem { get; set; }
|
||||
}
|
||||
}
|
32
WGneu/Models/AT_Ort.cs
Normal file
32
WGneu/Models/AT_Ort.cs
Normal file
@ -0,0 +1,32 @@
|
||||
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("AT_ort"), PrimaryKey("Okz")]
|
||||
public class AT_Ort
|
||||
{
|
||||
[Column("okz")]
|
||||
public int Okz { get; set; }
|
||||
|
||||
[Column("gkz")]
|
||||
public int Gkz { get; set; }
|
||||
|
||||
[Column("kgnr")]
|
||||
public int KgNr { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public String Name { get; set; }
|
||||
|
||||
[ForeignKey("Gkz")]
|
||||
public virtual AT_Gem Gem { get; set; }
|
||||
|
||||
[ForeignKey("KgNr")]
|
||||
public virtual AT_Kg Kg { get; set; }
|
||||
}
|
||||
}
|
41
WGneu/Models/AT_Plz.cs
Normal file
41
WGneu/Models/AT_Plz.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu.Models
|
||||
{
|
||||
[Table("AT_plz"), PrimaryKey("Plz", "Okz"), Index("Id", IsUnique = true)]
|
||||
public class AT_Plz
|
||||
{
|
||||
[Column("plz")]
|
||||
public int Plz { get; set; }
|
||||
|
||||
[Column("okz")]
|
||||
public int Okz { get; set; }
|
||||
|
||||
[Column("country")]
|
||||
public String CountryCode { get; }
|
||||
|
||||
[Column("id")]
|
||||
public String Id { get; }
|
||||
|
||||
[Column("dest")]
|
||||
public String Dest { get; set; }
|
||||
|
||||
[ForeignKey("Okz")]
|
||||
public virtual AT_Ort Ort { get; set; }
|
||||
|
||||
[ForeignKey("CountryCode")]
|
||||
public virtual Country Country { get; set; }
|
||||
|
||||
public ISet<AT_Ort> Orte(WGContext ctx)
|
||||
{
|
||||
return ctx.Postleitzahlen.Where(p => p.Plz == Plz).Select(p => p.Ort).ToHashSet();
|
||||
}
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu
|
||||
namespace WGneu.Models
|
||||
{
|
||||
[Table("country"), PrimaryKey("Alpha2")]
|
||||
public class Country
|
||||
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu
|
||||
namespace WGneu.Models
|
||||
{
|
||||
// 1 °KMW =
|
||||
// 1 °NM = kg/100L = 10g/L
|
||||
|
@ -6,7 +6,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WGneu
|
||||
namespace WGneu.Models
|
||||
{
|
||||
[Table("member"), PrimaryKey("MgNr")]
|
||||
public class Member
|
||||
@ -19,5 +19,29 @@ namespace WGneu
|
||||
|
||||
[Column("family_name")]
|
||||
public String FamilyName { get; set; }
|
||||
|
||||
[Column("zwstid")]
|
||||
public String Zweigstelle { get; set; }
|
||||
|
||||
[Column("country")]
|
||||
public String CountryCode { get; set; }
|
||||
|
||||
[Column("postal_dest")]
|
||||
public String PostalDestId { get; set; }
|
||||
|
||||
[Column("address")]
|
||||
public String Address { get; set; }
|
||||
|
||||
[Column("default_kgnr")]
|
||||
public int DefaultKgNr { get; set; }
|
||||
|
||||
[ForeignKey("CountryCode")]
|
||||
public virtual Country Country { get; set; }
|
||||
|
||||
[ForeignKey("CountryCode, PostalDestId")]
|
||||
public virtual PostalDest PostalDest { get; set; }
|
||||
|
||||
[ForeignKey("DefaultKgNr")]
|
||||
public virtual AT_Kg DefaultKg { get; set; }
|
||||
}
|
||||
}
|
||||
|
29
WGneu/Models/PostalDest.cs
Normal file
29
WGneu/Models/PostalDest.cs
Normal file
@ -0,0 +1,29 @@
|
||||
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("postal_dest"), PrimaryKey("CountryCode", "Id")]
|
||||
public class PostalDest
|
||||
{
|
||||
[Column("country")]
|
||||
public String CountryCode { get; set; }
|
||||
|
||||
[Column("id")]
|
||||
public String Id { get; set; }
|
||||
|
||||
[ForeignKey("CountryCode")]
|
||||
public virtual Country Country { get; set; }
|
||||
|
||||
public AT_Plz? Plz(WGContext ctx)
|
||||
{
|
||||
if (CountryCode != "AT") return null;
|
||||
return ctx.Postleitzahlen.Where(p => p.Id == Id).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user