mirror of
https://github.com/yummy4friends/y4f.git
synced 2025-07-18 09:33:18 +02:00
Add complete vorbestellungsfunktion
This commit is contained in:
@ -13,7 +13,7 @@ public partial class Bestellungsposition
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
public virtual Kunde? KundeIdkundeNavigation { get; set; } = null!;
|
public virtual Kunde? KundeIdkundeNavigation { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -116,12 +116,19 @@
|
|||||||
DateTime abholzeit = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, minute, 0);
|
DateTime abholzeit = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, minute, 0);
|
||||||
bestellungsposition.Datum = abholzeit;
|
bestellungsposition.Datum = abholzeit;
|
||||||
// latest possible rabatt
|
// latest possible rabatt
|
||||||
bestellungsposition.RabattIdrabatt = rabatt.Idrabatt;
|
if (rabattEinloesen)
|
||||||
|
{
|
||||||
|
bestellungsposition.RabattIdrabatt = rabatt.Idrabatt;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bestellungsposition.RabattIdrabatt = null;
|
||||||
|
}
|
||||||
bestellungsposition.KundeIdkunde = kunde.Idkunde;
|
bestellungsposition.KundeIdkunde = kunde.Idkunde;
|
||||||
|
|
||||||
Http.PostAsJsonAsync("https://localhost:7076/api/bestellungspositionen", bestellungsposition);
|
Http.PostAsJsonAsync("https://localhost:7076/api/bestellungspositionen", bestellungsposition);
|
||||||
|
|
||||||
//Add menuitems to bestellungspositionHasMenuItem
|
//Add menuitems to bestellungspositionHasMenuItem
|
||||||
BestellungspositionHasMenuitem bestellungspositionHasMenuItem = new BestellungspositionHasMenuitem();
|
BestellungspositionHasMenuitem bestellungspositionHasMenuItem = new BestellungspositionHasMenuitem();
|
||||||
bestellungspositionHasMenuItem.Bestellungsposition_IDBestellung = bestellungsposition.Idbestellung;
|
bestellungspositionHasMenuItem.Bestellungsposition_IDBestellung = bestellungsposition.Idbestellung;
|
||||||
bestellungspositionHasMenuItem.MenuItem_IDMenuItem = item.Key;
|
bestellungspositionHasMenuItem.MenuItem_IDMenuItem = item.Key;
|
||||||
@ -131,8 +138,8 @@
|
|||||||
|
|
||||||
// delete all localStorage
|
// delete all localStorage
|
||||||
localStorage.SetItem("MenuItemIds", new Dictionary<int, int>());
|
localStorage.SetItem("MenuItemIds", new Dictionary<int, int>());
|
||||||
localStorage.SetItem("Hour", 0);
|
//localStorage.SetItem("Hour", 0);
|
||||||
localStorage.SetItem("Minute", 0);
|
//localStorage.SetItem("Minute", 0);
|
||||||
localStorage.SetItem("Summe", 0);
|
localStorage.SetItem("Summe", 0);
|
||||||
localStorage.SetItem("RabattEinloesen", false);
|
localStorage.SetItem("RabattEinloesen", false);
|
||||||
|
|
||||||
@ -227,7 +234,7 @@
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,7 @@
|
|||||||
<div class="button">
|
<div class="button">
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
<form id="button1" action="/">
|
<form id="button1" action="/">
|
||||||
<input type="submit" value="Bestellungsübersicht" class="btn">
|
<input type="submit" value="Bestellungsübersicht" class="btn" @onclick="BestellungsUuebersicht"/>
|
||||||
@*<input type="submit" value="Zur Startseite" class="btn">*@
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -60,17 +59,11 @@
|
|||||||
|
|
||||||
public decimal summe;
|
public decimal summe;
|
||||||
|
|
||||||
public void Vorbestellen()
|
|
||||||
|
|
||||||
|
public void BestellungsUuebersicht()
|
||||||
{
|
{
|
||||||
// set rabattEinloesen
|
_navigationManager.NavigateTo("/Kontoverwaltung");
|
||||||
if (rabattEinloesen)
|
|
||||||
localStorage.SetItem("RabattEinloesen", true);
|
|
||||||
else
|
|
||||||
localStorage.SetItem("RabattEinloesen", false);
|
|
||||||
|
|
||||||
_navigationManager.NavigateTo("/Bestellbestätigung");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
||||||
@ -161,7 +154,7 @@
|
|||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
public int KundeIdkunde { get; set; }
|
||||||
|
|
||||||
public int RabattIdrabatt { get; set; }
|
public int? RabattIdrabatt { get; set; }
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
@page "/Kontoverwaltung"
|
@page "/Kontoverwaltung"
|
||||||
|
|
||||||
|
@inject HttpClient Http
|
||||||
|
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
||||||
|
@inject NavigationManager _navigationManager
|
||||||
|
|
||||||
<h3>Wichtige Informationen</h3> <br>
|
<h3>Wichtige Informationen</h3> <br>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user