mirror of
https://github.com/yummy4friends/y4f.git
synced 2024-12-27 06:28:22 +01:00
Fix kunde.Idkunde access
This commit is contained in:
parent
d32a517013
commit
8abba97ab8
@ -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,29 +28,29 @@
|
||||
@*get the last highes datum from Datum*@
|
||||
if (firstTime)
|
||||
{
|
||||
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;
|
||||
day = bestellungsposition.Datum.Day;
|
||||
month = bestellungsposition.Datum.Month;
|
||||
year = bestellungsposition.Datum.Year;
|
||||
@*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;
|
||||
day = bestellungsposition.Datum.Day;
|
||||
month = bestellungsposition.Datum.Month;
|
||||
year = bestellungsposition.Datum.Year;
|
||||
|
||||
@*print kunde.code, hour and minute from last bestellungsposition*@
|
||||
@*print only if date is higher than now datum *@
|
||||
if (bestellungsposition.Datum > DateTime.Now)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<p @onclick="@(()=>BDetail(@kunde.Idkunde))" class="mb-0 pb-0">
|
||||
#@kunde.Code
|
||||
@hour:@minute
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@*print kunde.code, hour and minute from last bestellungsposition*@
|
||||
@*print only if date is higher than now datum *@
|
||||
if (bestellungsposition.Datum > DateTime.Now)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<p @onclick="@(()=>BDetail(@kunde.Idkunde))" class="mb-0 pb-0">
|
||||
#@kunde.Code
|
||||
@hour:@minute
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@*}*@
|
||||
firstTime = false;
|
||||
}
|
||||
}
|
||||
@ -60,17 +60,17 @@
|
||||
</table>
|
||||
</div>
|
||||
@*<div class="col-lg-3">
|
||||
<p id="text" readonly>Abholzeit</p>
|
||||
<br />
|
||||
<form id="button" action="Bestelluebersicht">
|
||||
<input type="submit" value="30 Min" class="btn">
|
||||
</form>
|
||||
<form id="button" action="Bestelluebersicht">
|
||||
<input type="submit" value="45 Min" class="btn">
|
||||
</form>
|
||||
<form id="button" action="Bestelluebersicht">
|
||||
<input type="submit" value="1 Std" class="btn">
|
||||
</form>
|
||||
<p id="text" readonly>Abholzeit</p>
|
||||
<br />
|
||||
<form id="button" action="Bestelluebersicht">
|
||||
<input type="submit" value="30 Min" class="btn">
|
||||
</form>
|
||||
<form id="button" action="Bestelluebersicht">
|
||||
<input type="submit" value="45 Min" class="btn">
|
||||
</form>
|
||||
<form id="button" action="Bestelluebersicht">
|
||||
<input type="submit" value="1 Std" class="btn">
|
||||
</form>
|
||||
|
||||
</div>*@
|
||||
</div>
|
||||
|
@ -156,37 +156,37 @@
|
||||
{
|
||||
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;
|
||||
minute = bestellungsposition.Datum.Minute;
|
||||
day = bestellungsposition.Datum.Day;
|
||||
month = bestellungsposition.Datum.Month;
|
||||
year = bestellungsposition.Datum.Year;
|
||||
|
||||
//if rabatt is used
|
||||
if (bestellungsposition.RabattIdrabatt != null)
|
||||
{
|
||||
|
||||
// get hour and minute from datetime of last bestellungsposition
|
||||
hour = bestellungsposition.Datum.Hour;
|
||||
minute = bestellungsposition.Datum.Minute;
|
||||
day = bestellungsposition.Datum.Day;
|
||||
month = bestellungsposition.Datum.Month;
|
||||
year = bestellungsposition.Datum.Year;
|
||||
|
||||
//if rabatt is used
|
||||
if (bestellungsposition.RabattIdrabatt != null)
|
||||
rabattEinloesen = true;
|
||||
foreach (var rabatt in rabatte)
|
||||
{
|
||||
rabattEinloesen = true;
|
||||
foreach (var rabatt in rabatte)
|
||||
if (rabatt.Idrabatt == bestellungsposition.RabattIdrabatt)
|
||||
{
|
||||
if (rabatt.Idrabatt == bestellungsposition.RabattIdrabatt)
|
||||
{
|
||||
this.rabatt = rabatt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var bestellungspositionHasMenuitem in bestellungspositionHasMenuitems)
|
||||
{
|
||||
if (bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung == bestellungsposition.Idbestellung)
|
||||
{
|
||||
menuitemIds.Add(bestellungspositionHasMenuitem.MenuItem_IDMenuItem, bestellungsposition.Menge);
|
||||
this.rabatt = rabatt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var bestellungspositionHasMenuitem in bestellungspositionHasMenuitems)
|
||||
{
|
||||
if (bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung == bestellungsposition.Idbestellung)
|
||||
{
|
||||
menuitemIds.Add(bestellungspositionHasMenuitem.MenuItem_IDMenuItem, bestellungsposition.Menge);
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
// get summe
|
||||
|
@ -64,7 +64,6 @@
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
@ -170,42 +169,43 @@
|
||||
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
|
||||
hour = bestellungsposition.Datum.Hour;
|
||||
minute = bestellungsposition.Datum.Minute;
|
||||
day = bestellungsposition.Datum.Day;
|
||||
month = bestellungsposition.Datum.Month;
|
||||
year = bestellungsposition.Datum.Year;
|
||||
|
||||
//if rabatt is used
|
||||
if (bestellungsposition.RabattIdrabatt != null)
|
||||
{
|
||||
|
||||
// get hour and minute from datetime of last bestellungsposition
|
||||
hour = bestellungsposition.Datum.Hour;
|
||||
minute = bestellungsposition.Datum.Minute;
|
||||
day = bestellungsposition.Datum.Day;
|
||||
month = bestellungsposition.Datum.Month;
|
||||
year = bestellungsposition.Datum.Year;
|
||||
|
||||
//if rabatt is used
|
||||
if (bestellungsposition.RabattIdrabatt != null)
|
||||
rabattEinloesen = true;
|
||||
foreach (var rabatt in rabatte)
|
||||
{
|
||||
rabattEinloesen = true;
|
||||
foreach (var rabatt in rabatte)
|
||||
if (rabatt.Idrabatt == bestellungsposition.RabattIdrabatt)
|
||||
{
|
||||
if (rabatt.Idrabatt == bestellungsposition.RabattIdrabatt)
|
||||
{
|
||||
this.rabatt = rabatt;
|
||||
}
|
||||
this.rabatt = rabatt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var bestellungspositionHasMenuitem in bestellungspositionHasMenuitems)
|
||||
foreach (var bestellungspositionHasMenuitem in bestellungspositionHasMenuitems)
|
||||
{
|
||||
if (bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung == bestellungsposition.Idbestellung)
|
||||
{
|
||||
if (bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung == bestellungsposition.Idbestellung)
|
||||
{
|
||||
menuitemIds.Add(bestellungspositionHasMenuitem.MenuItem_IDMenuItem, bestellungsposition.Menge);
|
||||
}
|
||||
menuitemIds.Add(bestellungspositionHasMenuitem.MenuItem_IDMenuItem, bestellungsposition.Menge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user