Compare commits

..

No commits in common. "3356a91d47d9ba0f3fa221db48c1655903ec0f83" and "8abba97ab88deee6327c2f251ce78b6f5df7550c" have entirely different histories.

20 changed files with 233 additions and 515 deletions

View File

@ -1,125 +1,90 @@
@page "/allergene"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
protected override async Task OnInitializedAsync()
{
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
}
public class Kunde
{
public int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
<PageTitle>Allergene</PageTitle>
<table class="tg">
<thead>
<tr>
<th class="tg-c3ow" colspan="3">Allergeninformation<br>gemäß Codex-Empfehlung </th>
</tr>
</thead>
<tbody>
<tr>
<td class="tg-0pky">Visuelles</td>
<td class="tg-0pky">Kurzbezeichnung</td>
<td class="tg-0pky">Buchstabencode</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/getreide.png" alt="Getreide"></td>
<td class="tg-0pky">glutenhaltiges Getreide</td>
<td class="tg-c3ow">A</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/krebstiere.png" alt="Krebstiere"></td>
<td class="tg-0pky">Krebstiere</td>
<td class="tg-c3ow">B</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/ei.png" alt="Ei"></td>
<td class="tg-0pky">Ei</td>
<td class="tg-c3ow">C</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/fisch.png" alt="Fisch"></td>
<td class="tg-0pky">Fisch</td>
<td class="tg-c3ow">D</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/erdnuss.png" alt="Erdnuss"></td>
<td class="tg-0pky">Erdnuss</td>
<td class="tg-c3ow">E</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/soja.png" alt="Soja"></td>
<td class="tg-0pky">Soja</td>
<td class="tg-c3ow">F</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/milch.png" alt="Milch oder Laktose"></td>
<td class="tg-0pky">Milch oder Laktose</td>
<td class="tg-c3ow">G</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/schalenfruechte.png" alt="Schalenfrüchte"></td>
<td class="tg-0pky">Schalenfrüchte</td>
<td class="tg-c3ow">H</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/sellerie.png" alt="Sellerie"></td>
<td class="tg-0pky">Sellerie</td>
<td class="tg-c3ow">L</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/senf.png" alt="Senf"></td>
<td class="tg-0pky">Senf</td>
<td class="tg-c3ow">M</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/sesam.png" alt="Sesam"></td>
<td class="tg-0pky">Sesam</td>
<td class="tg-c3ow">N</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/sulfite.png" alt="Sulfite"></td>
<td class="tg-0pky">Sulfite</td>
<td class="tg-c3ow">O</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/lupinen.png" alt="Lupinen"></td>
<td class="tg-0pky">Lupinen</td>
<td class="tg-c3ow">P</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/weichtiere.png" alt="Weichtiere"></td>
<td class="tg-0pky">Weichtiere</td>
<td class="tg-c3ow">R</td>
</tr>
</tbody>
<thead>
<tr>
<th class="tg-c3ow" colspan="3">Allergeninformation<br>gemäß Codex-Empfehlung </th>
</tr>
</thead>
<tbody>
<tr>
<td class="tg-0pky">Visuelles</td>
<td class="tg-0pky">Kurzbezeichnung</td>
<td class="tg-0pky">Buchstabencode</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/getreide.png" alt="Getreide"></td>
<td class="tg-0pky">glutenhaltiges Getreide</td>
<td class="tg-c3ow">A</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/krebstiere.png" alt="Krebstiere"></td>
<td class="tg-0pky">Krebstiere</td>
<td class="tg-c3ow">B</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/ei.png" alt="Ei"></td>
<td class="tg-0pky">Ei</td>
<td class="tg-c3ow">C</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/fisch.png" alt="Fisch"></td>
<td class="tg-0pky">Fisch</td>
<td class="tg-c3ow">D</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/erdnuss.png" alt="Erdnuss"></td>
<td class="tg-0pky">Erdnuss</td>
<td class="tg-c3ow">E</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/soja.png" alt="Soja"></td>
<td class="tg-0pky">Soja</td>
<td class="tg-c3ow">F</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/milch.png" alt="Milch oder Laktose"></td>
<td class="tg-0pky">Milch oder Laktose</td>
<td class="tg-c3ow">G</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/schalenfruechte.png" alt="Schalenfrüchte"></td>
<td class="tg-0pky">Schalenfrüchte</td>
<td class="tg-c3ow">H</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/sellerie.png" alt="Sellerie"></td>
<td class="tg-0pky">Sellerie</td>
<td class="tg-c3ow">L</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/senf.png" alt="Senf"></td>
<td class="tg-0pky">Senf</td>
<td class="tg-c3ow">M</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/sesam.png" alt="Sesam"></td>
<td class="tg-0pky">Sesam</td>
<td class="tg-c3ow">N</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/sulfite.png" alt="Sulfite"></td>
<td class="tg-0pky">Sulfite</td>
<td class="tg-c3ow">O</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/lupinen.png" alt="Lupinen"></td>
<td class="tg-0pky">Lupinen</td>
<td class="tg-c3ow">P</td>
</tr>
<tr>
<td class="tg-0pky"><img class="icon" src="assets/weichtiere.png" alt="Weichtiere"></td>
<td class="tg-0pky">Weichtiere</td>
<td class="tg-c3ow">R</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<br>
<br><br><br><br>

View File

@ -1,33 +1,5 @@
@page "/cookies"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
protected override async Task OnInitializedAsync()
{
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
}
public class Kunde
{
public int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
<!DOCTYPE html>
<html lang="">
<head>

View File

@ -1,33 +1,5 @@
@page "/datenschutzerklärung"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
protected override async Task OnInitializedAsync()
{
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
}
public class Kunde
{
public int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
<!DOCTYPE html>
<html lang="">
<head>

View File

@ -0,0 +1,57 @@
@page "/fetchdata"
@inject HttpClient Http
<PageTitle>Weather forecast</PageTitle>
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from the server.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
}
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}

View File

@ -1,56 +1,20 @@
@page "/"
@layout Startseite
 @page "/"
@layout Startseite
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
<PageTitle>Yummy4Friends</PageTitle>
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%"; background-color:#C7FFD5;'>
<div class="container col-lg-6 col-md-9 col-sm-12 d-flex flex-column " id="content">
<center><h1>Herzlich Willkommen!</h1></center>
<div class="container col-lg-6 col-md-9 col-sm-12 d-flex flex-column " id="content" style=" padding-left:10%; padding-right:10%;">
<center><h1>Herzlich Willkommen!</h1></center>
<img src="assets/Logo_new.png" class="img" title="logo image">
<img src="assets/Logo_new.png" class="img" title="logo image">
<form action="Speisekarte">
<input type="submit" value="Zur Speisekarte" class="btn" />
</form>
</div>
<input type="text" class="form-control" id="qrcode" placeholder="Zugangscode eintragen" name="qrcode" @bind-value="@qrcodeValue">
<button type="submit" id="button1" class="btn" @onclick="@(() => CheckCode())">Bestätigen</button>
</div>
</body>
@code {
private string qrcodeValue;
private List<Kunde> kunden = new List<Kunde>();
public void CheckCode()
{
foreach (var kunde in kunden)
{
if (kunde.Code == qrcodeValue)
{
localStorage.SetItem("kunde", kunde);
_navigationManager.NavigateTo("/speisekarte");
break;
}
}
}
protected override async Task OnInitializedAsync()
{
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
}
public class Kunde
{
public int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}

View File

@ -1,37 +1,5 @@
@page "/Kontakt"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
protected override async Task OnInitializedAsync()
{
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
}
public class Kunde
{
public int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
<h3>Kontakt</h3>
<h4>Kundenservice</h4>

View File

@ -122,9 +122,6 @@
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
public int hour;
public int minute;
private void UpdateTime()
@ -185,6 +182,7 @@
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
private List<Allergie> allergien = new List<Allergie>();
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
private List<Kunde> kunden = new List<Kunde>();
private List<Menuitem> menuitems = new List<Menuitem>();
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
@ -192,17 +190,6 @@
protected override async Task OnInitializedAsync()
{
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// get data from localstorage
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
{
@ -212,6 +199,7 @@
// get data from api
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");

View File

@ -1,9 +1,6 @@
@page "/Speisekarte"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
<h1>Speisekarte</h1>
<div class="row justify-content-center">
@ -73,24 +70,11 @@
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
protected override async Task OnInitializedAsync()
{
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/MenuItemKategories");
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/MenuItemUeberkategories");
}
@ -113,10 +97,4 @@
}
public class Kunde
{
public int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
}

View File

@ -2,7 +2,6 @@
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
<h1>Speisekarte Chinesisch</h1>
<div class="container">
@ -90,9 +89,6 @@
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
private void SetMenuItemId(int id)
@ -111,6 +107,7 @@
private List<Allergie> allergien = new List<Allergie>();
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
private List<Kunde> kunden = new List<Kunde>();
private List<Menuitem> menuitems = new List<Menuitem>();
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
@ -118,18 +115,6 @@
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
{
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");

View File

@ -2,7 +2,6 @@
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
<h1>Speisekarte Getränke</h1>
@* create an container bootstrap 5*@
@ -94,8 +93,6 @@
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
@ -117,6 +114,7 @@
private List<Allergie> allergien = new List<Allergie>();
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
private List<Kunde> kunden = new List<Kunde>();
private List<Menuitem> menuitems = new List<Menuitem>();
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
@ -124,18 +122,6 @@
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
{
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");

View File

@ -2,7 +2,6 @@
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
<h1>Speisekarte Sonstiges</h1>
@* create an container bootstrap 5*@
@ -99,8 +98,6 @@
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
@ -120,6 +117,7 @@
private List<Allergie> allergien = new List<Allergie>();
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
private List<Kunde> kunden = new List<Kunde>();
private List<Menuitem> menuitems = new List<Menuitem>();
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
@ -127,17 +125,6 @@
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
{
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");

View File

@ -2,7 +2,6 @@
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
<h1>Speisekarte Japanisch</h1>
@* create an container bootstrap 5*@
@ -93,8 +92,6 @@
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
@ -114,6 +111,7 @@
private List<Allergie> allergien = new List<Allergie>();
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
private List<Kunde> kunden = new List<Kunde>();
private List<Menuitem> menuitems = new List<Menuitem>();
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
@ -121,18 +119,6 @@
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
{
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");

View File

@ -0,0 +1,51 @@
@page "/TestFetchAllergienData"
@inject HttpClient Http
<PageTitle>Allergien</PageTitle>
<h1>Allergien</h1>
<p>This component demonstrates fetching data from the mysql server.</p>
@if (allergien == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Beschreibung</th>
</tr>
</thead>
<tbody>
@foreach (var allergie in allergien)
{
<tr>
<td>@allergie.Idallergie</td>
<td>@allergie.Beschreibung</td>
</tr>
}
</tbody>
</table>
}
@code {
private const string ServiceEndpoint = "https://localhost:7076/api/Allergien";
private Allergie[]? allergien;
protected override async Task OnInitializedAsync()
{
allergien = await Http.GetFromJsonAsync<Allergie[]>(ServiceEndpoint);
}
public partial class Allergie
{
public int Idallergie { get; set; }
public string? Beschreibung { get; set; }
}
}

View File

@ -1,37 +1,5 @@
@page "/yummypoints"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
}
public class Kunde
{
int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%";'>
<div class="d-flex justify-content-center">

View File

@ -158,29 +158,18 @@
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
// get data from api
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
bestellungspositionHasMenuitems = await Http.GetFromJsonAsync<List<BestellungspositionHasMenuitem>>("https://localhost:7076/api/BestellungspositionHasMenuitems");
// get kunde from local storage
kunde = localStorage.GetItem<Kunde>("kunde");
// test use the first kunde
kunde = kunden[1];
// get the most recent rabatt, that are still valid (GueltigkeitBis)
// if there is no rabatt, set the rabatt to null

View File

@ -75,18 +75,6 @@
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
// get data from api
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
@ -97,8 +85,7 @@
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
// test use the first kunde
// get kunde from local storage
kunde = localStorage.GetItem<Kunde>("kunde");
kunde = kunden[1];
// get the most recent rabatt, that are still valid (GueltigkeitBis)
// if there is no rabatt, set the rabatt to null

View File

@ -1,36 +1,5 @@
@page "/FBestätigung"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
}
public class Kunde
{
int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
<h4>Vielen Dank für Ihr Feedback. Durch Feedbacks können wir uns stets verbessern.<br></h4>
@ -38,3 +7,9 @@
<input type="submit" value="Zur Startseite" class="btn">
</form>
</div>
@code {
}

View File

@ -1,37 +1,5 @@
@page "/Feedback"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
}
public class Kunde
{
int Idkunde { get; set; }
public string Code { get; set; }
public int Treuepunkte { get; set; }
}
}
<body>
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
<h4 for="feedback">Ihr Feedback: </h4>
@ -46,4 +14,8 @@
</div>
</body>
</body>
@code {
}

View File

@ -8,10 +8,6 @@
<br>
@*log out Button *@
<div class="container mt-auto">
<button class="btn" type="button" onclick="@Logout" id="button1">@button1</button>
</div>
<div class="container mt-auto">
<h4>AccountID: @kunde.Code</h4>
@ -129,10 +125,8 @@
@code {
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
@code {
bool changeButtonBool { get; set; } = true;
string button1 => changeButtonBool ? "Konto deaktivieren" : "Konto aktivieren";
@ -143,12 +137,6 @@
changeButtonBool = !changeButtonBool;
}
public void Logout()
{
localStorage.Clear();
_navigationManager.NavigateTo("/");
}
public int hour;
public int minute;
public int day;
@ -165,24 +153,14 @@
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
private List<Kunde> kunden = new List<Kunde>();
private Kunde kunde = new Kunde();
private List<Menuitem> menuitems = new List<Menuitem>();
private List<Rabatt> rabatte = new List<Rabatt>();
private List<BestellungspositionHasMenuitem> bestellungspositionHasMenuitems = new List<BestellungspositionHasMenuitem>();
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
// get data from api
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
@ -190,8 +168,12 @@
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
bestellungspositionHasMenuitems = await Http.GetFromJsonAsync<List<BestellungspositionHasMenuitem>>("https://localhost:7076/api/BestellungspositionHasMenuitems");
// get kunde from local storage
kunde = localStorage.GetItem<Kunde>("kunde");
// use kudnde with id 2
kunde = kunden[1];
// get all menuitemIds from bestellungspositions with the last date
foreach (Bestellungsposition bestellungsposition in bestellungspositions)

View File

@ -1,7 +1,6 @@
@page "/Yummy-Punkte"
@inject HttpClient Http
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
@inject NavigationManager _navigationManager
<body>
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
@ -60,23 +59,10 @@
protected override async Task OnInitializedAsync()
{
// kunde login start
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
if (localStorage.ContainKey("kunde"))
kunde = localStorage.GetItem<Kunde>("kunde");
else
_navigationManager.NavigateTo("/");
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
_navigationManager.NavigateTo("/");
// kunde login end
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
// get kunde from local storage
kunde = localStorage.GetItem<Kunde>("kunde");
kunde = kunden[1];
// get the most recent rabatt, that are still valid (GueltigkeitBis)
// if there is no rabatt, set the rabatt to null