mirror of
https://github.com/yummy4friends/y4f.git
synced 2024-11-10 06:37:21 +01:00
Compare commits
2 Commits
314c8667e6
...
c05d31975a
Author | SHA1 | Date | |
---|---|---|---|
|
c05d31975a | ||
|
9e8942ef43 |
@ -221,8 +221,8 @@ public partial class WebApiContext : DbContext
|
||||
|
||||
entity.ToTable("bestellungsposition_has_menuitem");
|
||||
|
||||
entity.Property(e => e.Bestellungsposition_IDBestellung).HasColumnType("int(11)").HasColumnName("bestellungsposition_IDBestellung");
|
||||
entity.Property(e => e.MenuItem_IDMenuItem).HasColumnType("int(11)").HasColumnName("menuItem_IDMenuItem");
|
||||
entity.Property(e => e.Bestellungsposition_IDBestellung).HasColumnType("int(11)").HasColumnName("Bestellungsposition_IDBestellung");
|
||||
entity.Property(e => e.MenuItem_IDMenuItem).HasColumnType("int(11)").HasColumnName("MenuItem_IDMenuItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MenuitemHasAllergie>(entity =>
|
||||
|
@ -89,12 +89,13 @@
|
||||
{
|
||||
localStorage.SetItem("RabattEinloesen", false);
|
||||
localStorage.SetItem("Summe", summe);
|
||||
// if summe > 8€ add treuepunkte
|
||||
if (summe >= 8)
|
||||
{
|
||||
kunde.Treuepunkte++;
|
||||
// add treuepunkte to API
|
||||
Http.PutAsJsonAsync("https://localhost:7076/api/kunden/" + kunde.Idkunde, kunde);
|
||||
if (kunde.Treuepunkte < 10)
|
||||
{
|
||||
kunde.Treuepunkte++;
|
||||
Http.PutAsJsonAsync("https://localhost:7076/api/kunden/" + kunde.Idkunde, kunde);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,12 +139,20 @@
|
||||
|
||||
Http.PostAsJsonAsync("https://localhost:7076/api/bestellungspositionen", bestellungsposition);
|
||||
|
||||
//Add menuitems to bestellungspositionHasMenuItem
|
||||
BestellungspositionHasMenuitem bestellungspositionHasMenuItem = new BestellungspositionHasMenuitem();
|
||||
bestellungspositionHasMenuItem.Bestellungsposition_IDBestellung = bestellungsposition.Idbestellung;
|
||||
bestellungspositionHasMenuItem.MenuItem_IDMenuItem = item.Key;
|
||||
////Add menuitems to bestellungspositionHasMenuItem
|
||||
//BestellungspositionHasMenuitem bestellungspositionHasMenuItem = new BestellungspositionHasMenuitem();
|
||||
//bestellungspositionHasMenuItem.Bestellungsposition_IDBestellung = bestellungsposition.Idbestellung;
|
||||
//bestellungspositionHasMenuItem.MenuItem_IDMenuItem = item.Key;
|
||||
|
||||
Http.PostAsJsonAsync("https://localhost:7076/api/bestellungspositionhasmenuitems", bestellungspositionHasMenuItem);
|
||||
//Http.PostAsJsonAsync("https://localhost:7076/api/bestellungspositionhasmenuitems", bestellungspositionHasMenuItem);
|
||||
|
||||
var newBestellungsposition = new BestellungspositionHasMenuitem()
|
||||
{
|
||||
Bestellungsposition_IDBestellung = bestellungsposition.Idbestellung,
|
||||
MenuItem_IDMenuItem = item.Key
|
||||
};
|
||||
|
||||
Http.PostAsJsonAsync("https://localhost:7076/api/bestellungspositionhasmenuitems", newBestellungsposition);
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,9 +42,20 @@
|
||||
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)
|
||||
@*print only if date is higher than now datum, all expired hh:mm unvisible *@
|
||||
@*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 only if date is in current day month year *@
|
||||
if (bestellungsposition.Datum.Day == DateTime.Now.Day && bestellungsposition.Datum.Month == DateTime.Now.Month && bestellungsposition.Datum.Year == DateTime.Now.Year)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@ -55,7 +66,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@*}*@
|
||||
firstTime = false;
|
||||
}
|
||||
}
|
||||
@ -65,17 +75,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>
|
||||
@ -118,6 +128,22 @@
|
||||
month = DateTime.Now.Month;
|
||||
year = DateTime.Now.Year;
|
||||
|
||||
//sort bestellungspositions by datum
|
||||
bestellungspositions = bestellungspositions.OrderByDescending(x => x.Datum).ToList();
|
||||
//sort kunden by the order of bestellungspositions
|
||||
List<Kunde> kundenSorted = new List<Kunde>();
|
||||
foreach (var bestellungsposition in bestellungspositions)
|
||||
{
|
||||
foreach (var kunde in kunden)
|
||||
{
|
||||
if (bestellungsposition.KundeIdkunde == kunde.Idkunde && !kundenSorted.Contains(kunde))
|
||||
{
|
||||
kundenSorted.Add(kunde);
|
||||
}
|
||||
}
|
||||
}
|
||||
kunden = kundenSorted;
|
||||
|
||||
}
|
||||
|
||||
public class Bestellungsposition
|
||||
|
@ -99,7 +99,7 @@
|
||||
|
||||
<div class="d-flex flex-column" style="align-items: center; margin-left: 100px;">
|
||||
@*<button class="btn_back w-75">Zurück</button>*@
|
||||
@*<button class="btn btn-danger w-75" style="border-radius: 50px; padding-top:12px; padding-bottom:12px; color:black;">Bestellung auflösen</button>*@
|
||||
@*<button class="btn btn-danger w-75" style="border-radius: 50px; padding-top:12px; padding-bottom:12px; color:black;" @onclick="Aufloesen">Bestellung auflösen</button>*@
|
||||
@*<button class="btn_forward w-75">Bestellung abschließen</button>*@
|
||||
</div>
|
||||
|
||||
@ -150,6 +150,25 @@
|
||||
localStorage.Clear();
|
||||
_navigationManager.NavigateTo("/");
|
||||
}
|
||||
|
||||
//public void Aufloesen()
|
||||
//{
|
||||
// foreach (var bestellungsposition in bestellungspositions)
|
||||
// {
|
||||
// foreach (var bestellungspositionHasMenuitem in bestellungspositionHasMenuitems)
|
||||
// {
|
||||
// if (bestellungsposition.Idbestellung == bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung)
|
||||
// {
|
||||
// Http.DeleteAsync("https://localhost:7076/api/BestellungspositionHasMenuitems/" + bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung + "/" + bestellungspositionHasMenuitem.MenuItem_IDMenuItem);
|
||||
// }
|
||||
// }
|
||||
// if (bestellungsposition.KundeIdkunde == kunde.Idkunde)
|
||||
// {
|
||||
// Http.DeleteAsync("https://localhost:7076/api/Bestellungspositionen/" + bestellungsposition.Idbestellung);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// get data from api
|
||||
|
Loading…
Reference in New Issue
Block a user