Change code formatting

This commit is contained in:
2023-02-27 15:33:30 +01:00
parent 70b63e3dd4
commit 5480e4f9b9
17 changed files with 148 additions and 300 deletions

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("AT_gem"), PrimaryKey("Gkz")]
public class AT_Gem
{
public class AT_Gem {
[Column("gkz")]
public int Gkz { get; set; }

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("AT_kg"), PrimaryKey("KgNr")]
public class AT_Kg
{
public class AT_Kg {
[Column("kgnr")]
public int KgNr { get; set; }

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("AT_ort"), PrimaryKey("Okz")]
public class AT_Ort
{
public class AT_Ort {
[Column("okz")]
public int Okz { get; set; }

View File

@ -7,11 +7,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("AT_plz"), PrimaryKey("Plz", "Okz"), Index("Id", IsUnique = true)]
public class AT_Plz
{
public class AT_Plz {
[Column("plz")]
public int Plz { get; set; }
@ -33,9 +31,8 @@ namespace WGneu.Models
[ForeignKey("CountryCode")]
public virtual Country Country { get; set; }
public ISet<AT_Plz> Orte(WgContext ctx)
{
public ISet<AT_Plz> Orte(WgContext ctx) {
return ctx.Postleitzahlen.Where(p => p.Plz == Plz).ToHashSet();
}
}
}
}

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("branch"), PrimaryKey("ZwstId")]
public class Branch
{
public class Branch {
[Column("zwstid")]
public string ZwstId { get; set; }

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("country"), PrimaryKey("Alpha2")]
public class Country
{
public class Country {
[Column("alpha2")]
public string Alpha2 { get; set; }

View File

@ -4,59 +4,49 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
// 1 °KMW =
// 1 °NM = kg/100L = 10g/L
// 1 °Oe =
// 1 °Bé =
// 1 °Bx = g/100g (x Gramm Zucker pro 100 Gramm Flüssigkeit)
internal class Gradation
{
internal class Gradation {
/// <summary>
/// Gradation in mg/L.
/// </summary>
uint mgpl;
public Gradation(uint mgpl)
{
public Gradation(uint mgpl) {
this.mgpl = mgpl;
}
public static double relativeDensity(double todo)
{
public static double relativeDensity(double todo) {
return 0;
}
public static double KmwToOe(double kmw)
{
public static double KmwToOe(double kmw) {
return 0; // TODO
}
public static double OeToKmw(double oe)
{
public static double OeToKmw(double oe) {
return 0; // TODO
}
public static Gradation FromKmw(double kwm)
{
public static Gradation FromKmw(double kwm) {
return new Gradation(0); // TODO
}
public static Gradation FromKmw(double kmw, double t)
{
public static Gradation FromKmw(double kmw, double t) {
// The temperature can be ignored, because no volumetric unit is involved.
// 1 °KMW = 1g/100g
return FromKmw(kmw);
}
public static Gradation FromOe(double oe)
{
public static Gradation FromOe(double oe) {
return new Gradation(0); // TODO
}
public static Gradation FromOe(double oe, double t)
{
public static Gradation FromOe(double oe, double t) {
return null;
}
}

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("member"), PrimaryKey("MgNr")]
public class Member
{
public class Member {
[Column("mgnr")]
public int MgNr { get; set; }
@ -82,7 +80,7 @@ namespace WGneu.Models
[Column("country")]
public string CountryCode { get; set; }
[Column("postal_dest")]
public string PostalDestId { get; set; }
@ -115,7 +113,7 @@ namespace WGneu.Models
[ForeignKey("CountryCode")]
public virtual Country Country { get; set; }
[ForeignKey("CountryCode, PostalDestId")]
public virtual PostalDest PostalDest { get; set; }

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("postal_dest"), PrimaryKey("CountryCode", "Id")]
public class PostalDest
{
public class PostalDest {
[Column("country")]
public string CountryCode { get; set; }
@ -20,8 +18,7 @@ namespace WGneu.Models
[ForeignKey("CountryCode")]
public virtual Country Country { get; set; }
public AT_Plz? Plz(WgContext ctx)
{
public AT_Plz? Plz(WgContext ctx) {
if (CountryCode != "AT") return null;
return ctx.Postleitzahlen.Where(p => p.Id == Id).FirstOrDefault();
}

View File

@ -6,11 +6,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
namespace WGneu.Models {
[Table("wb_kg"), PrimaryKey("KgNr")]
public class WbKg
{
public class WbKg {
[Column("kgnr")]
public int KgNr { get; set; }