mirror of
https://github.com/yummy4friends/y4f.git
synced 2025-07-21 09:55:52 +02:00
Compare commits
1 Commits
workflow/T
...
ba6266579d
Author | SHA1 | Date | |
---|---|---|---|
ba6266579d |
23
.github/workflows/dotnet.yml
vendored
23
.github/workflows/dotnet.yml
vendored
@ -1,23 +0,0 @@
|
|||||||
name: Test if program still runs
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "dev" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "dev" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Setup .NET
|
|
||||||
uses: actions/setup-dotnet@v3
|
|
||||||
with:
|
|
||||||
dotnet-version: 7.0.107
|
|
||||||
- name: Restore dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
- name: Build
|
|
||||||
run: dotnet build --no-restore
|
|
@ -6,14 +6,17 @@
|
|||||||
|
|
||||||
|
|
||||||
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%"; background-color:#C7FFD5;'>
|
<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">
|
|
||||||
|
<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>
|
<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">
|
<button type="submit" id="button1" class="btn">QR-Code einscannen</button>
|
||||||
<input type="submit" value="Zur Speisekarte" class="btn" />
|
|
||||||
</form>
|
<input type="text" class="form-control" id="qrcode" placeholder="Zugangscode eintragen" name="qrcode">
|
||||||
|
|
||||||
|
<button type="submit" id="button1" class="btn">Bestätigen</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
using Blazored.LocalStorage;
|
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||||
using y4f;
|
using y4f;
|
||||||
@ -7,7 +6,7 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|||||||
builder.RootComponents.Add<App>("#app");
|
builder.RootComponents.Add<App>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
|
|
||||||
builder.Services.AddBlazoredLocalStorage();
|
|
||||||
|
|
||||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<tr class="loadtext">
|
<tr class="loadtext">
|
||||||
<td>Bestellung eingegangen</td>
|
<td>Bestellung eingegangen</td>
|
||||||
<td class="load2">Bestellung wird zubereitet</td>
|
<td class="load2">Bestellung wird zubereitet</td>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="container mt-auto">
|
<div class="container mt-auto">
|
||||||
<h4>AccountID: @RegistrierungA.userName</h4>
|
<h4>AccountID: #1234</h4>
|
||||||
<h4>Ihr QR-Code: </h4>
|
<h4>Ihr QR-Code: </h4>
|
||||||
<img src="assets/K-QR.png" class="img" title="logo image">
|
<img src="assets/K-QR.png" class="img" title="logo image">
|
||||||
|
|
||||||
|
@ -1,36 +1,22 @@
|
|||||||
@page "/RegistrierungA"
|
@page "/RegistrierungA"
|
||||||
@layout Registrierung
|
@layout Registrierung
|
||||||
@inject NavigationManager NavManager
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
|
|
||||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
<p>Benutzername:</p>
|
<p>Benutzername:</p>
|
||||||
|
<center>
|
||||||
<input type="text" class="form-control" id="name" name="name" @bind="@inputName">
|
<input type="text" class="form-control" id="name" name="name">
|
||||||
|
</center>
|
||||||
<p>Passwort:</p>
|
<p>Passwort:</p>
|
||||||
<input type="password" class="form-control" id="password" name="password" @bind="@inputPassword">
|
<center>
|
||||||
|
<input type="text" class="form-control" id="password" name="password">
|
||||||
<button type="button" class="btn" @onclick="@Login">Login</button>
|
</center>
|
||||||
|
<center>
|
||||||
|
|
||||||
|
<form id="button" action="Bestelluebersicht">
|
||||||
|
<input type="submit" value="Login" class="btn">
|
||||||
|
</form>
|
||||||
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
public string inputName { get; set; } = string.Empty;
|
|
||||||
public string inputPassword { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public static string userName { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public void Login() {
|
|
||||||
if (inputName == userDataName && inputPassword == userDataPassword) {
|
|
||||||
localStorage.SetItem("name", inputName);
|
|
||||||
userName = localStorage.GetItem<string>("name");
|
|
||||||
NavManager.NavigateTo("/Bestelluebersicht");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
|
||||||
public string userDataName { get; set; } = "";
|
|
||||||
public string userDataPassword { get; set; } = "";
|
|
||||||
}
|
}
|
@ -15,8 +15,5 @@ input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button {
|
|
||||||
text-align: center;
|
|
||||||
background-color: #89F9A5;
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
|
@ -1,105 +1,29 @@
|
|||||||
@page "/Yummy-Punkte"
|
@page "/Yummy-Punkte"
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
<h4><b>Ihre Yummy-Punkte</b></h4>
|
<h4><b>Ihre Yummy-Punkte</b></h4>
|
||||||
|
|
||||||
<div class="img">
|
<div class="img" >
|
||||||
@for (int i = 0; i < 10; i++)
|
@for(int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
@*if kunde hat treuepunkte*@
|
<img src="assets/White-Circle.png ">
|
||||||
@if (kunde.Treuepunkte > i)
|
}
|
||||||
{
|
<br>
|
||||||
<img src="assets/Point-Circle.png ">
|
</div>
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<img src="assets/White-Circle.png ">
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="text">Bei einem Mindestbestellwert von 8€ erhalten Sie ein Yummy-Punkt. Ab der 10ten Bestellung gibt es einen Rabatt zu Ihrer nächsten Bestellung.</p>
|
<p class="text">Bei einem Mindestbestellwert von 8€ erhalten Sie ein Yummy-Punkt. Ab der 10ten Bestellung gibt es einen Rabatt zu Ihrer nächsten Bestellung.</p>
|
||||||
<p class="text">Aktueller Rabatt: @rabatt.Prozent %</p>
|
|
||||||
|
|
||||||
<div class="button">
|
<div class="button">
|
||||||
<form id="button1" action="/">
|
<form id="button1" action="/">
|
||||||
<input type="submit" value="Zurück" class="btn">
|
<input type="submit" value="Zurück" class="btn">
|
||||||
</form>
|
</form>
|
||||||
@*reset button to set the treuepunkte to null*@
|
</div>
|
||||||
<button class="btn btn-danger" @onclick="@(()=>resetTreuepunkte())">Yummy-Punkte einlösen</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
private Rabatt rabatt = new Rabatt();
|
|
||||||
|
|
||||||
|
|
||||||
public void resetTreuepunkte()
|
|
||||||
{
|
|
||||||
if (kunde.Treuepunkte == 10)
|
|
||||||
{
|
|
||||||
kunde.Treuepunkte = 0;
|
|
||||||
// API change treupunkte to 0 if kunde has 10 treuepunkte
|
|
||||||
Http.PutAsJsonAsync("https://localhost:7076/api/kunden/" + kunde.Idkunde, kunde);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
|
|
||||||
kunde = kunden[0];
|
|
||||||
|
|
||||||
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
|
||||||
// if there is no rabatt, set the rabatt to null
|
|
||||||
if (rabatte.Count == 0)
|
|
||||||
{
|
|
||||||
rabatt = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int i = 0; i < rabatte.Count; i++)
|
|
||||||
{
|
|
||||||
if (rabatte[i].GueltigkeitBis > DateTime.Now)
|
|
||||||
{
|
|
||||||
rabatt = rabatte[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//rabatt = rabatte[rabatte.Count - 1];
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 55 KiB |
@ -3,20 +3,29 @@
|
|||||||
html, body {
|
html, body {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
background-color: #C7FFD1;
|
background-color: #C7FFD1;
|
||||||
padding: 5%;
|
|
||||||
margin-top: 1%;
|
margin-top: 1%;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
position: center;
|
position: center;
|
||||||
}
|
}
|
||||||
|
#button1 {
|
||||||
|
background-color: #89F9A5;
|
||||||
|
border-radius: 50px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
height: auto;
|
height: auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin: 10%;
|
margin: 5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
form {
|
form {
|
||||||
@ -26,3 +35,17 @@ form {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
border-radius: 50px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.1" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.1" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.1" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.1" PrivateAssets="all" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Reference in New Issue
Block a user