Add MemberListWindow

This commit is contained in:
2023-02-16 21:50:31 +01:00
parent 33d2ae1b84
commit 29e2a56627
9 changed files with 124 additions and 2 deletions

29
WGneu/Models/Country.cs Normal file
View 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
{
[Table("country"), PrimaryKey("Alpha2")]
public class Country
{
[Column("alpha2")]
public String Alpha2 { get; set; }
[Column("alpha3")]
public String Alpha3 { get; set; }
[Column("num")]
public int Num { get; set; }
[Column("name")]
public String Name { get; set; }
[Column("is_visible")]
public int IsVisible { get; set; }
}
}

63
WGneu/Models/Gradation.cs Normal file
View File

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu
{
// 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
{
/// <summary>
/// Gradation in mg/L.
/// </summary>
uint mgpl;
public Gradation(uint mgpl)
{
this.mgpl = mgpl;
}
public static double relativeDensity(double todo)
{
return 0;
}
public static double KmwToOe(double kmw)
{
return 0; // TODO
}
public static double OeToKmw(double oe)
{
return 0; // TODO
}
public static Gradation FromKmw(double kwm)
{
return new Gradation(0); // TODO
}
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)
{
return new Gradation(0); // TODO
}
public static Gradation FromOe(double oe, double t)
{
return null;
}
}
}

23
WGneu/Models/Member.cs Normal file
View File

@ -0,0 +1,23 @@
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
{
[Table("member"), PrimaryKey("MgNr")]
public class Member
{
[Column("mgnr")]
public int MgNr { get; set; }
[Column("given_name")]
public String GivenName { get; set; }
[Column("family_name")]
public String FamilyName { get; set; }
}
}