Rework models
This commit is contained in:
@ -5,9 +5,9 @@ namespace WGneu.Models {
|
||||
[Table("AT_gem"), PrimaryKey("Gkz")]
|
||||
public class AT_Gem {
|
||||
[Column("gkz")]
|
||||
public int Gkz { get; set; }
|
||||
public int Gkz { get; private set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
public string Name { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,15 +5,15 @@ namespace WGneu.Models {
|
||||
[Table("AT_kg"), PrimaryKey("KgNr")]
|
||||
public class AT_Kg {
|
||||
[Column("kgnr")]
|
||||
public int KgNr { get; set; }
|
||||
public int KgNr { get; private set; }
|
||||
|
||||
[Column("gkz")]
|
||||
public int Gkz { get; set; }
|
||||
public int Gkz { get; private set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
[ForeignKey("Gkz")]
|
||||
public virtual AT_Gem Gem { get; set; }
|
||||
public virtual AT_Gem Gem { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,21 +5,21 @@ namespace WGneu.Models {
|
||||
[Table("AT_ort"), PrimaryKey("Okz")]
|
||||
public class AT_Ort {
|
||||
[Column("okz")]
|
||||
public int Okz { get; set; }
|
||||
public int Okz { get; private set; }
|
||||
|
||||
[Column("gkz")]
|
||||
public int Gkz { get; set; }
|
||||
public int Gkz { get; private set; }
|
||||
|
||||
[Column("kgnr")]
|
||||
public int? KgNr { get; set; }
|
||||
public int? KgNr { get; private set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
[ForeignKey("Gkz")]
|
||||
public virtual AT_Gem Gem { get; set; }
|
||||
public virtual AT_Gem Gem { get; private set; }
|
||||
|
||||
[ForeignKey("KgNr")]
|
||||
public virtual AT_Kg? Kg { get; set; }
|
||||
public virtual AT_Kg? Kg { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -6,27 +6,27 @@ namespace WGneu.Models {
|
||||
[Table("AT_plz"), PrimaryKey("Plz")]
|
||||
public class AT_Plz {
|
||||
[Column("plz")]
|
||||
public int Plz { get; set; }
|
||||
public int Plz { get; private set; }
|
||||
|
||||
[Column("ort")]
|
||||
public string Ort { get; set; }
|
||||
public string Ort { get; private set; }
|
||||
|
||||
[Column("blnr")]
|
||||
public int BlNr { get; }
|
||||
public int BlNr { get; private set; }
|
||||
|
||||
[Column("type")]
|
||||
public string Type { get; }
|
||||
public string Type { get; private set; }
|
||||
|
||||
[Column("internal")]
|
||||
public bool Internal { get; set; }
|
||||
public bool IsInternal { get; private set; }
|
||||
|
||||
[Column("addressable")]
|
||||
public bool Addressable { get; set; }
|
||||
public bool IsAddressable { get; private set; }
|
||||
|
||||
[Column("po_box")]
|
||||
public bool PoBox { get; set; }
|
||||
public bool IsPoBox { get; private set; }
|
||||
|
||||
[InverseProperty("AtPlz")]
|
||||
public virtual ISet<AT_PlzDest> Orte { get; set; }
|
||||
public virtual ISet<AT_PlzDest> Orte { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,27 +5,27 @@ namespace WGneu.Models {
|
||||
[Table("AT_plz_dest"), PrimaryKey("Id"), Index("Plz", "Okz", IsUnique = true)]
|
||||
public class AT_PlzDest {
|
||||
[Column("plz")]
|
||||
public int Plz { get; set; }
|
||||
public int Plz { get; private set; }
|
||||
|
||||
[Column("okz")]
|
||||
public int Okz { get; set; }
|
||||
public int Okz { get; private set; }
|
||||
|
||||
[Column("country")]
|
||||
public string CountryCode { get; }
|
||||
public string CountryCode { get; private set; }
|
||||
|
||||
[Column("id")]
|
||||
public string Id { get; }
|
||||
public string Id { get; private set; }
|
||||
|
||||
[Column("dest")]
|
||||
public string Dest { get; set; }
|
||||
public string Dest { get; private set; }
|
||||
|
||||
[ForeignKey("Plz")]
|
||||
public virtual AT_Plz AtPlz { get; set; }
|
||||
public virtual AT_Plz AtPlz { get; private set; }
|
||||
|
||||
[ForeignKey("Okz")]
|
||||
public virtual AT_Ort Ort { get; set; }
|
||||
public virtual AT_Ort Ort { get; private set; }
|
||||
|
||||
[ForeignKey("CountryCode")]
|
||||
public virtual Country Country { get; set; }
|
||||
public virtual Country Country { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,18 +5,18 @@ namespace WGneu.Models {
|
||||
[Table("country"), PrimaryKey("Alpha2")]
|
||||
public class Country {
|
||||
[Column("alpha2")]
|
||||
public string Alpha2 { get; set; }
|
||||
public string Alpha2 { get; private set; }
|
||||
|
||||
[Column("alpha3")]
|
||||
public string Alpha3 { get; set; }
|
||||
public string Alpha3 { get; private set; }
|
||||
|
||||
[Column("num")]
|
||||
public int Num { get; set; }
|
||||
public int Num { get; private set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
[Column("is_visible")]
|
||||
public bool IsVisible { get; set; }
|
||||
public bool IsVisible { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -57,16 +57,16 @@ namespace WGneu.Models {
|
||||
public string? UstId { get; set; }
|
||||
|
||||
[Column("volllieferant")]
|
||||
public bool VollLieferant { get; set; }
|
||||
public bool IsVollLieferant { get; set; }
|
||||
|
||||
[Column("buchführend")]
|
||||
public bool Buchführend { get; set; }
|
||||
public bool IsBuchführend { get; set; }
|
||||
|
||||
[Column("funktionär")]
|
||||
public bool Funktionär { get; set; }
|
||||
public bool IsFunktionär { get; set; }
|
||||
|
||||
[Column("active")]
|
||||
public bool Active { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
[Column("iban")]
|
||||
public string? Iban { get; set; }
|
||||
@ -78,7 +78,7 @@ namespace WGneu.Models {
|
||||
public string CountryCode { get; set; }
|
||||
|
||||
[Column("postal_dest")]
|
||||
public string PostalDestId { get; set; }
|
||||
public string PostalDestId { get; private set; }
|
||||
|
||||
[Column("address")]
|
||||
public string Address { get; set; }
|
||||
|
@ -5,15 +5,15 @@ namespace WGneu.Models {
|
||||
[Table("postal_dest"), PrimaryKey("CountryCode", "Id")]
|
||||
public class PostalDest {
|
||||
[Column("country")]
|
||||
public string CountryCode { get; set; }
|
||||
public string CountryCode { get; private set; }
|
||||
|
||||
[Column("id")]
|
||||
public string Id { get; set; }
|
||||
public string Id { get; private set; }
|
||||
|
||||
[ForeignKey("CountryCode")]
|
||||
public virtual Country Country { get; set; }
|
||||
public virtual Country Country { get; private set; }
|
||||
|
||||
[ForeignKey("Id")]
|
||||
public virtual AT_PlzDest? AtPlz { get; set; }
|
||||
public virtual AT_PlzDest? AtPlz { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,18 +5,18 @@ namespace WGneu.Models {
|
||||
[Table("wine_quality"), PrimaryKey("QualId")]
|
||||
public class WineQual {
|
||||
[Column("qualid")]
|
||||
public string QualId { get; set; }
|
||||
public string QualId { get; private set; }
|
||||
|
||||
[Column("origin_level")]
|
||||
public int? OriginLevel { get; set; }
|
||||
public int? OriginLevel { get; private set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
[Column("from_kmw")]
|
||||
public double? FromKmw { get; set; }
|
||||
public double? FromKmw { get; private set; }
|
||||
|
||||
[Column("to_kmw")]
|
||||
public double? ToKmw { get; set; }
|
||||
public double? ToKmw { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,15 +5,15 @@ namespace WGneu.Models {
|
||||
[Table("wine_variety"), PrimaryKey("SortId")]
|
||||
public class WineVar {
|
||||
[Column("sortid")]
|
||||
public string SortId { get; set; }
|
||||
public string SortId { get; private set; }
|
||||
|
||||
[Column("type")]
|
||||
public string Type { get; set; }
|
||||
public string Type { get; private set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
[Column("comment")]
|
||||
public string? Comment { get; set; }
|
||||
public string? Comment { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ namespace WGneu.Windows {
|
||||
Context.Members.Load();
|
||||
IQueryable<Member> memberQuery = Context.Members;
|
||||
if (ActiveMemberInput.IsChecked == true)
|
||||
memberQuery = memberQuery.Where(m => m.Active);
|
||||
memberQuery = memberQuery.Where(m => m.IsActive);
|
||||
|
||||
List<Member> members = memberQuery.ToList();
|
||||
members = members.OrderBy(m => m.FamilyName + " " + m.GivenName).ToList();
|
||||
@ -196,7 +196,7 @@ namespace WGneu.Windows {
|
||||
|
||||
m.UstId = (UstIdInput.Text == "") ? null : UstIdInput.Text;
|
||||
m.LfbisNr = (LfbisNrInput.Text == "") ? null : LfbisNrInput.Text;
|
||||
m.Buchführend = BuchführendInput.IsChecked ?? false;
|
||||
m.IsBuchführend = BuchführendInput.IsChecked ?? false;
|
||||
|
||||
// TODO Rechnungsadresse
|
||||
|
||||
@ -204,9 +204,9 @@ namespace WGneu.Windows {
|
||||
m.ExitDate = (ExitDateInput.Text == "") ? null : string.Join("-", ExitDateInput.Text.Split(".").Reverse());
|
||||
m.BusinessShares = (BusinessSharesInput.Text == "") ? 0 : int.Parse(BusinessSharesInput.Text);
|
||||
m.AccountingNr = (AccountingNrInput.Text == "") ? null : AccountingNrInput.Text;
|
||||
m.Active = ActiveInput.IsChecked ?? false;
|
||||
m.VollLieferant = VollLieferantInput.IsChecked ?? false;
|
||||
m.Funktionär = FunkionärInput.IsChecked ?? false;
|
||||
m.IsActive = ActiveInput.IsChecked ?? false;
|
||||
m.IsVollLieferant = VollLieferantInput.IsChecked ?? false;
|
||||
m.IsFunktionär = FunkionärInput.IsChecked ?? false;
|
||||
m.ZwstId = ((Branch)BranchInput.SelectedItem).ZwstId;
|
||||
m.DefaultKgNr = ((AT_Kg)DefaultKgInput.SelectedItem).KgNr;
|
||||
m.Comment = (CommentInput.Text == "") ? null : CommentInput.Text;
|
||||
@ -381,7 +381,7 @@ namespace WGneu.Windows {
|
||||
|
||||
UstIdInput.Text = m.UstId;
|
||||
LfbisNrInput.Text = m.LfbisNr;
|
||||
BuchführendInput.IsChecked = m.Buchführend;
|
||||
BuchführendInput.IsChecked = m.IsBuchführend;
|
||||
|
||||
// TODO Rechnungsadresse
|
||||
|
||||
@ -392,9 +392,9 @@ namespace WGneu.Windows {
|
||||
BranchInput.SelectedItem = m.Branch;
|
||||
DefaultKgInput.SelectedItem = m.DefaultKg;
|
||||
CommentInput.Text = m.Comment;
|
||||
ActiveInput.IsChecked = m.Active;
|
||||
VollLieferantInput.IsChecked = m.VollLieferant;
|
||||
FunkionärInput.IsChecked = m.Funktionär;
|
||||
ActiveInput.IsChecked = m.IsActive;
|
||||
VollLieferantInput.IsChecked = m.IsVollLieferant;
|
||||
FunkionärInput.IsChecked = m.IsFunktionär;
|
||||
switch (m.DefaultContact) {
|
||||
case "post": ContactPostInput.IsChecked = true; break;
|
||||
case "email": ContactEmailInput.IsChecked = true; break;
|
||||
|
Reference in New Issue
Block a user