mirror of
https://github.com/yummy4friends/y4f.git
synced 2024-12-30 23:37:09 +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.ToTable("bestellungsposition_has_menuitem");
|
||||||
|
|
||||||
entity.Property(e => e.Bestellungsposition_IDBestellung).HasColumnType("int(11)").HasColumnName("bestellungsposition_IDBestellung");
|
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.MenuItem_IDMenuItem).HasColumnType("int(11)").HasColumnName("MenuItem_IDMenuItem");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<MenuitemHasAllergie>(entity =>
|
modelBuilder.Entity<MenuitemHasAllergie>(entity =>
|
||||||
|
@ -89,12 +89,13 @@
|
|||||||
{
|
{
|
||||||
localStorage.SetItem("RabattEinloesen", false);
|
localStorage.SetItem("RabattEinloesen", false);
|
||||||
localStorage.SetItem("Summe", summe);
|
localStorage.SetItem("Summe", summe);
|
||||||
// if summe > 8€ add treuepunkte
|
|
||||||
if (summe >= 8)
|
if (summe >= 8)
|
||||||
{
|
{
|
||||||
kunde.Treuepunkte++;
|
if (kunde.Treuepunkte < 10)
|
||||||
// add treuepunkte to API
|
{
|
||||||
Http.PutAsJsonAsync("https://localhost:7076/api/kunden/" + kunde.Idkunde, kunde);
|
kunde.Treuepunkte++;
|
||||||
|
Http.PutAsJsonAsync("https://localhost:7076/api/kunden/" + kunde.Idkunde, kunde);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,12 +139,20 @@
|
|||||||
|
|
||||||
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;
|
||||||
|
|
||||||
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;
|
month = bestellungsposition.Datum.Month;
|
||||||
year = bestellungsposition.Datum.Year;
|
year = bestellungsposition.Datum.Year;
|
||||||
|
|
||||||
@*print kunde.code, hour and minute from last bestellungsposition*@
|
@*print only if date is higher than now datum, all expired hh:mm unvisible *@
|
||||||
@*print only if date is higher than now datum *@
|
@*if (bestellungsposition.Datum > DateTime.Now)
|
||||||
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>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@ -55,7 +66,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
@*}*@
|
|
||||||
firstTime = false;
|
firstTime = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,17 +75,17 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3">
|
<div class="col-lg-3">
|
||||||
<p id="text" readonly>Abholzeit</p>
|
@* <p id="text" readonly>Abholzeit</p>
|
||||||
<br />
|
<br />
|
||||||
<form id="button" action="Bestelluebersicht">
|
<form id="button" action="Bestelluebersicht">
|
||||||
<input type="submit" value="30 Min" class="btn">
|
<input type="submit" value="30 Min" class="btn">
|
||||||
</form>
|
</form>
|
||||||
<form id="button" action="Bestelluebersicht">
|
<form id="button" action="Bestelluebersicht">
|
||||||
<input type="submit" value="45 Min" class="btn">
|
<input type="submit" value="45 Min" class="btn">
|
||||||
</form>
|
</form>
|
||||||
<form id="button" action="Bestelluebersicht">
|
<form id="button" action="Bestelluebersicht">
|
||||||
<input type="submit" value="1 Std" class="btn">
|
<input type="submit" value="1 Std" class="btn">
|
||||||
</form>
|
</form>*@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -118,6 +128,22 @@
|
|||||||
month = DateTime.Now.Month;
|
month = DateTime.Now.Month;
|
||||||
year = DateTime.Now.Year;
|
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
|
public class Bestellungsposition
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
<div class="d-flex flex-column" style="align-items: center; margin-left: 100px;">
|
<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_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>*@
|
@*<button class="btn_forward w-75">Bestellung abschließen</button>*@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -150,6 +150,25 @@
|
|||||||
localStorage.Clear();
|
localStorage.Clear();
|
||||||
_navigationManager.NavigateTo("/");
|
_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()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
// get data from api
|
// get data from api
|
||||||
|
Loading…
Reference in New Issue
Block a user