Rename solution directory to Elwig

This commit is contained in:
2023-03-18 11:04:22 +01:00
parent 649578e8bf
commit 769d80eb81
48 changed files with 7 additions and 11 deletions

13
Elwig/Models/AT_Gem.cs Normal file
View File

@ -0,0 +1,13 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("AT_gem"), PrimaryKey("Gkz")]
public class AT_Gem {
[Column("gkz")]
public int Gkz { get; private set; }
[Column("name")]
public string Name { get; private set; }
}
}

19
Elwig/Models/AT_Kg.cs Normal file
View File

@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("AT_kg"), PrimaryKey("KgNr")]
public class AT_Kg {
[Column("kgnr")]
public int KgNr { get; private set; }
[Column("gkz")]
public int Gkz { get; private set; }
[Column("name")]
public string Name { get; private set; }
[ForeignKey("Gkz")]
public virtual AT_Gem Gem { get; private set; }
}
}

25
Elwig/Models/AT_Ort.cs Normal file
View File

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("AT_ort"), PrimaryKey("Okz")]
public class AT_Ort {
[Column("okz")]
public int Okz { get; private set; }
[Column("gkz")]
public int Gkz { get; private set; }
[Column("kgnr")]
public int? KgNr { get; private set; }
[Column("name")]
public string Name { get; private set; }
[ForeignKey("Gkz")]
public virtual AT_Gem Gem { get; private set; }
[ForeignKey("KgNr")]
public virtual AT_Kg? Kg { get; private set; }
}
}

32
Elwig/Models/AT_Plz.cs Normal file
View File

@ -0,0 +1,32 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("AT_plz"), PrimaryKey("Plz")]
public class AT_Plz {
[Column("plz")]
public int Plz { get; private set; }
[Column("ort")]
public string Ort { get; private set; }
[Column("blnr")]
public int BlNr { get; private set; }
[Column("type")]
public string Type { get; private set; }
[Column("internal")]
public bool IsInternal { get; private set; }
[Column("addressable")]
public bool IsAddressable { get; private set; }
[Column("po_box")]
public bool IsPoBox { get; private set; }
[InverseProperty("AtPlz")]
public virtual ISet<AT_PlzDest> Orte { get; private set; }
}
}

View File

@ -0,0 +1,31 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("AT_plz_dest"), PrimaryKey("Id"), Index("Plz", "Okz", IsUnique = true)]
public class AT_PlzDest {
[Column("plz")]
public int Plz { get; private set; }
[Column("okz")]
public int Okz { get; private set; }
[Column("country")]
public string CountryCode { get; private set; }
[Column("id")]
public string Id { get; private set; }
[Column("dest")]
public string Dest { get; private set; }
[ForeignKey("Plz")]
public virtual AT_Plz AtPlz { get; private set; }
[ForeignKey("Okz")]
public virtual AT_Ort Ort { get; private set; }
[ForeignKey("CountryCode")]
public virtual Country Country { get; private set; }
}
}

View File

@ -0,0 +1,46 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("area_commitment"), PrimaryKey("VNr", "KgNr", "GstNr")]
public class AreaCommitment {
[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; }
[Column("sortid")]
public string SortId { get; set; }
[Column("attrid")]
public string? AttrId { get; set; }
[Column("cultid")]
public string CultId { get; set; }
[ForeignKey("VNr")]
public virtual Contract Contract { get; private set; }
[ForeignKey("SortId")]
public virtual WineVar WineVar { get; private set; }
[ForeignKey("AttrId")]
public virtual WineAttr WineAttr { get; private set; }
[ForeignKey("CultId")]
public virtual WineCult WineCult { get; private set; }
[ForeignKey("KgNr, RdNr")]
public virtual WbRd? WbRd { get; private set; }
}
}

17
Elwig/Models/Branch.cs Normal file
View File

@ -0,0 +1,17 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("branch"), PrimaryKey("ZwstId")]
public class Branch {
[Column("zwstid")]
public string ZwstId { get; set; }
[Column("name")]
public string Name { get; set; }
[InverseProperty("Branch")]
public virtual ISet<Member> Members { get; private set; }
}
}

30
Elwig/Models/Contract.cs Normal file
View File

@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
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("year_from")]
public int YearFrom { get; set; }
[Column("year_to")]
public int? YearTo { get; set; }
[ForeignKey("MgNr")]
public virtual Member Member { get; private set; }
[InverseProperty("Contract")]
public virtual ISet<AreaCommitment> AreaCommitments { get; private set; }
[NotMapped]
public int Area => AreaCommitments.Select(a => a.Area).Sum();
}
}

22
Elwig/Models/Country.cs Normal file
View File

@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("country"), PrimaryKey("Alpha2")]
public class Country {
[Column("alpha2")]
public string Alpha2 { get; private set; }
[Column("alpha3")]
public string Alpha3 { get; private set; }
[Column("num")]
public int Num { get; private set; }
[Column("name")]
public string Name { get; private set; }
[Column("is_visible")]
public bool IsVisible { get; private set; }
}
}

126
Elwig/Models/Member.cs Normal file
View File

@ -0,0 +1,126 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("member"), PrimaryKey("MgNr")]
public class Member {
[Column("mgnr")]
public int MgNr { get; set; }
[Column("predecessor_mgnr")]
public int? PredecessorMgNr { get; set; }
[Column("prefix")]
public string? Prefix { get; set; }
[Column("given_name")]
public string GivenName { get; set; }
[Column("middle_names")]
public string? MiddleName { get; set; }
[NotMapped]
public string[] MiddleNames {
get { return (MiddleName != null) ? MiddleName.Split(" ") : Array.Empty<string>(); }
set { MiddleName = (value.Length > 0) ? string.Join(" ", value) : null; }
}
[Column("family_name")]
public string FamilyName { get; set; }
[Column("suffix")]
public string? Suffix { get; set; }
[Column("birthday")]
public string? Birthday { get; set; }
[Column("entry_date")]
public string? EntryDate { get; set; }
[Column("exit_date")]
public string? ExitDate { get; set; }
[Column("business_shares")]
public int BusinessShares { get; set; }
[Column("accounting_nr")]
public string? AccountingNr { get; set; }
[Column("zwstid")]
public string? ZwstId { get; set; }
[Column("lfbis_nr")]
public string? LfbisNr { get; set; }
[Column("ustid")]
public string? UstId { get; set; }
[Column("volllieferant")]
public bool IsVollLieferant { get; set; }
[Column("buchführend")]
public bool IsBuchführend { get; set; }
[Column("funktionär")]
public bool IsFunktionär { get; set; }
[Column("active")]
public bool IsActive { get; set; }
[Column("iban")]
public string? Iban { get; set; }
[Column("bic")]
public string? Bic { 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("email")]
public string? Email { get; set; }
[Column("phone_landline")]
public string? PhoneLandline { get; set; }
[Column("phone_mobile_1")]
public string? PhoneMobile1 { get; set; }
[Column("phone_mobile_2")]
public string? PhoneMobile2 { get; set; }
[Column("default_kgnr")]
public int? DefaultKgNr { get; set; }
[Column("default_contact")]
public string DefaultContact { get; set; }
[Column("comment")]
public string? Comment { get; set; }
[ForeignKey("PredecessorMgNr")]
public virtual Member? Predecessor { get; private set; }
[ForeignKey("CountryCode")]
public virtual Country Country { get; private set; }
[ForeignKey("CountryCode, PostalDestId")]
public virtual PostalDest PostalDest { get; private set; }
[ForeignKey("DefaultKgNr")]
public virtual AT_Kg? DefaultKg { get; private set; }
[ForeignKey("ZwstId")]
public virtual Branch? Branch { get; private set; }
[InverseProperty("Member")]
public virtual ISet<Contract> Contracts { get; private set; }
}
}

View File

@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("postal_dest"), PrimaryKey("CountryCode", "Id")]
public class PostalDest {
[Column("country")]
public string CountryCode { get; private set; }
[Column("id")]
public string Id { get; private set; }
[ForeignKey("CountryCode")]
public virtual Country Country { get; private set; }
[ForeignKey("Id")]
public virtual AT_PlzDest? AtPlz { get; private set; }
}
}

16
Elwig/Models/WbKg.cs Normal file
View File

@ -0,0 +1,16 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("wb_kg"), PrimaryKey("KgNr")]
public class WbKg {
[Column("kgnr")]
public int KgNr { get; set; }
[Column("glnr")]
public int? GlNr { get; set; }
[ForeignKey("KgNr")]
public virtual AT_Kg Kg { get; private set; }
}
}

19
Elwig/Models/WbRd.cs Normal file
View File

@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("wb_rd"), PrimaryKey("KgNr", "RdNr")]
public class WbRd {
[Column("kgnr")]
public int KgNr { get; set; }
[Column("rdnr")]
public int RdNr { get; set; }
[Column("name")]
public string Name { get; set; }
[ForeignKey("KgNr")]
public virtual WbKg WbKg { get; private set; }
}
}

16
Elwig/Models/WineAttr.cs Normal file
View File

@ -0,0 +1,16 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("wine_attribute"), PrimaryKey("AttrId")]
public class WineAttr {
[Column("attrid")]
public string AttrId { get; set; }
[Column("name")]
public string Name { get; set; }
[Column("kg_per_ha")]
public int KgPerHa { get; set; }
}
}

13
Elwig/Models/WineCult.cs Normal file
View File

@ -0,0 +1,13 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("wine_cultivation"), PrimaryKey("CultId")]
public class WineCult {
[Column("cultid")]
public string CultId { get; set; }
[Column("name")]
public string Name { get; set; }
}
}

22
Elwig/Models/WineQual.cs Normal file
View File

@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("wine_quality"), PrimaryKey("QualId")]
public class WineQual {
[Column("qualid")]
public string QualId { get; private set; }
[Column("origin_level")]
public int? OriginLevel { get; private set; }
[Column("name")]
public string Name { get; private set; }
[Column("from_kmw")]
public double? FromKmw { get; private set; }
[Column("to_kmw")]
public double? ToKmw { get; private set; }
}
}

19
Elwig/Models/WineVar.cs Normal file
View File

@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("wine_variety"), PrimaryKey("SortId")]
public class WineVar {
[Column("sortid")]
public string SortId { get; private set; }
[Column("type")]
public string Type { get; private set; }
[Column("name")]
public string Name { get; private set; }
[Column("comment")]
public string? Comment { get; private set; }
}
}