mirror of
https://github.com/yummy4friends/y4f.git
synced 2025-07-06 16:27:50 +02:00
Fix kunde.Idkunde access
This commit is contained in:
@ -83,10 +83,12 @@
|
||||
Http.PutAsJsonAsync("https://localhost:7076/api/kunden/" + kunde.Idkunde, kunde);
|
||||
summe = Math.Round(summe - (summe * rabatt.Prozent / 100), 2);
|
||||
localStorage.SetItem("Summe", summe);
|
||||
localStorage.SetItem("RabattEinloesen", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
localStorage.SetItem("RabattEinloesen", false);
|
||||
localStorage.SetItem("Summe", summe);
|
||||
}
|
||||
|
||||
// add bestellung to API
|
||||
@ -167,7 +169,7 @@
|
||||
bestellungspositionHasMenuitems = await Http.GetFromJsonAsync<List<BestellungspositionHasMenuitem>>("https://localhost:7076/api/BestellungspositionHasMenuitems");
|
||||
|
||||
// test use the first kunde
|
||||
kunde = kunden[0];
|
||||
kunde = kunden[1];
|
||||
|
||||
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
||||
// if there is no rabatt, set the rabatt to null
|
||||
|
@ -85,7 +85,7 @@
|
||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
||||
|
||||
// test use the first kunde
|
||||
kunde = kunden[0];
|
||||
kunde = kunden[1];
|
||||
|
||||
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
||||
// if there is no rabatt, set the rabatt to null
|
||||
|
@ -28,8 +28,8 @@
|
||||
@*get the last highes datum from Datum*@
|
||||
if (firstTime)
|
||||
{
|
||||
if (bestellungsposition.Datum == bestellungspositions.Max(x => x.Datum))
|
||||
{
|
||||
@*if (bestellungsposition.Datum == bestellungspositions.Max(x => x.Datum))*@
|
||||
@*{*@
|
||||
@*get hour and minute from datetime of last bestellungsposition*@
|
||||
hour = bestellungsposition.Datum.Hour;
|
||||
minute = bestellungsposition.Datum.Minute;
|
||||
@ -50,7 +50,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
@*}*@
|
||||
firstTime = false;
|
||||
}
|
||||
}
|
||||
|
@ -156,8 +156,8 @@
|
||||
{
|
||||
if (bestellungsposition.KundeIdkunde == kunde.Idkunde)
|
||||
{
|
||||
if (bestellungsposition.Datum == bestellungspositions.Max(x => x.Datum))
|
||||
{
|
||||
//if (bestellungsposition.Datum == bestellungspositions.Max(x => x.Datum))
|
||||
//{
|
||||
|
||||
// get hour and minute from datetime of last bestellungsposition
|
||||
hour = bestellungsposition.Datum.Hour;
|
||||
@ -186,7 +186,7 @@
|
||||
menuitemIds.Add(bestellungspositionHasMenuitem.MenuItem_IDMenuItem, bestellungsposition.Menge);
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
// get summe
|
||||
|
@ -64,7 +64,6 @@
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
@ -170,14 +169,16 @@
|
||||
bestellungspositionHasMenuitems = await Http.GetFromJsonAsync<List<BestellungspositionHasMenuitem>>("https://localhost:7076/api/BestellungspositionHasMenuitems");
|
||||
|
||||
|
||||
// use kudnde with id 1
|
||||
kunde = kunden[0];
|
||||
// use kudnde with id 2
|
||||
kunde = kunden[1];
|
||||
|
||||
|
||||
|
||||
|
||||
// get all menuitemIds from bestellungspositions with the last date
|
||||
foreach (var bestellungsposition in bestellungspositions)
|
||||
foreach (Bestellungsposition bestellungsposition in bestellungspositions)
|
||||
{
|
||||
if (bestellungsposition.KundeIdkunde == kunde.Idkunde)
|
||||
{
|
||||
if (bestellungsposition.Datum == bestellungspositions.Max(x => x.Datum))
|
||||
{
|
||||
|
||||
// get hour and minute from datetime of last bestellungsposition
|
||||
@ -209,7 +210,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// get summe
|
||||
foreach (var menuitem in menuitems)
|
||||
{
|
||||
|
@ -62,7 +62,7 @@
|
||||
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];
|
||||
kunde = kunden[1];
|
||||
|
||||
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
||||
// if there is no rabatt, set the rabatt to null
|
||||
|
Reference in New Issue
Block a user