From 075d2a48387b546bf3b4921dcda62c563e2ad868 Mon Sep 17 00:00:00 2001
From: MET18937 <79221078+MET18937@users.noreply.github.com>
Date: Fri, 23 Jun 2023 20:04:29 +0200
Subject: [PATCH] Update shoppingcart
---
src/y4f/Pages/ShoppingCart.razor | 394 ++++++++++++++++++--------
src/y4f/wwwroot/css/shopping_cart.css | 11 +-
2 files changed, 285 insertions(+), 120 deletions(-)
diff --git a/src/y4f/Pages/ShoppingCart.razor b/src/y4f/Pages/ShoppingCart.razor
index cbd60aa..0046e0c 100644
--- a/src/y4f/Pages/ShoppingCart.razor
+++ b/src/y4f/Pages/ShoppingCart.razor
@@ -1,129 +1,293 @@
@page "/shopping_cart"
-
+@inject HttpClient Http
+@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
+@inject NavigationManager _navigationManager
Warenkorb
Warenkorb
-
-
- @*Tabelle Ihre Bestellung*@
-
-
-
-
- Ihre Bestellung |
- |
-
-
-
-
-
- 1 Nudel mit Hühnerfleisch (groß)
- mit Knoblauchsoße
- |
- 9,10€ |
-
-
- 1 Coca Cola |
- 2,50€ |
-
-
- |
- |
-
-
- |
- |
-
-
- |
- |
-
-
- |
- |
-
-
- |
- |
-
-
- |
- |
-
-
- |
- |
-
-
- |
- |
-
-
-
-
- Summe |
- 11,60€ |
-
-
-
+
+
+ @*Tabelle Ihre Bestellung*@
+
+
+
+
+ Ihre Bestellung |
+ |
+
+
+
+ @if (menuitemIds.Count == 0)
+ {
+
+
Warenkorb ist leer
+
+ }
+ else
+ {
+ @foreach (var item in menuitemIds)
+ {
+ @foreach (var item2 in menuitems)
+ {
+ @if (item.Key == item2.IdmenuItem)
+ {
+
-
+
+ @item.Value x
+ @item2.Bezeichnung
+
-
-
-
- @*Essen Abholen?*@
-
-
-
-
-
-
-
-
-
- Wann wollen Sie Ihr Essen abholen?
- |
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- @*Buttons*@
-
-
-
-
+ @item2.Zusatzinformation
+ |
+ @(item2.Preis * item.Value)€ |
+
+ }
+ }
+
+ }
+ }
+
+
+
+ Summe |
+
+ @summe€
+ |
+
+
+
+
+
+
+
+
+
+ @*Essen Abholen?*@
+
+
+
+
+
+
+
+
+
+ Wann wollen Sie Ihr Essen abholen?
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ @*Buttons*@
+
+
+
+
+
+
+
+
+@code {
+ public decimal summe;
+ public Dictionary
menuitemIds = new Dictionary();
+
+ private void SetMenuItemId(int id)
+ {
+ if (menuitemIds.ContainsKey(id))
+ {
+ menuitemIds[id]++;
+ }
+ else
+ {
+ menuitemIds.Add(id, 1);
+ }
+ localStorage.SetItem>("MenuItemIds", menuitemIds);
+ }
+
+
+ private void DelMenuItemId(int id)
+ {
+ if (menuitemIds.ContainsKey(id))
+ {
+ if (menuitemIds[id] > 1)
+ {
+ menuitemIds[id]--;
+ }
+ else
+ {
+ menuitemIds.Remove(id);
+ }
+ }
+ localStorage.SetItem>("MenuItemIds", menuitemIds);
+ _navigationManager.NavigateTo(_navigationManager.Uri, forceLoad: true);
+ }
+
+
+
+ // allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
+ private List allergien = new List();
+ private List bestellungspositions = new List();
+ private List kunden = new List();
+ private List