mirror of
https://github.com/yummy4friends/y4f.git
synced 2025-07-17 19:33:17 +02:00
Compare commits
1 Commits
3356a91d47
...
workflow/T
Author | SHA1 | Date | |
---|---|---|---|
59ff664ffe |
23
.github/workflows/dotnet.yml
vendored
Normal file
23
.github/workflows/dotnet.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: Test if program still runs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "dev" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "dev" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: 7.0.107
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore
|
||||||
|
- name: Build
|
||||||
|
run: dotnet build --no-restore
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -136,5 +136,3 @@ $RECYCLE.BIN/
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
_NCrunch*
|
_NCrunch*
|
||||||
/src/WebApi/appsettings.json
|
|
||||||
/src/WebApi/appsettings.json
|
|
||||||
|
@ -1,138 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using WebApi.Data;
|
|
||||||
using WebApi.Models;
|
|
||||||
|
|
||||||
namespace WebApi.Controllers
|
|
||||||
{
|
|
||||||
[Route("api/[controller]")]
|
|
||||||
[ApiController]
|
|
||||||
public class BestellungspositionHasMenuitemsController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly WebApiContext _context;
|
|
||||||
|
|
||||||
public BestellungspositionHasMenuitemsController(WebApiContext context)
|
|
||||||
{
|
|
||||||
_context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: api/BestellungspositionHasMenuitems
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<ActionResult<IEnumerable<BestellungspositionHasMenuitem>>> GetBestellungspositionHasMenuitem()
|
|
||||||
{
|
|
||||||
if (_context.BestellungspositionHasMenuitem == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
return await _context.BestellungspositionHasMenuitem.ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: api/BestellungspositionHasMenuitems/5
|
|
||||||
[HttpGet("{id}")]
|
|
||||||
public async Task<ActionResult<BestellungspositionHasMenuitem>> GetBestellungspositionHasMenuitem(int? id)
|
|
||||||
{
|
|
||||||
if (_context.BestellungspositionHasMenuitem == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
var bestellungspositionHasMenuitem = await _context.BestellungspositionHasMenuitem.FindAsync(id);
|
|
||||||
|
|
||||||
if (bestellungspositionHasMenuitem == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return bestellungspositionHasMenuitem;
|
|
||||||
}
|
|
||||||
|
|
||||||
// PUT: api/BestellungspositionHasMenuitems/5
|
|
||||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
|
||||||
[HttpPut("{id}")]
|
|
||||||
public async Task<IActionResult> PutBestellungspositionHasMenuitem(int? id, BestellungspositionHasMenuitem bestellungspositionHasMenuitem)
|
|
||||||
{
|
|
||||||
if (id != bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung)
|
|
||||||
{
|
|
||||||
return BadRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
_context.Entry(bestellungspositionHasMenuitem).State = EntityState.Modified;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
catch (DbUpdateConcurrencyException)
|
|
||||||
{
|
|
||||||
if (!BestellungspositionHasMenuitemExists(id))
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NoContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: api/BestellungspositionHasMenuitems
|
|
||||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ActionResult<BestellungspositionHasMenuitem>> PostBestellungspositionHasMenuitem(BestellungspositionHasMenuitem bestellungspositionHasMenuitem)
|
|
||||||
{
|
|
||||||
if (_context.BestellungspositionHasMenuitem == null)
|
|
||||||
{
|
|
||||||
return Problem("Entity set 'WebApiContext.BestellungspositionHasMenuitem' is null.");
|
|
||||||
}
|
|
||||||
_context.BestellungspositionHasMenuitem.Add(bestellungspositionHasMenuitem);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
catch (DbUpdateException)
|
|
||||||
{
|
|
||||||
if (BestellungspositionHasMenuitemExists(bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung))
|
|
||||||
{
|
|
||||||
return Conflict();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return CreatedAtAction("GetBestellungspositionHasMenuitem", new { id = bestellungspositionHasMenuitem.Bestellungsposition_IDBestellung }, bestellungspositionHasMenuitem);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DELETE: api/BestellungspositionHasMenuitems/5
|
|
||||||
[HttpDelete("{id}")]
|
|
||||||
public async Task<IActionResult> DeleteBestellungspositionHasMenuitem(int? id)
|
|
||||||
{
|
|
||||||
if (_context.BestellungspositionHasMenuitem == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
var bestellungspositionHasMenuitem = await _context.BestellungspositionHasMenuitem.FindAsync(id);
|
|
||||||
if (bestellungspositionHasMenuitem == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
_context.BestellungspositionHasMenuitem.Remove(bestellungspositionHasMenuitem);
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
return NoContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool BestellungspositionHasMenuitemExists(int? id)
|
|
||||||
{
|
|
||||||
return (_context.BestellungspositionHasMenuitem?.Any(e => e.Bestellungsposition_IDBestellung == id)).GetValueOrDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,138 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using WebApi.Data;
|
|
||||||
using WebApi.Models;
|
|
||||||
|
|
||||||
namespace WebApi.Controllers
|
|
||||||
{
|
|
||||||
[Route("api/[controller]")]
|
|
||||||
[ApiController]
|
|
||||||
public class MenuitemHasAllergiesController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly WebApiContext _context;
|
|
||||||
|
|
||||||
public MenuitemHasAllergiesController(WebApiContext context)
|
|
||||||
{
|
|
||||||
_context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: api/MenuitemHasAllergies
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<ActionResult<IEnumerable<MenuitemHasAllergie>>> GetMenuitemHasAllergie()
|
|
||||||
{
|
|
||||||
if (_context.MenuitemHasAllergie == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
return await _context.MenuitemHasAllergie.ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: api/MenuitemHasAllergies/5
|
|
||||||
[HttpGet("{id}")]
|
|
||||||
public async Task<ActionResult<MenuitemHasAllergie>> GetMenuitemHasAllergie(int? id)
|
|
||||||
{
|
|
||||||
if (_context.MenuitemHasAllergie == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
var menuitemHasAllergie = await _context.MenuitemHasAllergie.FindAsync(id);
|
|
||||||
|
|
||||||
if (menuitemHasAllergie == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return menuitemHasAllergie;
|
|
||||||
}
|
|
||||||
|
|
||||||
// PUT: api/MenuitemHasAllergies/5
|
|
||||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
|
||||||
[HttpPut("{id}")]
|
|
||||||
public async Task<IActionResult> PutMenuitemHasAllergie(int? id, MenuitemHasAllergie menuitemHasAllergie)
|
|
||||||
{
|
|
||||||
if (id != menuitemHasAllergie.MenuItem_IDMenuItem)
|
|
||||||
{
|
|
||||||
return BadRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
_context.Entry(menuitemHasAllergie).State = EntityState.Modified;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
catch (DbUpdateConcurrencyException)
|
|
||||||
{
|
|
||||||
if (!MenuitemHasAllergieExists(id))
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NoContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: api/MenuitemHasAllergies
|
|
||||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ActionResult<MenuitemHasAllergie>> PostMenuitemHasAllergie(MenuitemHasAllergie menuitemHasAllergie)
|
|
||||||
{
|
|
||||||
if (_context.MenuitemHasAllergie == null)
|
|
||||||
{
|
|
||||||
return Problem("Entity set 'WebApiContext.MenuitemHasAllergie' is null.");
|
|
||||||
}
|
|
||||||
_context.MenuitemHasAllergie.Add(menuitemHasAllergie);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
catch (DbUpdateException)
|
|
||||||
{
|
|
||||||
if (MenuitemHasAllergieExists(menuitemHasAllergie.MenuItem_IDMenuItem))
|
|
||||||
{
|
|
||||||
return Conflict();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return CreatedAtAction("GetMenuitemHasAllergie", new { id = menuitemHasAllergie.MenuItem_IDMenuItem }, menuitemHasAllergie);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DELETE: api/MenuitemHasAllergies/5
|
|
||||||
[HttpDelete("{id}")]
|
|
||||||
public async Task<IActionResult> DeleteMenuitemHasAllergie(int? id)
|
|
||||||
{
|
|
||||||
if (_context.MenuitemHasAllergie == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
var menuitemHasAllergie = await _context.MenuitemHasAllergie.FindAsync(id);
|
|
||||||
if (menuitemHasAllergie == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
_context.MenuitemHasAllergie.Remove(menuitemHasAllergie);
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
return NoContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool MenuitemHasAllergieExists(int? id)
|
|
||||||
{
|
|
||||||
return (_context.MenuitemHasAllergie?.Any(e => e.MenuItem_IDMenuItem == id)).GetValueOrDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,239 +7,231 @@ namespace WebApi.Data;
|
|||||||
|
|
||||||
public partial class WebApiContext : DbContext
|
public partial class WebApiContext : DbContext
|
||||||
{
|
{
|
||||||
public WebApiContext(DbContextOptions<WebApiContext> options)
|
public WebApiContext(DbContextOptions<WebApiContext> options)
|
||||||
: base(options)
|
: base(options)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual DbSet<Allergie> Allergies { get; set; }
|
public virtual DbSet<Allergie> Allergies { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Bestellungsposition> Bestellungspositions { get; set; }
|
public virtual DbSet<Bestellungsposition> Bestellungspositions { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Kunde> Kundes { get; set; }
|
public virtual DbSet<Kunde> Kundes { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Menuitem> Menuitems { get; set; }
|
public virtual DbSet<Menuitem> Menuitems { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Menuitemkategorie> Menuitemkategories { get; set; }
|
public virtual DbSet<Menuitemkategorie> Menuitemkategories { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Menuitemueberkategorie> Menuitemueberkategories { get; set; }
|
public virtual DbSet<Menuitemueberkategorie> Menuitemueberkategories { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Rabatt> Rabatts { get; set; }
|
public virtual DbSet<Rabatt> Rabatts { get; set; }
|
||||||
public virtual DbSet<MenuitemHasAllergie> MenuitemHasAllergie { get; set; }
|
public virtual DbSet<Admin> Admins{ get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Admin> Admins { get; set; }
|
|
||||||
|
|
||||||
public virtual DbSet<BestellungspositionHasMenuitem> BestellungspositionHasMenuitem { get; set; }
|
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.UseCollation("utf8_general_ci")
|
.UseCollation("utf8_general_ci")
|
||||||
.HasCharSet("utf8");
|
.HasCharSet("utf8");
|
||||||
|
|
||||||
modelBuilder.Entity<Allergie>(entity =>
|
modelBuilder.Entity<Allergie>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Idallergie).HasName("PRIMARY");
|
entity.HasKey(e => e.Idallergie).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.ToTable("allergie");
|
entity.ToTable("allergie");
|
||||||
|
|
||||||
entity.Property(e => e.Idallergie)
|
entity.Property(e => e.Idallergie)
|
||||||
.ValueGeneratedNever()
|
.ValueGeneratedNever()
|
||||||
.HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("IDAllergie");
|
.HasColumnName("IDAllergie");
|
||||||
entity.Property(e => e.Beschreibung).HasMaxLength(45);
|
entity.Property(e => e.Beschreibung).HasMaxLength(45);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<Bestellungsposition>(entity =>
|
modelBuilder.Entity<Bestellungsposition>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Idbestellung).HasName("PRIMARY");
|
entity.HasKey(e => e.Idbestellung).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.ToTable("bestellungsposition");
|
entity.ToTable("bestellungsposition");
|
||||||
|
|
||||||
entity.HasIndex(e => e.KundeIdkunde, "fk_Bestellung_Kunde");
|
entity.HasIndex(e => e.KundeIdkunde, "fk_Bestellung_Kunde");
|
||||||
|
|
||||||
entity.HasIndex(e => e.RabattIdrabatt, "fk_Bestellungsposition_Rabatt1");
|
entity.HasIndex(e => e.RabattIdrabatt, "fk_Bestellungsposition_Rabatt1");
|
||||||
|
|
||||||
entity.Property(e => e.Idbestellung)
|
entity.Property(e => e.Idbestellung)
|
||||||
.ValueGeneratedNever()
|
.ValueGeneratedNever()
|
||||||
.HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("IDBestellung");
|
.HasColumnName("IDBestellung");
|
||||||
entity.Property(e => e.Datum).HasColumnType("datetime");
|
entity.Property(e => e.Datum).HasColumnType("datetime");
|
||||||
entity.Property(e => e.KundeIdkunde)
|
entity.Property(e => e.KundeIdkunde)
|
||||||
.HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("Kunde_IDKunde");
|
.HasColumnName("Kunde_IDKunde");
|
||||||
entity.Property(e => e.Menge).HasColumnType("int(11)");
|
entity.Property(e => e.Menge).HasColumnType("int(11)");
|
||||||
entity.Property(e => e.RabattIdrabatt)
|
entity.Property(e => e.RabattIdrabatt)
|
||||||
.HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("Rabatt_IDRabatt");
|
.HasColumnName("Rabatt_IDRabatt");
|
||||||
|
|
||||||
entity.HasOne(d => d.KundeIdkundeNavigation).WithMany(p => p.Bestellungspositions)
|
entity.HasOne(d => d.KundeIdkundeNavigation).WithMany(p => p.Bestellungspositions)
|
||||||
.HasForeignKey(d => d.KundeIdkunde)
|
.HasForeignKey(d => d.KundeIdkunde)
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
.HasConstraintName("fk_Bestellung_Kunde");
|
.HasConstraintName("fk_Bestellung_Kunde");
|
||||||
|
|
||||||
entity.HasOne(d => d.RabattIdrabattNavigation).WithMany(p => p.Bestellungspositions)
|
entity.HasOne(d => d.RabattIdrabattNavigation).WithMany(p => p.Bestellungspositions)
|
||||||
.HasForeignKey(d => d.RabattIdrabatt)
|
.HasForeignKey(d => d.RabattIdrabatt)
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
.HasConstraintName("fk_Bestellungsposition_Rabatt1");
|
.HasConstraintName("fk_Bestellungsposition_Rabatt1");
|
||||||
|
|
||||||
//entity.HasMany(d => d.MenuItemIdmenuItems).WithMany(p => p.BestellungspositionIdbestellungs)
|
entity.HasMany(d => d.MenuItemIdmenuItems).WithMany(p => p.BestellungspositionIdbestellungs)
|
||||||
// .UsingEntity<Dictionary<string, object>>(
|
.UsingEntity<Dictionary<string, object>>(
|
||||||
// "BestellungspositionHasMenuitem",
|
"BestellungspositionHasMenuitem",
|
||||||
// r => r.HasOne<Menuitem>().WithMany()
|
r => r.HasOne<Menuitem>().WithMany()
|
||||||
// .HasForeignKey("MenuItemIdmenuItem")
|
.HasForeignKey("MenuItemIdmenuItem")
|
||||||
// .OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
// .HasConstraintName("fk_Bestellungsposition_has_MenuItem_MenuItem1"),
|
.HasConstraintName("fk_Bestellungsposition_has_MenuItem_MenuItem1"),
|
||||||
// l => l.HasOne<Bestellungsposition>().WithMany()
|
l => l.HasOne<Bestellungsposition>().WithMany()
|
||||||
// .HasForeignKey("BestellungspositionIdbestellung")
|
.HasForeignKey("BestellungspositionIdbestellung")
|
||||||
// .OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
// .HasConstraintName("fk_Bestellungsposition_has_MenuItem_Bestellungsposition1"),
|
.HasConstraintName("fk_Bestellungsposition_has_MenuItem_Bestellungsposition1"),
|
||||||
// j =>
|
j =>
|
||||||
// {
|
{
|
||||||
// j.HasKey("BestellungspositionIdbestellung", "MenuItemIdmenuItem")
|
j.HasKey("BestellungspositionIdbestellung", "MenuItemIdmenuItem")
|
||||||
// .HasName("PRIMARY")
|
.HasName("PRIMARY")
|
||||||
// .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });
|
.HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });
|
||||||
// j.ToTable("bestellungsposition_has_menuitem");
|
j.ToTable("bestellungsposition_has_menuitem");
|
||||||
// j.HasIndex(new[] { "MenuItemIdmenuItem" }, "fk_Bestellungsposition_has_MenuItem_MenuItem1");
|
j.HasIndex(new[] { "MenuItemIdmenuItem" }, "fk_Bestellungsposition_has_MenuItem_MenuItem1");
|
||||||
// j.IndexerProperty<int>("BestellungspositionIdbestellung")
|
j.IndexerProperty<int>("BestellungspositionIdbestellung")
|
||||||
// .HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
// .HasColumnName("Bestellungsposition_IDBestellung");
|
.HasColumnName("Bestellungsposition_IDBestellung");
|
||||||
// j.IndexerProperty<int>("MenuItemIdmenuItem")
|
j.IndexerProperty<int>("MenuItemIdmenuItem")
|
||||||
// .HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
// .HasColumnName("MenuItem_IDMenuItem");
|
.HasColumnName("MenuItem_IDMenuItem");
|
||||||
// });
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<Kunde>(entity =>
|
modelBuilder.Entity<Kunde>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Idkunde).HasName("PRIMARY");
|
entity.HasKey(e => e.Idkunde).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.ToTable("kunde");
|
entity.ToTable("kunde");
|
||||||
|
|
||||||
entity.Property(e => e.Idkunde)
|
entity.Property(e => e.Idkunde)
|
||||||
.ValueGeneratedNever()
|
.ValueGeneratedNever()
|
||||||
.HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("IDKunde");
|
.HasColumnName("IDKunde");
|
||||||
entity.Property(e => e.Code)
|
entity.Property(e => e.Code)
|
||||||
.HasMaxLength(45)
|
.HasMaxLength(45)
|
||||||
.HasColumnName("code");
|
.HasColumnName("code");
|
||||||
entity.Property(e => e.Treuepunkte).HasColumnType("int(11)");
|
entity.Property(e => e.Treuepunkte).HasColumnType("int(11)");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<Menuitem>(entity =>
|
modelBuilder.Entity<Menuitem>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.IdmenuItem).HasName("PRIMARY");
|
entity.HasKey(e => e.IdmenuItem).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.ToTable("menuitem");
|
entity.ToTable("menuitem");
|
||||||
|
|
||||||
entity.HasIndex(e => e.MenuItemKategorieIdmenuItemKategorie, "fk_MenuItem_MenuItemKategorie1");
|
entity.HasIndex(e => e.MenuItemKategorieIdmenuItemKategorie, "fk_MenuItem_MenuItemKategorie1");
|
||||||
|
|
||||||
entity.Property(e => e.IdmenuItem)
|
entity.Property(e => e.IdmenuItem)
|
||||||
.ValueGeneratedNever()
|
.ValueGeneratedNever()
|
||||||
.HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("IDMenuItem");
|
.HasColumnName("IDMenuItem");
|
||||||
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
||||||
entity.Property(e => e.MenuItemKategorieIdmenuItemKategorie)
|
entity.Property(e => e.MenuItemKategorieIdmenuItemKategorie)
|
||||||
.HasColumnType("int(11)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("MenuItemKategorie_IDMenuItemKategorie");
|
.HasColumnName("MenuItemKategorie_IDMenuItemKategorie");
|
||||||
entity.Property(e => e.Preis).HasPrecision(8, 2);
|
entity.Property(e => e.Preis).HasPrecision(8, 2);
|
||||||
entity.Property(e => e.Zusatzinformation).HasMaxLength(45);
|
entity.Property(e => e.Zusatzinformation).HasMaxLength(45);
|
||||||
|
|
||||||
entity.HasOne(d => d.MenuItemKategorieIdmenuItemKategorieNavigation).WithMany(p => p.Menuitems)
|
entity.HasOne(d => d.MenuItemKategorieIdmenuItemKategorieNavigation).WithMany(p => p.Menuitems)
|
||||||
.HasForeignKey(d => d.MenuItemKategorieIdmenuItemKategorie)
|
.HasForeignKey(d => d.MenuItemKategorieIdmenuItemKategorie)
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
.HasConstraintName("fk_MenuItem_MenuItemKategorie1");
|
.HasConstraintName("fk_MenuItem_MenuItemKategorie1");
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<Menuitemkategorie>(entity =>
|
entity.HasMany(d => d.AllergieIdallergies).WithMany(p => p.MenuItemIdmenuItems)
|
||||||
{
|
.UsingEntity<Dictionary<string, object>>(
|
||||||
entity.HasKey(e => e.IdmenuItemKategorie).HasName("PRIMARY");
|
"MenuitemHasAllergie",
|
||||||
|
r => r.HasOne<Allergie>().WithMany()
|
||||||
|
.HasForeignKey("AllergieIdallergie")
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("fk_MenuItem_has_Allergie_Allergie1"),
|
||||||
|
l => l.HasOne<Menuitem>().WithMany()
|
||||||
|
.HasForeignKey("MenuItemIdmenuItem")
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("fk_MenuItem_has_Allergie_MenuItem1"),
|
||||||
|
j =>
|
||||||
|
{
|
||||||
|
j.HasKey("MenuItemIdmenuItem", "AllergieIdallergie")
|
||||||
|
.HasName("PRIMARY")
|
||||||
|
.HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });
|
||||||
|
j.ToTable("menuitem_has_allergie");
|
||||||
|
j.HasIndex(new[] { "AllergieIdallergie" }, "fk_MenuItem_has_Allergie_Allergie1");
|
||||||
|
j.IndexerProperty<int>("MenuItemIdmenuItem")
|
||||||
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("MenuItem_IDMenuItem");
|
||||||
|
j.IndexerProperty<int>("AllergieIdallergie")
|
||||||
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("Allergie_IDAllergie");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
entity.ToTable("menuitemkategorie");
|
modelBuilder.Entity<Menuitemkategorie>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdmenuItemKategorie).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.HasIndex(e => e.MenuItemUeberkategorieIdmenuItemUeberkategorie, "fk_MenuItemKategorie_MenuItemUeberkategorie1");
|
entity.ToTable("menuitemkategorie");
|
||||||
|
|
||||||
entity.Property(e => e.IdmenuItemKategorie)
|
entity.HasIndex(e => e.MenuItemUeberkategorieIdmenuItemUeberkategorie, "fk_MenuItemKategorie_MenuItemUeberkategorie1");
|
||||||
.ValueGeneratedNever()
|
|
||||||
.HasColumnType("int(11)")
|
|
||||||
.HasColumnName("IDMenuItemKategorie");
|
|
||||||
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
|
||||||
entity.Property(e => e.MenuItemUeberkategorieIdmenuItemUeberkategorie)
|
|
||||||
.HasColumnType("int(11)")
|
|
||||||
.HasColumnName("MenuItemUeberkategorie_IDMenuItemUeberkategorie");
|
|
||||||
|
|
||||||
entity.HasOne(d => d.MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation).WithMany(p => p.Menuitemkategories)
|
entity.Property(e => e.IdmenuItemKategorie)
|
||||||
.HasForeignKey(d => d.MenuItemUeberkategorieIdmenuItemUeberkategorie)
|
.ValueGeneratedNever()
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.HasColumnType("int(11)")
|
||||||
.HasConstraintName("fk_MenuItemKategorie_MenuItemUeberkategorie1");
|
.HasColumnName("IDMenuItemKategorie");
|
||||||
});
|
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
||||||
|
entity.Property(e => e.MenuItemUeberkategorieIdmenuItemUeberkategorie)
|
||||||
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("MenuItemUeberkategorie_IDMenuItemUeberkategorie");
|
||||||
|
|
||||||
modelBuilder.Entity<Menuitemueberkategorie>(entity =>
|
entity.HasOne(d => d.MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation).WithMany(p => p.Menuitemkategories)
|
||||||
{
|
.HasForeignKey(d => d.MenuItemUeberkategorieIdmenuItemUeberkategorie)
|
||||||
entity.HasKey(e => e.IdmenuItemUeberkategorie).HasName("PRIMARY");
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("fk_MenuItemKategorie_MenuItemUeberkategorie1");
|
||||||
|
});
|
||||||
|
|
||||||
entity.ToTable("menuitemueberkategorie");
|
modelBuilder.Entity<Menuitemueberkategorie>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdmenuItemUeberkategorie).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.Property(e => e.IdmenuItemUeberkategorie)
|
entity.ToTable("menuitemueberkategorie");
|
||||||
.ValueGeneratedNever()
|
|
||||||
.HasColumnType("int(11)")
|
|
||||||
.HasColumnName("IDMenuItemUeberkategorie");
|
|
||||||
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<Rabatt>(entity =>
|
entity.Property(e => e.IdmenuItemUeberkategorie)
|
||||||
{
|
.ValueGeneratedNever()
|
||||||
entity.HasKey(e => e.Idrabatt).HasName("PRIMARY");
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("IDMenuItemUeberkategorie");
|
||||||
|
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
||||||
|
});
|
||||||
|
|
||||||
entity.ToTable("rabatt");
|
modelBuilder.Entity<Rabatt>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Idrabatt).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.Property(e => e.Idrabatt)
|
entity.ToTable("rabatt");
|
||||||
.ValueGeneratedNever()
|
|
||||||
.HasColumnType("int(11)")
|
|
||||||
.HasColumnName("IDRabatt");
|
|
||||||
entity.Property(e => e.GueltigkeitBis).HasColumnType("datetime");
|
|
||||||
entity.Property(e => e.GueltigkeitVon).HasColumnType("datetime");
|
|
||||||
entity.Property(e => e.Prozent).HasPrecision(8, 2);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<Admin>(entity =>
|
entity.Property(e => e.Idrabatt)
|
||||||
{
|
.ValueGeneratedNever()
|
||||||
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
.HasColumnType("int(11)")
|
||||||
entity.ToTable("admin");
|
.HasColumnName("IDRabatt");
|
||||||
entity.Property(e => e.Id)
|
entity.Property(e => e.GueltigkeitBis).HasColumnType("datetime");
|
||||||
.ValueGeneratedNever()
|
entity.Property(e => e.GueltigkeitVon).HasColumnType("datetime");
|
||||||
.HasColumnType("int(11)")
|
entity.Property(e => e.Prozent).HasPrecision(8, 2);
|
||||||
.HasColumnName("Id");
|
});
|
||||||
entity.Property(e => e.Username).HasMaxLength(100);
|
|
||||||
entity.Property(e => e.Password).HasMaxLength(100);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<BestellungspositionHasMenuitem>(entity =>
|
modelBuilder.Entity<Admin>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => new { e.Bestellungsposition_IDBestellung, e.MenuItem_IDMenuItem })
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
.HasName("PRIMARY");
|
entity.ToTable("admin");
|
||||||
|
});
|
||||||
|
|
||||||
entity.ToTable("bestellungsposition_has_menuitem");
|
OnModelCreatingPartial(modelBuilder);
|
||||||
|
}
|
||||||
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 =>
|
|
||||||
{
|
|
||||||
entity.HasKey(e => new { e.MenuItem_IDMenuItem, e.Allergie_IDAllergie })
|
|
||||||
.HasName("PRIMARY");
|
|
||||||
|
|
||||||
entity.ToTable("menuitem_has_allergie");
|
|
||||||
|
|
||||||
entity.Property(e => e.MenuItem_IDMenuItem).HasColumnType("int(11)");
|
|
||||||
entity.Property(e => e.Allergie_IDAllergie).HasColumnType("int(11)");
|
|
||||||
});
|
|
||||||
|
|
||||||
OnModelCreatingPartial(modelBuilder);
|
|
||||||
}
|
|
||||||
|
|
||||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace WebApi.Models;
|
namespace WebApi.Models;
|
||||||
|
|
||||||
public partial class Bestellungsposition
|
public partial class Bestellungsposition
|
||||||
{
|
{
|
||||||
public int Idbestellung { get; set; }
|
public int Idbestellung { get; set; }
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
public int? Menge { get; set; }
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
public DateTime? Datum { get; set; }
|
||||||
|
|
||||||
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!;
|
||||||
|
|
||||||
public virtual Rabatt? RabattIdrabattNavigation { get; set; } = null!;
|
public virtual Rabatt RabattIdrabattNavigation { get; set; } = null!;
|
||||||
|
|
||||||
public virtual ICollection<Menuitem>? MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
||||||
}
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace WebApi.Models;
|
|
||||||
|
|
||||||
public partial class BestellungspositionHasMenuitem
|
|
||||||
{
|
|
||||||
public int? Bestellungsposition_IDBestellung { get; set; }
|
|
||||||
|
|
||||||
public int? MenuItem_IDMenuItem { get; set; }
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
namespace WebApi.Models
|
|
||||||
{
|
|
||||||
public class MenuitemHasAllergie
|
|
||||||
{
|
|
||||||
// navigation references Menuitem
|
|
||||||
public int? MenuItem_IDMenuItem { get; set; }
|
|
||||||
|
|
||||||
// navigation references Allergie
|
|
||||||
public int? Allergie_IDAllergie { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
12
src/WebApi/appsettings.json
Normal file
12
src/WebApi/appsettings.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"Y4FDB": "Server=localhost;Database=y4f;Uid=user;Pwd=user"
|
||||||
|
}
|
||||||
|
}
|
@ -1,125 +1,90 @@
|
|||||||
@page "/allergene"
|
@page "/allergene"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
<PageTitle>Allergene</PageTitle>
|
<PageTitle>Allergene</PageTitle>
|
||||||
|
|
||||||
<table class="tg">
|
<table class="tg">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="tg-c3ow" colspan="3">Allergeninformation<br>gemäß Codex-Empfehlung </th>
|
<th class="tg-c3ow" colspan="3">Allergeninformation<br>gemäß Codex-Empfehlung </th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky">Visuelles</td>
|
<td class="tg-0pky">Visuelles</td>
|
||||||
<td class="tg-0pky">Kurzbezeichnung</td>
|
<td class="tg-0pky">Kurzbezeichnung</td>
|
||||||
<td class="tg-0pky">Buchstabencode</td>
|
<td class="tg-0pky">Buchstabencode</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/getreide.png" alt="Getreide"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/getreide.png" alt="Getreide"></td>
|
||||||
<td class="tg-0pky">glutenhaltiges Getreide</td>
|
<td class="tg-0pky">glutenhaltiges Getreide</td>
|
||||||
<td class="tg-c3ow">A</td>
|
<td class="tg-c3ow">A</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/krebstiere.png" alt="Krebstiere"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/krebstiere.png" alt="Krebstiere"></td>
|
||||||
<td class="tg-0pky">Krebstiere</td>
|
<td class="tg-0pky">Krebstiere</td>
|
||||||
<td class="tg-c3ow">B</td>
|
<td class="tg-c3ow">B</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/ei.png" alt="Ei"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/ei.png" alt="Ei"></td>
|
||||||
<td class="tg-0pky">Ei</td>
|
<td class="tg-0pky">Ei</td>
|
||||||
<td class="tg-c3ow">C</td>
|
<td class="tg-c3ow">C</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/fisch.png" alt="Fisch"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/fisch.png" alt="Fisch"></td>
|
||||||
<td class="tg-0pky">Fisch</td>
|
<td class="tg-0pky">Fisch</td>
|
||||||
<td class="tg-c3ow">D</td>
|
<td class="tg-c3ow">D</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/erdnuss.png" alt="Erdnuss"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/erdnuss.png" alt="Erdnuss"></td>
|
||||||
<td class="tg-0pky">Erdnuss</td>
|
<td class="tg-0pky">Erdnuss</td>
|
||||||
<td class="tg-c3ow">E</td>
|
<td class="tg-c3ow">E</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/soja.png" alt="Soja"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/soja.png" alt="Soja"></td>
|
||||||
<td class="tg-0pky">Soja</td>
|
<td class="tg-0pky">Soja</td>
|
||||||
<td class="tg-c3ow">F</td>
|
<td class="tg-c3ow">F</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/milch.png" alt="Milch oder Laktose"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/milch.png" alt="Milch oder Laktose"></td>
|
||||||
<td class="tg-0pky">Milch oder Laktose</td>
|
<td class="tg-0pky">Milch oder Laktose</td>
|
||||||
<td class="tg-c3ow">G</td>
|
<td class="tg-c3ow">G</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/schalenfruechte.png" alt="Schalenfrüchte"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/schalenfruechte.png" alt="Schalenfrüchte"></td>
|
||||||
<td class="tg-0pky">Schalenfrüchte</td>
|
<td class="tg-0pky">Schalenfrüchte</td>
|
||||||
<td class="tg-c3ow">H</td>
|
<td class="tg-c3ow">H</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/sellerie.png" alt="Sellerie"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/sellerie.png" alt="Sellerie"></td>
|
||||||
<td class="tg-0pky">Sellerie</td>
|
<td class="tg-0pky">Sellerie</td>
|
||||||
<td class="tg-c3ow">L</td>
|
<td class="tg-c3ow">L</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/senf.png" alt="Senf"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/senf.png" alt="Senf"></td>
|
||||||
<td class="tg-0pky">Senf</td>
|
<td class="tg-0pky">Senf</td>
|
||||||
<td class="tg-c3ow">M</td>
|
<td class="tg-c3ow">M</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/sesam.png" alt="Sesam"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/sesam.png" alt="Sesam"></td>
|
||||||
<td class="tg-0pky">Sesam</td>
|
<td class="tg-0pky">Sesam</td>
|
||||||
<td class="tg-c3ow">N</td>
|
<td class="tg-c3ow">N</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/sulfite.png" alt="Sulfite"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/sulfite.png" alt="Sulfite"></td>
|
||||||
<td class="tg-0pky">Sulfite</td>
|
<td class="tg-0pky">Sulfite</td>
|
||||||
<td class="tg-c3ow">O</td>
|
<td class="tg-c3ow">O</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/lupinen.png" alt="Lupinen"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/lupinen.png" alt="Lupinen"></td>
|
||||||
<td class="tg-0pky">Lupinen</td>
|
<td class="tg-0pky">Lupinen</td>
|
||||||
<td class="tg-c3ow">P</td>
|
<td class="tg-c3ow">P</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-0pky"><img class="icon" src="assets/weichtiere.png" alt="Weichtiere"></td>
|
<td class="tg-0pky"><img class="icon" src="assets/weichtiere.png" alt="Weichtiere"></td>
|
||||||
<td class="tg-0pky">Weichtiere</td>
|
<td class="tg-0pky">Weichtiere</td>
|
||||||
<td class="tg-c3ow">R</td>
|
<td class="tg-c3ow">R</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br>
|
<br><br><br><br>
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
|
|
@ -1,33 +1,5 @@
|
|||||||
@page "/cookies"
|
@page "/cookies"
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="">
|
||||||
<head>
|
<head>
|
||||||
|
@ -1,33 +1,5 @@
|
|||||||
@page "/datenschutzerklärung"
|
@page "/datenschutzerklärung"
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="">
|
||||||
<head>
|
<head>
|
||||||
|
57
src/y4f/Pages/FetchData.razor
Normal file
57
src/y4f/Pages/FetchData.razor
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
@page "/fetchdata"
|
||||||
|
@inject HttpClient Http
|
||||||
|
|
||||||
|
<PageTitle>Weather forecast</PageTitle>
|
||||||
|
|
||||||
|
<h1>Weather forecast</h1>
|
||||||
|
|
||||||
|
<p>This component demonstrates fetching data from the server.</p>
|
||||||
|
|
||||||
|
@if (forecasts == null)
|
||||||
|
{
|
||||||
|
<p><em>Loading...</em></p>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Temp. (C)</th>
|
||||||
|
<th>Temp. (F)</th>
|
||||||
|
<th>Summary</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach (var forecast in forecasts)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>@forecast.Date.ToShortDateString()</td>
|
||||||
|
<td>@forecast.TemperatureC</td>
|
||||||
|
<td>@forecast.TemperatureF</td>
|
||||||
|
<td>@forecast.Summary</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
}
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private WeatherForecast[]? forecasts;
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WeatherForecast
|
||||||
|
{
|
||||||
|
public DateOnly Date { get; set; }
|
||||||
|
|
||||||
|
public int TemperatureC { get; set; }
|
||||||
|
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
|
||||||
|
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||||
|
}
|
||||||
|
}
|
@ -1,56 +1,20 @@
|
|||||||
@page "/"
|
@page "/"
|
||||||
@layout Startseite
|
@layout Startseite
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<PageTitle>Yummy4Friends</PageTitle>
|
<PageTitle>Yummy4Friends</PageTitle>
|
||||||
|
|
||||||
|
|
||||||
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%"; background-color:#C7FFD5;'>
|
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%"; background-color:#C7FFD5;'>
|
||||||
|
<div class="container col-lg-6 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
|
<center><h1>Herzlich Willkommen!</h1></center>
|
||||||
|
|
||||||
<div class="container col-lg-6 col-md-9 col-sm-12 d-flex flex-column " id="content" style=" padding-left:10%; padding-right:10%;">
|
<img src="assets/Logo_new.png" class="img" title="logo image">
|
||||||
<center><h1>Herzlich Willkommen!</h1></center>
|
|
||||||
|
|
||||||
<img src="assets/Logo_new.png" class="img" title="logo image">
|
<form action="Speisekarte">
|
||||||
|
<input type="submit" value="Zur Speisekarte" class="btn" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="text" class="form-control" id="qrcode" placeholder="Zugangscode eintragen" name="qrcode" @bind-value="@qrcodeValue">
|
|
||||||
|
|
||||||
<button type="submit" id="button1" class="btn" @onclick="@(() => CheckCode())">Bestätigen</button>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
@code {
|
|
||||||
private string qrcodeValue;
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
|
|
||||||
public void CheckCode()
|
|
||||||
{
|
|
||||||
foreach (var kunde in kunden)
|
|
||||||
{
|
|
||||||
if (kunde.Code == qrcodeValue)
|
|
||||||
{
|
|
||||||
localStorage.SetItem("kunde", kunde);
|
|
||||||
_navigationManager.NavigateTo("/speisekarte");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,37 +1,5 @@
|
|||||||
@page "/Kontakt"
|
@page "/Kontakt"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3>Kontakt</h3>
|
<h3>Kontakt</h3>
|
||||||
|
|
||||||
<h4>Kundenservice</h4>
|
<h4>Kundenservice</h4>
|
||||||
|
@ -1,335 +1,129 @@
|
|||||||
@page "/shopping_cart"
|
@page "/shopping_cart"
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
<PageTitle>Warenkorb</PageTitle>
|
<PageTitle>Warenkorb</PageTitle>
|
||||||
|
|
||||||
<h1>Warenkorb</h1>
|
<h1>Warenkorb</h1>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 col-lg-6">
|
<div class="col-sm-12 col-lg-6">
|
||||||
@*Tabelle Ihre Bestellung*@
|
@*Tabelle Ihre Bestellung*@
|
||||||
<div class="tbl-container">
|
<div class="tbl-container">
|
||||||
<table class="table bdr">
|
<table class="table bdr">
|
||||||
<thead class="bg_green">
|
<thead class="bg_green">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ihre Bestellung</td>
|
<td>Ihre Bestellung</td>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="bg_lightgreen">
|
<tbody class="bg_lightgreen">
|
||||||
@if (menuitemIds.Count == 0)
|
<tr>
|
||||||
{
|
<td class="br" style="padding-top:20px; padding-bottom:0px; border-bottom-width: 0px;">
|
||||||
<div class="card-body">
|
1 Nudel mit Hühnerfleisch (groß)
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">Warenkorb ist leer</h5>
|
<div style="font-size:0.7rem;padding-left:15px;">mit Knoblauchsoße</div>
|
||||||
</div>
|
</td>
|
||||||
}
|
<td class="d-flex justify-content-center align-items-center" style="padding-top:20px; padding-bottom:0px;">9,10€</td>
|
||||||
else
|
</tr>
|
||||||
{
|
<tr>
|
||||||
@foreach (var item in menuitemIds)
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;">1 Coca Cola</td>
|
||||||
{
|
<td class="d-flex justify-content-center align-items-center" style="padding-top:0px;">2,50€</td>
|
||||||
@foreach (var item2 in menuitems)
|
</tr>
|
||||||
{
|
<tr>
|
||||||
@if (item.Key == item2.IdmenuItem)
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
{
|
<td class="d-flex justify-content-center align-items-center"></td>
|
||||||
<tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom-width: 0px;"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot class="bg_lightgreen">
|
||||||
|
<tr style="border-top:solid 1px black;">
|
||||||
|
<th class="" style="text-align:right;">Summe</th>
|
||||||
|
<td class="d-flex justify-content-center align-items-center">11,60€</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
<td class="br" style="padding-top:20px; padding-bottom:0px; border-bottom-width: 0px;">
|
</div>
|
||||||
@item.Value x
|
|
||||||
@item2.Bezeichnung
|
|
||||||
<button @onclick="@(() => DelMenuItemId(item.Key))" class="btn btn-danger">del</button>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 col-lg-6">
|
||||||
|
<div class="h-100">
|
||||||
|
@*Essen Abholen?*@
|
||||||
|
<div class="row h-25 w-100">
|
||||||
|
<div class="col">
|
||||||
|
<div class="d-flex flex-column align-items-center ">
|
||||||
|
<div class="tbl-container bdr w-100">
|
||||||
|
<!-- <== overflow: hidden applied to parent -->
|
||||||
|
<table class="table bdr" cellspacing="0" cellpadding="0">
|
||||||
|
<thead class="bg_green">
|
||||||
|
<tr>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom:0px;">
|
||||||
|
Wann wollen Sie Ihr Essen abholen?
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="bg_lightgreen">
|
||||||
|
<tr>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="padding-top:0px;">
|
||||||
|
<div style="margin:20px;">
|
||||||
|
<div class="d-flex justify-content-center align-items-center">
|
||||||
|
<input type="number" style="width:80px" min="10" max="20" />
|
||||||
|
<input type="number" style="width:80px" min="0" max="59" />
|
||||||
|
|
||||||
|
Uhr
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div style="font-size:0.7rem;padding-left:15px;">@item2.Zusatzinformation</div>
|
@*Buttons*@
|
||||||
</td>
|
<div class="row h-75 w-100">
|
||||||
<td class="d-flex justify-content-center align-items-center" style="padding-top:20px; border-bottom-width:0px;">@(item2.Preis * item.Value)€</td>
|
<div class="col mt-auto">
|
||||||
</tr>
|
<div class="d-flex flex-column align-items-center ">
|
||||||
}
|
<button class="btn_back w-75">Zurück</button>
|
||||||
}
|
<button class="btn_forward w-75">Weiter</button>
|
||||||
|
</div>
|
||||||
}
|
</div>
|
||||||
}
|
</div>
|
||||||
</tbody>
|
</div>
|
||||||
<tfoot class="bg_lightgreen">
|
</div>
|
||||||
<tr style="border-top:solid 1px black;">
|
</div>
|
||||||
<th class="" style="text-align:right;">Summe</th>
|
|
||||||
<td class="d-flex justify-content-center align-items-center">
|
|
||||||
@summe€
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-12 col-lg-6">
|
|
||||||
<div class="h-100">
|
|
||||||
@*Essen Abholen?*@
|
|
||||||
<div class="row h-25 w-100 ">
|
|
||||||
<div class="col">
|
|
||||||
<div class="d-flex flex-column align-items-center ">
|
|
||||||
<div class="tbl-container bdr w-100">
|
|
||||||
<!-- <== overflow: hidden applied to parent -->
|
|
||||||
<table class="table bdr" cellspacing="0" cellpadding="0">
|
|
||||||
<thead class="bg_green">
|
|
||||||
<tr>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="border-bottom:0px;">
|
|
||||||
Wann wollen Sie Ihr Essen abholen?
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="bg_lightgreen">
|
|
||||||
<tr>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="padding-top:0px;">
|
|
||||||
<div style="margin:20px;">
|
|
||||||
<div class="d-flex justify-content-center align-items-center">
|
|
||||||
<input type="number" style="width:80px" min="10" max="19" @bind-value="@hour" @onclick="@(()=>UpdateTime())" />
|
|
||||||
<input type="number" style="width:80px" min="0" max="59" @bind-value="@minute" @onclick="@(()=>UpdateTime())" />
|
|
||||||
|
|
||||||
Uhr
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@*Buttons*@
|
|
||||||
<div class="row h-75 w-100">
|
|
||||||
<div class="col mt-auto ">
|
|
||||||
<div class="d-flex flex-column align-items-center ">
|
|
||||||
<a href="/speisekarte" class="btn_bg w-75 btn text-center">Zurück</a>
|
|
||||||
<a class="btn_forward btn w-75 " @onclick="@(() => SetBestllung())">Weiter</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
public int hour;
|
|
||||||
public int minute;
|
|
||||||
private void UpdateTime()
|
|
||||||
{
|
|
||||||
localStorage.SetItem<int>("Hour", hour);
|
|
||||||
localStorage.SetItem<int>("Minute", minute);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetBestllung()
|
|
||||||
{
|
|
||||||
if (menuitemIds.Count == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
UpdateTime();
|
|
||||||
localStorage.SetItem<Dictionary<int, int>>("MenuItemIds", menuitemIds);
|
|
||||||
_navigationManager.NavigateTo("/Bestellabschluss");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public decimal summe;
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
private void SetMenuItemId(int id)
|
|
||||||
{
|
|
||||||
if (menuitemIds.ContainsKey(id))
|
|
||||||
{
|
|
||||||
menuitemIds[id]++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menuitemIds.Add(id, 1);
|
|
||||||
}
|
|
||||||
localStorage.SetItem<Dictionary<int, int>>("MenuItemIds", menuitemIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void DelMenuItemId(int id)
|
|
||||||
{
|
|
||||||
if (menuitemIds.ContainsKey(id))
|
|
||||||
{
|
|
||||||
if (menuitemIds[id] > 1)
|
|
||||||
{
|
|
||||||
menuitemIds[id]--;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menuitemIds.Remove(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
localStorage.SetItem<Dictionary<int, int>>("MenuItemIds", menuitemIds);
|
|
||||||
_navigationManager.NavigateTo(_navigationManager.Uri, forceLoad: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
private List<Allergie> allergien = new List<Allergie>();
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
|
|
||||||
// get data from localstorage
|
|
||||||
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
|
|
||||||
{
|
|
||||||
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");
|
|
||||||
}
|
|
||||||
|
|
||||||
// get data from api
|
|
||||||
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
|
|
||||||
|
|
||||||
// calculate the sum of all menuitems
|
|
||||||
summe = 0;
|
|
||||||
foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
summe += item2.Preis * item.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
localStorage.SetItem<decimal>("Summe", summe);
|
|
||||||
|
|
||||||
// if hour/minute is set, set the values
|
|
||||||
if (localStorage.GetItem<int>("Hour") != 0)
|
|
||||||
{
|
|
||||||
hour = localStorage.GetItem<int>("Hour");
|
|
||||||
}
|
|
||||||
if (localStorage.GetItem<int>("Minute") != 0)
|
|
||||||
{
|
|
||||||
minute = localStorage.GetItem<int>("Minute");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Allergie
|
|
||||||
{
|
|
||||||
public int Idallergie { get; set; }
|
|
||||||
|
|
||||||
public string? Beschreibung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual Rabatt RabattIdrabattNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal Preis { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemKategorieIdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemkategorie MenuItemKategorieIdmenuItemKategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Allergie> AllergieIdallergies { get; set; } = new List<Allergie>();
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> BestellungspositionIdbestellungs { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemueberkategorie MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> Menuitems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal? Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,122 +1,124 @@
|
|||||||
@page "/Speisekarte"
|
@page "/Speisekarte"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
<h1>Speisekarte</h1>
|
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
@foreach (var item in menuitemueberkategories)
|
<div class="col-lg-2 col-md-4 col-sm-12 tablecolumn">
|
||||||
{
|
<table class="table table-light overflow-hidden">
|
||||||
<div class="col-lg-2 col-md-4 col-sm-12 tablecolumn">
|
<thead>
|
||||||
<table class="table table-light overflow-hidden">
|
<tr>
|
||||||
<thead>
|
<th scope="col">Chinesisch</th>
|
||||||
<tr>
|
</tr>
|
||||||
<th scope="col">@item.Bezeichnung</th>
|
</thead>
|
||||||
</tr>
|
<tbody>
|
||||||
</thead>
|
<tr>
|
||||||
<tbody>
|
<td><a href="">Nudeln</a></td>
|
||||||
@foreach (var item2 in menuitemkategories)
|
</tr>
|
||||||
{
|
<tr>
|
||||||
if (item.IdmenuItemUeberkategorie == item2.MenuItemUeberkategorieIdmenuItemUeberkategorie)
|
<td><a href="">Reis</a></td>
|
||||||
{
|
</tr>
|
||||||
if (@item.Bezeichnung == "Chinesisch")
|
<tr>
|
||||||
{
|
<td class="lowest"><a href="">Nachspeisen</a></td>
|
||||||
<tr>
|
</tr>
|
||||||
<td><a href="/SpeisekarteChinesich">@item2.Bezeichnung</a></td>
|
<tr>
|
||||||
</tr>
|
<td class="lowest"><br></td>
|
||||||
}
|
</tr>
|
||||||
else if (@item.Bezeichnung == "Japanisch")
|
<tr>
|
||||||
{
|
<td class="lowest"><br></td>
|
||||||
<tr>
|
</tr>
|
||||||
<td><a href="/SpeisekarteJapanisch">@item2.Bezeichnung</a></td>
|
<tr>
|
||||||
</tr>
|
<td class="lowest"><br></td>
|
||||||
}
|
</tr>
|
||||||
else if (@item.Bezeichnung == "Getränke")
|
</tbody>
|
||||||
{
|
</table>
|
||||||
<tr>
|
</div>
|
||||||
<td><a href="/SpeisekarteGetraenke">@item2.Bezeichnung</a></td>
|
<div class="col-lg-2 col-md-4 col-sm-12 tablecolumn">
|
||||||
</tr>
|
<table class="table table-light overflow-hidden">
|
||||||
}
|
<thead>
|
||||||
else if (@item.Bezeichnung == "Sonstiges")
|
<tr>
|
||||||
{
|
<th scope="col">Japanisch</th>
|
||||||
<tr>
|
</tr>
|
||||||
<td><a href="/SpeisekarteSonstiges">@item2.Bezeichnung</a></td>
|
</thead>
|
||||||
</tr>
|
<tbody>
|
||||||
}
|
<tr>
|
||||||
else
|
<td><a href="">Sushi & Maki</a></td>
|
||||||
{
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/">@item2.Bezeichnung</a></td>
|
<td><a href="">Bento</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
<tr>
|
||||||
}
|
<td class="lowest"><a href="">Nachspeisen</a></td>
|
||||||
}
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="lowest"><br></td>
|
<td class="lowest"><br></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="lowest"><br></td>
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<td class="lowest"><br></td>
|
||||||
<td class="lowest"><br></td>
|
</tr>
|
||||||
</tr>
|
</tbody>
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
</div>
|
||||||
</div>
|
<div class="col-lg-2 col-md-4 col-sm-12 tablecolumn">
|
||||||
}
|
<table class="table table-light overflow-hidden">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Getränke</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><a href="">Alkoholfrei</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><a href="">Alkoholisch</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-2 col-md-4 col-sm-12 tablecolumn">
|
||||||
|
<table class="table table-light overflow-hidden">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Sonstiges</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><a href="">Schnitzel</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="">Pommes</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><a href="">Bowl</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lowest"><br></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/MenuItemKategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/MenuItemUeberkategories");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
public string Bezeichnung { get; set; }
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
public object MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; }
|
|
||||||
public List<object> MenuItemIdmenuItems { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
public string Bezeichnung { get; set; }
|
|
||||||
public List<object> MenuItemKategorieIdmenuItemKategories { get; set; }
|
|
||||||
public List<object> MenuItemIdmenuItems { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,244 +0,0 @@
|
|||||||
@page "/SpeisekarteChinesich"
|
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<h1>Speisekarte Chinesisch</h1>
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
<div class="btn-group d-flex" role="group">
|
|
||||||
<button type="button" class="btn">Chinesisch</button>
|
|
||||||
<button type="button" class="btn">Nudel</button>
|
|
||||||
<button type="button" class="btn">Reis</button>
|
|
||||||
<button type="button" class="btn">Nachspeise</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@foreach (var item in menuitemueberkategories)
|
|
||||||
{
|
|
||||||
@if (item.Bezeichnung == "Chinesisch")
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitemkategories)
|
|
||||||
{
|
|
||||||
if (item2.MenuItemUeberkategorieIdmenuItemUeberkategorie == item.IdmenuItemUeberkategorie)
|
|
||||||
{
|
|
||||||
@foreach (var item3 in menuitems)
|
|
||||||
{
|
|
||||||
if (item2.IdmenuItemKategorie == item3.MenuItemKategorieIdmenuItemKategorie)
|
|
||||||
{
|
|
||||||
<div class="card mt-3 " @onclick="@(() => SetMenuItemId(item3.IdmenuItem))">
|
|
||||||
<div class="card-body">
|
|
||||||
@*create two divs columns*@
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
<h5 class="card-title">@item3.Bezeichnung</h5>
|
|
||||||
<p class="card-text">@item3.Zusatzinformation</p>
|
|
||||||
</div>
|
|
||||||
@*div text center*@
|
|
||||||
<div class="col-4 d-flex justify-content-center align-items-center">
|
|
||||||
<div style="font-size:15pt;">@item3.Preis</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
@* warenkorb anzeige als bootstrap card*@
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
Warenkorb
|
|
||||||
</div>
|
|
||||||
@if (menuitemIds.Count == 0)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">Warenkorb ist leer</h5>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
@if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<p>@item.Value</p>
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">@item2.Bezeichnung</h5>
|
|
||||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">@item2.Zusatzinformation</p>
|
|
||||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">@item2.Preis</span></p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="d-flex flex-column mb-5">
|
|
||||||
<a href="/speisekarte" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
|
||||||
<a href="/shopping_cart" class="btn btn-primary mx-2 mt-1 mb-5">Weiter</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
private void SetMenuItemId(int id)
|
|
||||||
{
|
|
||||||
if (menuitemIds.ContainsKey(id))
|
|
||||||
{
|
|
||||||
menuitemIds[id]++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menuitemIds.Add(id, 1);
|
|
||||||
}
|
|
||||||
localStorage.SetItem<Dictionary<int, int>>("MenuItemIds", menuitemIds);
|
|
||||||
}
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
|
|
||||||
private List<Allergie> allergien = new List<Allergie>();
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
|
|
||||||
{
|
|
||||||
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");
|
|
||||||
}
|
|
||||||
|
|
||||||
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Allergie
|
|
||||||
{
|
|
||||||
public int Idallergie { get; set; }
|
|
||||||
|
|
||||||
public string? Beschreibung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual Rabatt RabattIdrabattNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal? Preis { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemKategorieIdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemkategorie MenuItemKategorieIdmenuItemKategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Allergie> AllergieIdallergies { get; set; } = new List<Allergie>();
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> BestellungspositionIdbestellungs { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemueberkategorie MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> Menuitems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal? Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/**{
|
|
||||||
background-color: red;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*navigation*/
|
|
||||||
|
|
||||||
button.btn:first-child {
|
|
||||||
background-color: #8bfaa4;
|
|
||||||
/*not click able*/
|
|
||||||
pointer-events: none;
|
|
||||||
cursor: default;
|
|
||||||
border-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn {
|
|
||||||
/* Verwirrung: Figma-Design: background-color: #c7ffd5;
|
|
||||||
wurde jetzt aber fuer den Hintergrund verwendet*/
|
|
||||||
background-color: #8dffb5;
|
|
||||||
border-right: 1px solid black;
|
|
||||||
border-left: 1px solid black;
|
|
||||||
border-radius:20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:nth-child(2) {
|
|
||||||
/*border-right: 2px solid black;*/
|
|
||||||
border-left-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:last-child {
|
|
||||||
border-right-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*menuitems*/
|
|
||||||
|
|
||||||
.card.mt-3 {
|
|
||||||
/* background-color: rebeccapurple; */
|
|
||||||
border-radius: 30px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*warenkorb*/
|
|
||||||
.card-header {
|
|
||||||
font-size:16pt;
|
|
||||||
text-align: center;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
/* background-color: white; */
|
|
||||||
border-top-right-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
background-color:transparent;
|
|
||||||
border-bottom-width:0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border-radius: 32px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.card-text {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*buttons*/
|
|
||||||
a.btn.btn-primary.mx-2.mt-5 {
|
|
||||||
background-color: #facca3;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.btn.btn-primary.mx-2.mt-1 {
|
|
||||||
background-color: #89f9a5;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
@ -1,249 +0,0 @@
|
|||||||
@page "/SpeisekarteGetraenke"
|
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<h1>Speisekarte Getränke</h1>
|
|
||||||
@* create an container bootstrap 5*@
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
@* Navigation button group, stretch on the width size of the col-8 *@
|
|
||||||
<div class="btn-group d-flex" role="group">
|
|
||||||
<button type="button" class="btn">Getränke</button>
|
|
||||||
<button type="button" class="btn">Alkoholfreie Getränke</button>
|
|
||||||
<button type="button" class="btn">Bier</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@foreach (var item in menuitemueberkategories)
|
|
||||||
{
|
|
||||||
@if (item.Bezeichnung == "Getränke")
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitemkategories)
|
|
||||||
{
|
|
||||||
if (item2.MenuItemUeberkategorieIdmenuItemUeberkategorie == item.IdmenuItemUeberkategorie)
|
|
||||||
{
|
|
||||||
@foreach (var item3 in menuitems)
|
|
||||||
{
|
|
||||||
if (item2.IdmenuItemKategorie == item3.MenuItemKategorieIdmenuItemKategorie)
|
|
||||||
{
|
|
||||||
|
|
||||||
<div class="card mt-3 " @onclick="@(() => SetMenuItemId(item3.IdmenuItem))">
|
|
||||||
<div class="card-body">
|
|
||||||
@*create two divs columns*@
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
<h5 class="card-title">@item3.Bezeichnung</h5>
|
|
||||||
<p class="card-text">@item3.Zusatzinformation</p>
|
|
||||||
</div>
|
|
||||||
@*div text center*@
|
|
||||||
<div class="col-4 d-flex justify-content-center align-items-center">
|
|
||||||
<div style="font-size:15pt;">@item3.Preis</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
@* warenkorb anzeige als bootstrap card*@
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
Warenkorb
|
|
||||||
</div>
|
|
||||||
@if (menuitemIds.Count == 0)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">Warenkorb ist leer</h5>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
@if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<p>@item.Value</p>
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">@item2.Bezeichnung</h5>
|
|
||||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">@item2.Zusatzinformation</p>
|
|
||||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">@item2.Preis</span></p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="d-flex flex-column mb-5">
|
|
||||||
<a href="/speisekarte" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
|
||||||
<a href="/shopping_cart" class="btn btn-primary mx-2 mt-1 mb-5">Weiter</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
private void SetMenuItemId(int id)
|
|
||||||
{
|
|
||||||
if (menuitemIds.ContainsKey(id))
|
|
||||||
{
|
|
||||||
menuitemIds[id]++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menuitemIds.Add(id, 1);
|
|
||||||
}
|
|
||||||
localStorage.SetItem<Dictionary<int, int>>("MenuItemIds", menuitemIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
|
|
||||||
private List<Allergie> allergien = new List<Allergie>();
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
|
|
||||||
{
|
|
||||||
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");
|
|
||||||
}
|
|
||||||
|
|
||||||
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Allergie
|
|
||||||
{
|
|
||||||
public int Idallergie { get; set; }
|
|
||||||
|
|
||||||
public string? Beschreibung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual Rabatt RabattIdrabattNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal? Preis { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemKategorieIdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemkategorie MenuItemKategorieIdmenuItemKategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Allergie> AllergieIdallergies { get; set; } = new List<Allergie>();
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> BestellungspositionIdbestellungs { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemueberkategorie MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> Menuitems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal? Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/**{
|
|
||||||
background-color: red;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*navigation*/
|
|
||||||
|
|
||||||
button.btn:first-child {
|
|
||||||
background-color: #8bfaa4;
|
|
||||||
/*not click able*/
|
|
||||||
pointer-events: none;
|
|
||||||
cursor: default;
|
|
||||||
border-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn {
|
|
||||||
/* Verwirrung: Figma-Design: background-color: #c7ffd5;
|
|
||||||
wurde jetzt aber fuer den Hintergrund verwendet*/
|
|
||||||
background-color: #8dffb5;
|
|
||||||
border-right: 1px solid black;
|
|
||||||
border-left: 1px solid black;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:nth-child(2) {
|
|
||||||
/*border-right: 2px solid black;*/
|
|
||||||
border-left-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:last-child {
|
|
||||||
border-right-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*menuitems*/
|
|
||||||
|
|
||||||
.card.mt-3 {
|
|
||||||
/* background-color: rebeccapurple; */
|
|
||||||
border-radius: 30px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*warenkorb*/
|
|
||||||
.card-header {
|
|
||||||
font-size: 16pt;
|
|
||||||
text-align: center;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
/* background-color: white; */
|
|
||||||
border-top-right-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
background-color: transparent;
|
|
||||||
border-bottom-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border-radius: 32px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.card-text {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*buttons*/
|
|
||||||
a.btn.btn-primary.mx-2.mt-5 {
|
|
||||||
background-color: #facca3;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.btn.btn-primary.mx-2.mt-1 {
|
|
||||||
background-color: #89f9a5;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
@ -1,243 +0,0 @@
|
|||||||
@page "/SpeisekarteSonstiges"
|
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<h1>Speisekarte Sonstiges</h1>
|
|
||||||
@* create an container bootstrap 5*@
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
@* Navigation button group, stretch on the width size of the col-8 *@
|
|
||||||
<div class="btn-group d-flex" role="group">
|
|
||||||
<button type="button" class="btn">Sonstiges</button>
|
|
||||||
<button type="button" class="btn">Schnitzel</button>
|
|
||||||
<button type="button" class="btn">Pommes</button>
|
|
||||||
<button type="button" class="btn">Bowl</button>
|
|
||||||
<button type="button" class="btn">Vorspeisen</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@foreach (var item in menuitemueberkategories)
|
|
||||||
{
|
|
||||||
@if (item.Bezeichnung == "Sonstiges")
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitemkategories)
|
|
||||||
{
|
|
||||||
if (item2.MenuItemUeberkategorieIdmenuItemUeberkategorie == item.IdmenuItemUeberkategorie)
|
|
||||||
{
|
|
||||||
@foreach (var item3 in menuitems)
|
|
||||||
{
|
|
||||||
if (item2.IdmenuItemKategorie == item3.MenuItemKategorieIdmenuItemKategorie)
|
|
||||||
{
|
|
||||||
|
|
||||||
<div class="card mt-3 " @onclick="@(() => SetMenuItemId(item3.IdmenuItem))">
|
|
||||||
<div class="card-body">
|
|
||||||
@*create two divs columns*@
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
<h5 class="card-title">@item3.Bezeichnung</h5>
|
|
||||||
<p class="card-text">@item3.Zusatzinformation</p>
|
|
||||||
</div>
|
|
||||||
@*div text center*@
|
|
||||||
<div class="col-4 d-flex justify-content-center align-items-center">
|
|
||||||
<div style="font-size:15pt;">@item3.Preis</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
@* warenkorb anzeige als bootstrap card*@
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
Warenkorb
|
|
||||||
</div>
|
|
||||||
@if (menuitemIds.Count == 0)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">Warenkorb ist leer</h5>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
@if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<p>@item.Value</p>
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">@item2.Bezeichnung</h5>
|
|
||||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">@item2.Zusatzinformation</p>
|
|
||||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">@item2.Preis</span></p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="d-flex flex-column mb-5">
|
|
||||||
<a href="/speisekarte" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
|
||||||
<a href="/shopping_cart" class="btn btn-primary mx-2 mt-1 mb-5">Weiter</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
private void SetMenuItemId(int id)
|
|
||||||
{
|
|
||||||
if (menuitemIds.ContainsKey(id))
|
|
||||||
{
|
|
||||||
menuitemIds[id]++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menuitemIds.Add(id, 1);
|
|
||||||
}
|
|
||||||
localStorage.SetItem<Dictionary<int, int>>("MenuItemIds", menuitemIds);
|
|
||||||
}
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
|
|
||||||
private List<Allergie> allergien = new List<Allergie>();
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
|
|
||||||
{
|
|
||||||
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");
|
|
||||||
}
|
|
||||||
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Allergie
|
|
||||||
{
|
|
||||||
public int Idallergie { get; set; }
|
|
||||||
|
|
||||||
public string? Beschreibung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual Rabatt RabattIdrabattNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal? Preis { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemKategorieIdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemkategorie MenuItemKategorieIdmenuItemKategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Allergie> AllergieIdallergies { get; set; } = new List<Allergie>();
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> BestellungspositionIdbestellungs { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemueberkategorie MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> Menuitems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal? Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/**{
|
|
||||||
background-color: red;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*navigation*/
|
|
||||||
|
|
||||||
button.btn:first-child {
|
|
||||||
background-color: #8bfaa4;
|
|
||||||
/*not click able*/
|
|
||||||
pointer-events: none;
|
|
||||||
cursor: default;
|
|
||||||
border-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn {
|
|
||||||
/* Verwirrung: Figma-Design: background-color: #c7ffd5;
|
|
||||||
wurde jetzt aber fuer den Hintergrund verwendet*/
|
|
||||||
background-color: #8dffb5;
|
|
||||||
border-right: 1px solid black;
|
|
||||||
border-left: 1px solid black;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:nth-child(2) {
|
|
||||||
/*border-right: 2px solid black;*/
|
|
||||||
border-left-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:last-child {
|
|
||||||
border-right-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*menuitems*/
|
|
||||||
|
|
||||||
.card.mt-3 {
|
|
||||||
/* background-color: rebeccapurple; */
|
|
||||||
border-radius: 30px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*warenkorb*/
|
|
||||||
.card-header {
|
|
||||||
font-size: 16pt;
|
|
||||||
text-align: center;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
/* background-color: white; */
|
|
||||||
border-top-right-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
background-color: transparent;
|
|
||||||
border-bottom-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border-radius: 32px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.card-text {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*buttons*/
|
|
||||||
a.btn.btn-primary.mx-2.mt-5 {
|
|
||||||
background-color: #facca3;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.btn.btn-primary.mx-2.mt-1 {
|
|
||||||
background-color: #89f9a5;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
@ -1,245 +0,0 @@
|
|||||||
@page "/SpeisekarteJapanisch"
|
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<h1>Speisekarte Japanisch</h1>
|
|
||||||
@* create an container bootstrap 5*@
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
@* Navigation button group, stretch on the width size of the col-8 *@
|
|
||||||
<div class="btn-group d-flex" role="group">
|
|
||||||
<button type="button" class="btn">Japanisch</button>
|
|
||||||
<button type="button" class="btn">SushiMaki</button>
|
|
||||||
<button type="button" class="btn">Bento</button>
|
|
||||||
<button type="button" class="btn">Nachspeise</button>
|
|
||||||
</div>
|
|
||||||
@foreach (var item in menuitemueberkategories)
|
|
||||||
{
|
|
||||||
@if (item.Bezeichnung == "Japanisch")
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitemkategories)
|
|
||||||
{
|
|
||||||
if (item2.MenuItemUeberkategorieIdmenuItemUeberkategorie == item.IdmenuItemUeberkategorie)
|
|
||||||
{
|
|
||||||
@foreach (var item3 in menuitems)
|
|
||||||
{
|
|
||||||
if (item2.IdmenuItemKategorie == item3.MenuItemKategorieIdmenuItemKategorie)
|
|
||||||
{
|
|
||||||
<div class="card mt-3" @onclick="@(() => SetMenuItemId(item3.IdmenuItem))">
|
|
||||||
<div class="card-body">
|
|
||||||
@*create two divs columns*@
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
<h5 class="card-title">@item3.Bezeichnung</h5>
|
|
||||||
<p class="card-text">@item3.Zusatzinformation</p>
|
|
||||||
</div>
|
|
||||||
@*div text center*@
|
|
||||||
<div class="col-4 d-flex justify-content-center align-items-center">
|
|
||||||
<div style="font-size:15pt;">@item3.Preis</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
@* warenkorb anzeige als bootstrap card*@
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
Warenkorb
|
|
||||||
</div>
|
|
||||||
@if (menuitemIds.Count == 0)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">Warenkorb ist leer</h5>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
@if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<p>@item.Value</p>
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">@item2.Bezeichnung</h5>
|
|
||||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">@item2.Zusatzinformation</p>
|
|
||||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">@item2.Preis</span></p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="d-flex flex-column mb-5">
|
|
||||||
<a href="/speisekarte" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
|
||||||
<a href="/shopping_cart" class="btn btn-primary mx-2 mt-1 mb-5">Weiter</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
private void SetMenuItemId(int id)
|
|
||||||
{
|
|
||||||
if (menuitemIds.ContainsKey(id))
|
|
||||||
{
|
|
||||||
menuitemIds[id]++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menuitemIds.Add(id, 1);
|
|
||||||
}
|
|
||||||
localStorage.SetItem<Dictionary<int, int>>("MenuItemIds", menuitemIds);
|
|
||||||
}
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
|
|
||||||
private List<Allergie> allergien = new List<Allergie>();
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
|
|
||||||
{
|
|
||||||
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");
|
|
||||||
}
|
|
||||||
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Allergie
|
|
||||||
{
|
|
||||||
public int Idallergie { get; set; }
|
|
||||||
|
|
||||||
public string? Beschreibung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual Rabatt RabattIdrabattNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal? Preis { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemKategorieIdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemkategorie MenuItemKategorieIdmenuItemKategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Allergie> AllergieIdallergies { get; set; } = new List<Allergie>();
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> BestellungspositionIdbestellungs { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemueberkategorie MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> Menuitems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal? Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/**{
|
|
||||||
background-color: red;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*navigation*/
|
|
||||||
|
|
||||||
button.btn:first-child {
|
|
||||||
background-color: #8bfaa4;
|
|
||||||
/*not click able*/
|
|
||||||
pointer-events: none;
|
|
||||||
cursor: default;
|
|
||||||
border-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn {
|
|
||||||
/* Verwirrung: Figma-Design: background-color: #c7ffd5;
|
|
||||||
wurde jetzt aber fuer den Hintergrund verwendet*/
|
|
||||||
background-color: #8dffb5;
|
|
||||||
border-right: 1px solid black;
|
|
||||||
border-left: 1px solid black;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:nth-child(2) {
|
|
||||||
/*border-right: 2px solid black;*/
|
|
||||||
border-left-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.btn:last-child {
|
|
||||||
border-right-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*menuitems*/
|
|
||||||
|
|
||||||
.card.mt-3 {
|
|
||||||
/* background-color: rebeccapurple; */
|
|
||||||
border-radius: 30px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*warenkorb*/
|
|
||||||
.card-header {
|
|
||||||
font-size: 16pt;
|
|
||||||
text-align: center;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
/* background-color: white; */
|
|
||||||
border-top-right-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
background-color: transparent;
|
|
||||||
border-bottom-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border-radius: 32px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.card-text {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*buttons*/
|
|
||||||
a.btn.btn-primary.mx-2.mt-5 {
|
|
||||||
background-color: #facca3;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.btn.btn-primary.mx-2.mt-1 {
|
|
||||||
background-color: #89f9a5;
|
|
||||||
color: black;
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
51
src/y4f/Pages/TestFetchAllergienData.razor
Normal file
51
src/y4f/Pages/TestFetchAllergienData.razor
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
@page "/TestFetchAllergienData"
|
||||||
|
|
||||||
|
@inject HttpClient Http
|
||||||
|
|
||||||
|
|
||||||
|
<PageTitle>Allergien</PageTitle>
|
||||||
|
|
||||||
|
<h1>Allergien</h1>
|
||||||
|
|
||||||
|
<p>This component demonstrates fetching data from the mysql server.</p>
|
||||||
|
|
||||||
|
@if (allergien == null)
|
||||||
|
{
|
||||||
|
<p><em>Loading...</em></p>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Beschreibung</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach (var allergie in allergien)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>@allergie.Idallergie</td>
|
||||||
|
<td>@allergie.Beschreibung</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
}
|
||||||
|
@code {
|
||||||
|
private const string ServiceEndpoint = "https://localhost:7076/api/Allergien";
|
||||||
|
private Allergie[]? allergien;
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
allergien = await Http.GetFromJsonAsync<Allergie[]>(ServiceEndpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Allergie
|
||||||
|
{
|
||||||
|
public int Idallergie { get; set; }
|
||||||
|
|
||||||
|
public string? Beschreibung { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -1,37 +1,5 @@
|
|||||||
@page "/yummypoints"
|
@page "/yummypoints"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%";'>
|
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%";'>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
|
|
||||||
|
@ -1,325 +1,36 @@
|
|||||||
@page "/Bestellabschluss"
|
@page "/Bestellabschluss"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
<p>Sie haben derzeit <b>@kunde.Treuepunkte Yummy-Punkt(e)</b></p>
|
<p>Sie haben derzeit <b>1 Yummy-Punkt(e)</b></p>
|
||||||
<p class="text">
|
<p class="text">Bei einem Mindestbestellwert von 8€ erhalten Sie ein Yummy-Punkt.
|
||||||
Bei einem Mindestbestellwert von 8€ erhalten Sie ein Yummy-Punkt.
|
Ab der 10ten Bestellung gibt es einen Rabatt zu Ihrer nächsten Bestellung.</p>
|
||||||
Ab der 10ten Bestellung gibt es einen Rabatt (@rabatt.Prozent%) zu Ihrer nächsten Bestellung.
|
|
||||||
</p>
|
<div class="img" >
|
||||||
|
@for(int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
<img src="assets/White-Circle.png ">
|
||||||
|
}
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="text">Achtung: Bitte beachten Sie, dass keine online Bezahlung zur Verfügung steht.
|
||||||
|
Diese dient nur zur Vorbestellung und muss selbst abgeholt werden.</p>
|
||||||
|
|
||||||
|
<div class="button">
|
||||||
|
<form id="button1" action="Warenkorb">
|
||||||
|
<input type="submit" value="Zurück" class="btn">
|
||||||
|
</form>
|
||||||
|
|
||||||
<div class="img">
|
<form id="button2" action="Confirm">
|
||||||
@for (int i = 0; i < 10; i++)
|
<input type="submit" value="Vorbestellen" class="btn">
|
||||||
{
|
</form>
|
||||||
@*if kunde hat treuepunkte*@
|
</div>
|
||||||
@if (kunde.Treuepunkte > i)
|
|
||||||
{
|
|
||||||
<img src="assets/Point-Circle.png ">
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<img src="assets/White-Circle.png ">
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
<p class="text">
|
|
||||||
Achtung: Bitte beachten Sie, dass keine online Bezahlung zur Verfügung steht.
|
|
||||||
Diese dient nur zur Vorbestellung und muss selbst abgeholt werden.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Ihr gesamt bestellter Betrag beträgt: <strong>@summe €</strong>
|
|
||||||
</p>
|
|
||||||
@*if treuepunkte 10 dann angebot bieten*@
|
|
||||||
@if (kunde.Treuepunkte == 10)
|
|
||||||
{
|
|
||||||
<p class=""><strong>Sie haben 10 Yummy-Punkte erreicht</strong>. Sie können diese jetzt einlösen und erhalten einen Rabatt von <strong>@rabatt.Prozent%</strong>.</p>
|
|
||||||
<p><strong>Wollen Sie diese einlösen?</strong> <InputCheckbox @bind-Value="rabattEinloesen" /></p>
|
|
||||||
|
|
||||||
@if (rabattEinloesen == true)
|
</div>
|
||||||
{
|
|
||||||
<p>Betrag beträgt abzüglich des Rabattes: <strong>@Math.Round(summe - (summe * rabatt.Prozent / 100), 2) €</strong></p>
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
<div class="button">
|
|
||||||
<form id="button1" action="Warenkorb">
|
|
||||||
<a href="/shopping_cart" class="btn">Zurück</a>
|
|
||||||
</form>
|
|
||||||
<form id="button2" action="Confirm">
|
|
||||||
<input value="Vorbestellen" class="btn" @onclick="Vorbestellen" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
private Rabatt rabatt = new Rabatt();
|
}
|
||||||
private bool rabattEinloesen;
|
|
||||||
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
public List<Bestellungsposition> bestellungspositionen = new List<Bestellungsposition>();
|
|
||||||
public int hour;
|
|
||||||
public int minute;
|
|
||||||
|
|
||||||
public decimal summe;
|
|
||||||
|
|
||||||
public void Vorbestellen()
|
|
||||||
{
|
|
||||||
// set rabattEinloesen
|
|
||||||
if (rabattEinloesen)
|
|
||||||
{
|
|
||||||
kunde.Treuepunkte = 0;
|
|
||||||
// delete treuepunkte API
|
|
||||||
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
|
|
||||||
// add all bestellungspositionen to API
|
|
||||||
// get latest bestellungsposition id wenn nix da dann 0
|
|
||||||
int bestellungspositionId = 0;
|
|
||||||
if (bestellungspositions != null)
|
|
||||||
{
|
|
||||||
// get the highest id from bestellungspositions
|
|
||||||
int highestId;
|
|
||||||
foreach (var item in bestellungspositions)
|
|
||||||
{
|
|
||||||
highestId = item.Idbestellung;
|
|
||||||
if (highestId > bestellungspositionId)
|
|
||||||
{
|
|
||||||
bestellungspositionId = highestId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
bestellungspositionId++;
|
|
||||||
Bestellungsposition bestellungsposition = new Bestellungsposition();
|
|
||||||
bestellungsposition.Idbestellung = bestellungspositionId;
|
|
||||||
bestellungsposition.Menge = item.Value;
|
|
||||||
// make a new date with hour and minute
|
|
||||||
DateTime abholzeit = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, minute, 0);
|
|
||||||
bestellungsposition.Datum = abholzeit;
|
|
||||||
// latest possible rabatt
|
|
||||||
if (rabattEinloesen)
|
|
||||||
{
|
|
||||||
bestellungsposition.RabattIdrabatt = rabatt.Idrabatt;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bestellungsposition.RabattIdrabatt = null;
|
|
||||||
}
|
|
||||||
bestellungsposition.KundeIdkunde = kunde.Idkunde;
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
Http.PostAsJsonAsync("https://localhost:7076/api/bestellungspositionhasmenuitems", bestellungspositionHasMenuItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete all localStorage
|
|
||||||
localStorage.SetItem("MenuItemIds", new Dictionary<int, int>());
|
|
||||||
//localStorage.SetItem("Hour", 0);
|
|
||||||
//localStorage.SetItem("Minute", 0);
|
|
||||||
localStorage.SetItem("Summe", 0);
|
|
||||||
localStorage.SetItem("RabattEinloesen", false);
|
|
||||||
|
|
||||||
_navigationManager.NavigateTo("/Bestellbestätigung");
|
|
||||||
}
|
|
||||||
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
private List<Allergie> allergien = new List<Allergie>();
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
private List<BestellungspositionHasMenuitem> bestellungspositionHasMenuitems = new List<BestellungspositionHasMenuitem>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
// get data from api
|
|
||||||
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
bestellungspositionHasMenuitems = await Http.GetFromJsonAsync<List<BestellungspositionHasMenuitem>>("https://localhost:7076/api/BestellungspositionHasMenuitems");
|
|
||||||
|
|
||||||
// get kunde from local storage
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
|
|
||||||
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
|
||||||
// if there is no rabatt, set the rabatt to null
|
|
||||||
if (rabatte.Count == 0)
|
|
||||||
{
|
|
||||||
rabatt = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int i = 0; i < rabatte.Count; i++)
|
|
||||||
{
|
|
||||||
if (rabatte[i].GueltigkeitBis > DateTime.Now)
|
|
||||||
{
|
|
||||||
rabatt = rabatte[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get data from localstorage
|
|
||||||
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
|
|
||||||
{
|
|
||||||
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculate the sum of all menuitems
|
|
||||||
summe = 0;
|
|
||||||
foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
summe += item2.Preis * item.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if hour/minute is set, set the values
|
|
||||||
if (localStorage.GetItem<int>("Hour") != 0)
|
|
||||||
{
|
|
||||||
hour = localStorage.GetItem<int>("Hour");
|
|
||||||
}
|
|
||||||
if (localStorage.GetItem<int>("Minute") != 0)
|
|
||||||
{
|
|
||||||
minute = localStorage.GetItem<int>("Minute");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Allergie
|
|
||||||
{
|
|
||||||
public int Idallergie { get; set; }
|
|
||||||
|
|
||||||
public string? Beschreibung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal Preis { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemKategorieIdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemkategorie MenuItemKategorieIdmenuItemKategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Allergie> AllergieIdallergies { get; set; } = new List<Allergie>();
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> BestellungspositionIdbestellungs { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemueberkategorie MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> Menuitems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
public bool Einloesen { get; set; }
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class BestellungspositionHasMenuitem
|
|
||||||
{
|
|
||||||
public int? Bestellungsposition_IDBestellung { get; set; }
|
|
||||||
public int? MenuItem_IDMenuItem { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,242 +1,38 @@
|
|||||||
@page "/Bestellbestätigung"
|
@page "/Bestellbestätigung"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
<h5>Vielen Dank für Ihre Bestellung</h5><br>
|
<h5>Vielen Dank für Ihre Bestellung</h5><br>
|
||||||
<p class="text">
|
<p class="text">
|
||||||
<strong>Ihr Essen ist heute um @hour:@minute abholbereit.</strong>
|
Ihr Essen ist in <b>30 Minuten</b> abholbereit.
|
||||||
Sie erhalten eine Benachrichtigung sobald das Essen fertig ist. Wir würden uns freuen, wenn Sie uns ein <a href="Feedback">Feedback</a> geben.
|
Sie erhalten eine Benachrichtigung sobald das Essen fertig ist. Wir würden uns freuen, wenn Sie uns ein <a href="Feedback">Feedback</a> geben.
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="progress-bar bg-warning progress-bar-striped progress-bar-animated" style="width:10%"></div>
|
<div class="progress-bar bg-warning progress-bar-striped progress-bar-animated" style="width:50%"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<tr class="loadtext">
|
<tr class="loadtext">
|
||||||
<td>Bestellung eingegangen</td>
|
<td>Bestellung eingegangen</td>
|
||||||
<td class="load2">Bestellung wird zubereitet</td>
|
<td class="load2">Bestellung wird zubereitet</td>
|
||||||
<td class="load3">Essen abholbereit</td>
|
<td class="load3">Essen abholbereit</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<div class="button">
|
||||||
|
<br><br><br><br>
|
||||||
|
<form id="button1" action="/">
|
||||||
|
<input type="submit" value="Zur Startseite" class="btn">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="button">
|
</div>
|
||||||
<br><br><br><br>
|
|
||||||
<form id="button1" action="/">
|
|
||||||
<input type="submit" value="Bestellungsübersicht" class="btn" @onclick="BestellungsUuebersicht"/>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
private Rabatt rabatt = new Rabatt();
|
|
||||||
private bool rabattEinloesen;
|
|
||||||
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
public int hour;
|
|
||||||
public int minute;
|
|
||||||
|
|
||||||
public decimal summe;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void BestellungsUuebersicht()
|
|
||||||
{
|
|
||||||
_navigationManager.NavigateTo("/Kontoverwaltung");
|
|
||||||
}
|
|
||||||
|
|
||||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
|
||||||
private List<Allergie> allergien = new List<Allergie>();
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
|
||||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
// get data from api
|
|
||||||
allergien = await Http.GetFromJsonAsync<List<Allergie>>("https://localhost:7076/api/allergien");
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
menuitemkategories = await Http.GetFromJsonAsync<List<Menuitemkategorie>>("https://localhost:7076/api/Menuitemkategories");
|
|
||||||
menuitemueberkategories = await Http.GetFromJsonAsync<List<Menuitemueberkategorie>>("https://localhost:7076/api/Menuitemueberkategories");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
|
|
||||||
// test use the first kunde
|
|
||||||
// get kunde from local storage
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
|
|
||||||
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
|
||||||
// if there is no rabatt, set the rabatt to null
|
|
||||||
if (rabatte.Count == 0)
|
|
||||||
{
|
|
||||||
rabatt = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int i = 0; i < rabatte.Count; i++)
|
|
||||||
{
|
|
||||||
if (rabatte[i].GueltigkeitBis > DateTime.Now)
|
|
||||||
{
|
|
||||||
rabatt = rabatte[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get data from localstorage
|
|
||||||
if (localStorage.GetItem<Dictionary<int, int>>("MenuItemIds") != null)
|
|
||||||
{
|
|
||||||
menuitemIds = localStorage.GetItem<Dictionary<int, int>>("MenuItemIds");
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculate the sum of all menuitems
|
|
||||||
summe = 0;
|
|
||||||
foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
summe += item2.Preis * item.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if hour/minute is set, set the values
|
|
||||||
if (localStorage.GetItem<int>("Hour") != 0)
|
|
||||||
{
|
|
||||||
hour = localStorage.GetItem<int>("Hour");
|
|
||||||
}
|
|
||||||
if (localStorage.GetItem<int>("Minute") != 0)
|
|
||||||
{
|
|
||||||
minute = localStorage.GetItem<int>("Minute");
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Allergie
|
|
||||||
{
|
|
||||||
public int Idallergie { get; set; }
|
|
||||||
|
|
||||||
public string? Beschreibung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int? Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime? Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
public virtual Kunde KundeIdkundeNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual Rabatt RabattIdrabattNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal Preis { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemKategorieIdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemkategorie MenuItemKategorieIdmenuItemKategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Allergie> AllergieIdallergies { get; set; } = new List<Allergie>();
|
|
||||||
|
|
||||||
public virtual ICollection<Bestellungsposition> BestellungspositionIdbestellungs { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
public class Menuitemkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemKategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public int MenuItemUeberkategorieIdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public virtual Menuitemueberkategorie MenuItemUeberkategorieIdmenuItemUeberkategorieNavigation { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitem> Menuitems { get; set; } = new List<Menuitem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitemueberkategorie
|
|
||||||
{
|
|
||||||
public int IdmenuItemUeberkategorie { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal? Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
public bool Einloesen { get; set; }
|
|
||||||
public virtual ICollection<Bestellungsposition> Bestellungspositions { get; set; } = new List<Bestellungsposition>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,137 +1,82 @@
|
|||||||
@page "/Bestelluebersicht"
|
@page "/Bestelluebersicht"
|
||||||
@layout ChefinLayout
|
@layout ChefinLayout
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
<div class="container d-flex flex-column">
|
<div class="container d-flex flex-column">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">Aktive Bestellungen @day.@month.@year</th>
|
<th colspan="2">Aktive Bestellungen</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@*iterate all kunden*@
|
<tr>
|
||||||
@foreach (var kunde in kunden)
|
<td><a href="BDetail">#1234 12:30</a></td>
|
||||||
{
|
<td><a href="BDetail">#2345 18:45</a></td>
|
||||||
bool firstTime = true;
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="BDetail">#3456 13:00</a></td>
|
||||||
|
<td><a href="BDetail">#4567 19:00</a></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="BDetail">#5678 14:30</a></td>
|
||||||
|
<td><a href="BDetail">#6789 19:15</a></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="BDetail">#4321 15:15</a></td>
|
||||||
|
<td><a href="BDetail">#5432 19:15</a></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="BDetail">#6543 15:30</a></td>
|
||||||
|
<td><a href="BDetail">#7654 19:15</a></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="BDetail">#7654 15:30</a></td>
|
||||||
|
<td> </td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="BDetail">#8765 16:00</a></td>
|
||||||
|
<td> </td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="BDetail">#9876 17:30</a></td>
|
||||||
|
<td> </td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
@*if kunde has made a recent bestellungsposiotn from today and higher value than now, print it*@
|
|
||||||
@foreach (var bestellungsposition in bestellungspositions)
|
|
||||||
{
|
|
||||||
if (bestellungsposition.KundeIdkunde == kunde.Idkunde)
|
|
||||||
{
|
|
||||||
@*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;
|
|
||||||
|
|
||||||
@*print kunde.code, hour and minute from last bestellungsposition*@
|
</tbody>
|
||||||
@*print only if date is higher than now datum *@
|
</table>
|
||||||
if (bestellungsposition.Datum > DateTime.Now)
|
</div>
|
||||||
{
|
<div class="col-lg-3">
|
||||||
<tr>
|
<p id="text" readonly >Abholzeit</p>
|
||||||
<td>
|
<br />
|
||||||
<p @onclick="@(()=>BDetail(@kunde.Idkunde))" class="mb-0 pb-0">
|
<form id="button" action="Bestelluebersicht">
|
||||||
#@kunde.Code
|
<input type="submit" value="30 Min" class="btn">
|
||||||
@hour:@minute
|
</form>
|
||||||
</p>
|
<form id="button" action="Bestelluebersicht">
|
||||||
</td>
|
<input type="submit" value="45 Min" class="btn">
|
||||||
</tr>
|
</form>
|
||||||
}
|
<form id="button" action="Bestelluebersicht">
|
||||||
@*}*@
|
<input type="submit" value="1 Std" class="btn">
|
||||||
firstTime = false;
|
</form>
|
||||||
}
|
|
||||||
}
|
</div>
|
||||||
}
|
</div>
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</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>
|
|
||||||
|
|
||||||
</div>*@
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
public int hour;
|
|
||||||
public int minute;
|
|
||||||
public int day;
|
|
||||||
public int month;
|
|
||||||
public int year;
|
|
||||||
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
|
|
||||||
public void BDetail(int id)
|
|
||||||
{
|
|
||||||
localStorage.SetItem<int>("KundeId", id);
|
|
||||||
_navigationManager.NavigateTo("/BestelluebersichtD-Chefin");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// get data from api
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
// set hour, minute, day , month, year to now date
|
|
||||||
hour = DateTime.Now.Hour;
|
|
||||||
minute = DateTime.Now.Minute;
|
|
||||||
day = DateTime.Now.Day;
|
|
||||||
month = DateTime.Now.Month;
|
|
||||||
year = DateTime.Now.Year;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string Code { get; set; }
|
|
||||||
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,110 +1,131 @@
|
|||||||
@page "/BestelluebersichtD-Chefin"
|
@page "/BestelluebersichtD-Chefin"
|
||||||
@layout ChefinLayout
|
@layout ChefinLayout
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 col-lg-6">
|
<div class="col-sm-12 col-lg-6">
|
||||||
@*Tabelle Ihre Bestellung*@
|
@*Tabelle Ihre Bestellung*@
|
||||||
<div class="tbl-container">
|
<div class="tbl-container">
|
||||||
<table class="table bdr">
|
<table class="table bdr">
|
||||||
<thead class="bg_green">
|
<thead class="bg_green">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ihre Bestellung (@day.@month.@year)</td>
|
<td>Ihre Bestellung</td>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="bg_lightgreen" style="background-color:white;">
|
<tbody class="bg_lightgreen" style="background-color:white;">
|
||||||
@if (menuitemIds.Count == 0)
|
<tr>
|
||||||
{
|
<td class="br" style="padding-top:20px; padding-bottom:0px; border-bottom-width: 0px;">
|
||||||
<div class="card-body">
|
1 Nudel mit Hühnerfleisch (groß)
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">Warenkorb ist leer</h5>
|
<div style="font-size:0.7rem;padding-left:15px;">mit Knoblauchsoße</div>
|
||||||
</div>
|
</td>
|
||||||
}
|
<td class="d-flex justify-content-center align-items-center" style="padding-top:20px; padding-bottom:0px; border-style:hidden;">9,10€</td>
|
||||||
else
|
</tr>
|
||||||
{
|
<tr>
|
||||||
@foreach (var item in menuitemIds)
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;">1 Coca Cola</td>
|
||||||
{
|
<td class="d-flex justify-content-center align-items-center" style="padding-top:0px; border-style:hidden;">2,50€</td>
|
||||||
@foreach (var item2 in menuitems)
|
</tr>
|
||||||
{
|
<tr>
|
||||||
@if (item.Key == item2.IdmenuItem)
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
{
|
<td class="d-flex justify-content-center align-items-center" style="border-style:hidden;"></td>
|
||||||
<tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom-width: 0px; border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom-width: 0px; border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom-width: 0px; border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom-width: 0px; border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="br" style=" padding-top:0px; border-bottom-width: 0px;"></td>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom-width: 0px; border-style:hidden;"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot class="bg_lightgreen">
|
||||||
|
<tr style="border-top:solid 1px black; background-color:white;">
|
||||||
|
<th class="" style="text-align:right;">Summe</th>
|
||||||
|
<td class="d-flex justify-content-center align-items-center">11,60€</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
<td class="br" style="padding-top:20px; padding-bottom:0px; border-bottom-width: 0px;">
|
</div>
|
||||||
@item.Value x
|
|
||||||
@item2.Bezeichnung
|
|
||||||
<div style="font-size:0.7rem;padding-left:15px;">@item2.Zusatzinformation</div>
|
|
||||||
</td>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="padding-top:20px; border-bottom-width:0px;">@(item2.Preis * item.Value)€</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
</div>
|
||||||
}
|
<div class="col-sm-12 col-lg-6">
|
||||||
</tbody>
|
|
||||||
<tfoot class="bg_lightgreen">
|
<div class="d-flex flex-column align-items-center ">
|
||||||
<tr style="border-top:solid 1px black; background-color:white;">
|
<div class="tbl-container w-100">
|
||||||
<th class="" style="text-align:right;">Summe</th>
|
<!-- <== overflow: hidden applied to parent -->
|
||||||
<td class="d-flex justify-content-center align-items-center">
|
<table class="table table-bordered bdr " style=" border-radius: 50px; margin-left: 50px;">
|
||||||
@summe€
|
<thead class="bg_green">
|
||||||
@if (rabattEinloesen)
|
<tr>
|
||||||
{
|
<td class="d-flex justify-content-center align-items-center" style="border-bottom:0px;">
|
||||||
<span style="color:green;">(- @rabatt.Prozent%)</span>
|
<p>Abholzeit</p>
|
||||||
}
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
</tr>
|
</thead>
|
||||||
</tfoot>
|
<tbody >
|
||||||
</table>
|
<tr>
|
||||||
|
<td class="d-flex justify-content-center align-items-center" style="padding-top:0px; background-color:white;">
|
||||||
|
<div style="margin:20px;">
|
||||||
|
<div class="d-flex justify-content-center align-items-center" >
|
||||||
|
<p>12:30 Uhr</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
<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_forward w-75">Bestellung abschließen</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 col-lg-6">
|
</div>
|
||||||
|
</div>
|
||||||
<div class="d-flex flex-column align-items-center ">
|
</div>
|
||||||
<div class="tbl-container w-100">
|
|
||||||
<!-- <== overflow: hidden applied to parent -->
|
|
||||||
<table class="table table-bordered bdr " style=" border-radius: 50px; margin-left: 50px;">
|
|
||||||
<thead class="bg_green">
|
|
||||||
<tr>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="border-bottom:0px;">
|
|
||||||
<p>Abholzeit</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="padding-top:0px; background-color:white;">
|
|
||||||
<div style="margin:20px;">
|
|
||||||
<div class="d-flex justify-content-center align-items-center">
|
|
||||||
<p>@hour:@minute Uhr (@day.@month.@year)</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<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_forward w-75">Bestellung abschließen</button>*@
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@*Buttons*@
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
@*Buttons*@
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@*<div class="h-100">
|
@*<div class="h-100">
|
||||||
@*Essen Abholen?
|
@*Essen Abholen?
|
||||||
@ -115,150 +136,4 @@
|
|||||||
</div>*@
|
</div>*@
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
public int hour;
|
|
||||||
public int minute;
|
|
||||||
public int day;
|
|
||||||
public int month;
|
|
||||||
public int year;
|
|
||||||
|
|
||||||
|
|
||||||
public decimal summe;
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
private Rabatt rabatt = new Rabatt();
|
|
||||||
private bool rabattEinloesen;
|
|
||||||
|
|
||||||
public decimal rabattGutschrift;
|
|
||||||
|
|
||||||
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
private List<BestellungspositionHasMenuitem> bestellungspositionHasMenuitems = new List<BestellungspositionHasMenuitem>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// get data from api
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
bestellungspositionHasMenuitems = await Http.GetFromJsonAsync<List<BestellungspositionHasMenuitem>>("https://localhost:7076/api/BestellungspositionHasMenuitems");
|
|
||||||
|
|
||||||
|
|
||||||
// get kunde from localstorage
|
|
||||||
int kundeId = localStorage.GetItem<int>("KundeId");
|
|
||||||
kunde = kunden.Where(x => x.Idkunde == kundeId).FirstOrDefault();
|
|
||||||
|
|
||||||
// get all menuitemIds from bestellungspositions with the last date
|
|
||||||
foreach (var 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)
|
|
||||||
{
|
|
||||||
rabattEinloesen = true;
|
|
||||||
foreach (var rabatt in rabatte)
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// get summe
|
|
||||||
foreach (var menuitem in menuitems)
|
|
||||||
{
|
|
||||||
foreach (var menuitemId in menuitemIds)
|
|
||||||
{
|
|
||||||
if (menuitem.IdmenuItem == menuitemId.Key)
|
|
||||||
{
|
|
||||||
summe += menuitem.Preis * menuitemId.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//if rabatt is used calculate new summe
|
|
||||||
if (rabattEinloesen)
|
|
||||||
{
|
|
||||||
rabattGutschrift = (summe * rabatt.Prozent / 100);
|
|
||||||
summe = summe - rabattGutschrift;
|
|
||||||
summe = Math.Round(summe, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal Preis { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BestellungspositionHasMenuitem
|
|
||||||
{
|
|
||||||
public int Bestellungsposition_IDBestellung { get; set; }
|
|
||||||
public int MenuItem_IDMenuItem { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,36 +1,5 @@
|
|||||||
@page "/FBestätigung"
|
@page "/FBestätigung"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
<h4>Vielen Dank für Ihr Feedback. Durch Feedbacks können wir uns stets verbessern.<br></h4>
|
<h4>Vielen Dank für Ihr Feedback. Durch Feedbacks können wir uns stets verbessern.<br></h4>
|
||||||
|
|
||||||
@ -38,3 +7,9 @@
|
|||||||
<input type="submit" value="Zur Startseite" class="btn">
|
<input type="submit" value="Zur Startseite" class="btn">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -1,37 +1,5 @@
|
|||||||
@page "/Feedback"
|
@page "/Feedback"
|
||||||
|
|
||||||
@inject HttpClient Http
|
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
int Idkunde { get; set; }
|
|
||||||
public string Code { get; set; }
|
|
||||||
public int Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
<h4 for="feedback">Ihr Feedback: </h4>
|
<h4 for="feedback">Ihr Feedback: </h4>
|
||||||
@ -46,4 +14,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@code {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -1,303 +1,30 @@
|
|||||||
@page "/Kontoverwaltung"
|
@page "/Kontoverwaltung"
|
||||||
|
|
||||||
@inject HttpClient Http
|
<h3>Wichtige Informationen</h3> <br>
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<h3>Wichtige Informationen</h3>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
|
|
||||||
@*log out Button *@
|
|
||||||
<div class="container mt-auto">
|
|
||||||
<button class="btn" type="button" onclick="@Logout" id="button1">@button1</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="container mt-auto">
|
<div class="container mt-auto">
|
||||||
<h4>AccountID: @kunde.Code</h4>
|
<h4>AccountID: @RegistrierungA.userName</h4>
|
||||||
<h4>Ihr QR-Code: </h4>
|
<h4>Ihr QR-Code: </h4>
|
||||||
<img src="assets/K-QR.png" class="img" title="logo image">
|
<img src="assets/K-QR.png" class="img" title="logo image">
|
||||||
|
|
||||||
<p><br>Ihr Konto wird 30 Tage nach der Deaktivierung unwiderruflich gelöscht.</p>
|
|
||||||
<button class="btn" type="button" onclick="@ChangeButton" id="button1">@button1</button>
|
|
||||||
|
|
||||||
|
<p><br>Ihr Konto wird 30 Tage nach der Deaktivierung unwiderruflich gelöscht.</p>
|
||||||
|
<button class="btn" type="button" onclick="@ChangeButton" id="button1">@button1</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container mt-auto">
|
<br><br>
|
||||||
<h1>Bestellübersicht</h1>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12 col-lg-6">
|
|
||||||
@*Tabelle Ihre Bestellung*@
|
|
||||||
<div class="tbl-container">
|
|
||||||
<table class="table bdr">
|
|
||||||
<thead class="bg_green">
|
|
||||||
<tr>
|
|
||||||
<td>Ihre Bestellung (@day.@month.@year)</td>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="bg_lightgreen" style="background-color:white;">
|
|
||||||
@if (menuitemIds.Count == 0)
|
|
||||||
{
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">Warenkorb ist leer</h5>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@foreach (var item in menuitemIds)
|
|
||||||
{
|
|
||||||
@foreach (var item2 in menuitems)
|
|
||||||
{
|
|
||||||
@if (item.Key == item2.IdmenuItem)
|
|
||||||
{
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="br" style="padding-top:20px; padding-bottom:0px; border-bottom-width: 0px;">
|
|
||||||
@item.Value x
|
|
||||||
@item2.Bezeichnung
|
|
||||||
<div style="font-size:0.7rem;padding-left:15px;">@item2.Zusatzinformation</div>
|
|
||||||
</td>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="padding-top:20px; border-bottom-width:0px;">@(item2.Preis * item.Value)€</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
<tfoot class="bg_lightgreen">
|
|
||||||
<tr style="border-top:solid 1px black; background-color:white;">
|
|
||||||
<th class="" style="text-align:right;">Summe</th>
|
|
||||||
<td class="d-flex justify-content-center align-items-center">
|
|
||||||
@summe€
|
|
||||||
@if (rabattEinloesen)
|
|
||||||
{
|
|
||||||
<span style="color:green;">(- @rabatt.Prozent%)</span>
|
|
||||||
}
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-12 col-lg-6">
|
|
||||||
|
|
||||||
<div class="d-flex flex-column align-items-center ">
|
|
||||||
<div class="tbl-container w-100">
|
|
||||||
<!-- <== overflow: hidden applied to parent -->
|
|
||||||
<table class="table table-bordered bdr " style=" border-radius: 50px; margin-left: 50px;">
|
|
||||||
<thead class="bg_green">
|
|
||||||
<tr>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="border-bottom:0px;">
|
|
||||||
<p>Abholzeit</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td class="d-flex justify-content-center align-items-center" style="padding-top:0px; background-color:white;">
|
|
||||||
<div style="margin:20px;">
|
|
||||||
<div class="d-flex justify-content-center align-items-center">
|
|
||||||
<p>@hour:@minute Uhr (@day.@month.@year)</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<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_forward w-75">Bestellung abschließen</button>*@
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Kunde> kunden = new List<Kunde>();
|
bool changeButtonBool { get; set; } = true;
|
||||||
private Kunde kunde = new Kunde();
|
|
||||||
|
|
||||||
bool changeButtonBool { get; set; } = true;
|
string button1 => changeButtonBool ? "Konto deaktivieren" : "Konto aktivieren";
|
||||||
|
|
||||||
string button1 => changeButtonBool ? "Konto deaktivieren" : "Konto aktivieren";
|
void ChangeButton()
|
||||||
|
{
|
||||||
void ChangeButton()
|
//TODO Datenbankaktualisierung
|
||||||
{
|
changeButtonBool = !changeButtonBool;
|
||||||
//TODO Datenbankaktualisierung
|
}
|
||||||
changeButtonBool = !changeButtonBool;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Logout()
|
|
||||||
{
|
|
||||||
localStorage.Clear();
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
public int hour;
|
|
||||||
public int minute;
|
|
||||||
public int day;
|
|
||||||
public int month;
|
|
||||||
public int year;
|
|
||||||
|
|
||||||
|
|
||||||
public decimal summe;
|
|
||||||
public Dictionary<int, int> menuitemIds = new Dictionary<int, int>();
|
|
||||||
private Rabatt rabatt = new Rabatt();
|
|
||||||
private bool rabattEinloesen;
|
|
||||||
|
|
||||||
public decimal rabattGutschrift;
|
|
||||||
|
|
||||||
|
|
||||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
|
||||||
private List<Menuitem> menuitems = new List<Menuitem>();
|
|
||||||
private List<Rabatt> rabatte = new List<Rabatt>();
|
|
||||||
private List<BestellungspositionHasMenuitem> bestellungspositionHasMenuitems = new List<BestellungspositionHasMenuitem>();
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
// get data from api
|
|
||||||
bestellungspositions = await Http.GetFromJsonAsync<List<Bestellungsposition>>("https://localhost:7076/api/bestellungspositionen");
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
menuitems = await Http.GetFromJsonAsync<List<Menuitem>>("https://localhost:7076/api/Menuitems");
|
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
|
||||||
bestellungspositionHasMenuitems = await Http.GetFromJsonAsync<List<BestellungspositionHasMenuitem>>("https://localhost:7076/api/BestellungspositionHasMenuitems");
|
|
||||||
|
|
||||||
// get kunde from local storage
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
|
|
||||||
// get all menuitemIds from bestellungspositions with the last date
|
|
||||||
foreach (Bestellungsposition bestellungsposition in bestellungspositions)
|
|
||||||
{
|
|
||||||
if (bestellungsposition.KundeIdkunde == kunde.Idkunde)
|
|
||||||
{
|
|
||||||
|
|
||||||
// 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)
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// get summe
|
|
||||||
foreach (var menuitem in menuitems)
|
|
||||||
{
|
|
||||||
foreach (var menuitemId in menuitemIds)
|
|
||||||
{
|
|
||||||
if (menuitem.IdmenuItem == menuitemId.Key)
|
|
||||||
{
|
|
||||||
summe += menuitem.Preis * menuitemId.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//if rabatt is used calculate new summe
|
|
||||||
if (rabattEinloesen)
|
|
||||||
{
|
|
||||||
rabattGutschrift = (summe * rabatt.Prozent / 100);
|
|
||||||
summe = summe - rabattGutschrift;
|
|
||||||
summe = Math.Round(summe, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Bestellungsposition
|
|
||||||
{
|
|
||||||
public int Idbestellung { get; set; }
|
|
||||||
|
|
||||||
public int Menge { get; set; }
|
|
||||||
|
|
||||||
public DateTime Datum { get; set; }
|
|
||||||
|
|
||||||
public int KundeIdkunde { get; set; }
|
|
||||||
|
|
||||||
public int? RabattIdrabatt { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
public class Kunde
|
|
||||||
{
|
|
||||||
public int Idkunde { get; set; }
|
|
||||||
|
|
||||||
public string? Code { get; set; }
|
|
||||||
|
|
||||||
public int? Treuepunkte { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Menuitem
|
|
||||||
{
|
|
||||||
public int IdmenuItem { get; set; }
|
|
||||||
|
|
||||||
public string? Bezeichnung { get; set; }
|
|
||||||
|
|
||||||
public string? Zusatzinformation { get; set; }
|
|
||||||
|
|
||||||
public decimal Preis { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public class Rabatt
|
|
||||||
{
|
|
||||||
public int Idrabatt { get; set; }
|
|
||||||
|
|
||||||
public decimal Prozent { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitVon { get; set; }
|
|
||||||
|
|
||||||
public DateTime? GueltigkeitBis { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BestellungspositionHasMenuitem
|
|
||||||
{
|
|
||||||
public int Bestellungsposition_IDBestellung { get; set; }
|
|
||||||
public int MenuItem_IDMenuItem { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
@page "/Yummy-Punkte"
|
@page "/Yummy-Punkte"
|
||||||
@inject HttpClient Http
|
@inject HttpClient Http
|
||||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
||||||
@inject NavigationManager _navigationManager
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||||
@ -60,23 +59,10 @@
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
// kunde login start
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
|
||||||
|
|
||||||
if (localStorage.ContainKey("kunde"))
|
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
else
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
|
|
||||||
if (kunde != null && !kunden.Any(k => k.Code == kunde.Code))
|
|
||||||
_navigationManager.NavigateTo("/");
|
|
||||||
// kunde login end
|
|
||||||
|
|
||||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
||||||
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
rabatte = await Http.GetFromJsonAsync<List<Rabatt>>("https://localhost:7076/api/Rabatte");
|
||||||
|
|
||||||
// get kunde from local storage
|
kunde = kunden[0];
|
||||||
kunde = localStorage.GetItem<Kunde>("kunde");
|
|
||||||
|
|
||||||
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
// get the most recent rabatt, that are still valid (GueltigkeitBis)
|
||||||
// if there is no rabatt, set the rabatt to null
|
// if there is no rabatt, set the rabatt to null
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
border-radius: 17px;
|
border-radius: 17px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-color: #C7FFD5;
|
border-color: #C7FFD5;
|
||||||
border-width: 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg_lightgreen {
|
.bg_lightgreen {
|
||||||
@ -24,19 +23,19 @@
|
|||||||
border-bottom-width: 0;
|
border-bottom-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn_bg {
|
.btn_back {
|
||||||
background-color: #F9BE89;
|
background-color: #F9BE89;
|
||||||
/*width: 60%;*/
|
/*width: 60%;*/
|
||||||
margin-bottom: 13px;
|
margin-bottom: 13px;
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
/*height: 50px;*/
|
height: 50px;
|
||||||
/*border: 0px;*/
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn_forward {
|
.btn_forward {
|
||||||
background-color: #89F9A5;
|
background-color: #89F9A5;
|
||||||
/*width: 60%;*/
|
/*width: 60%;*/
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
/*height: 50px;*/
|
height: 50px;
|
||||||
/*border: 0px;*/
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
@ -7,20 +7,6 @@
|
|||||||
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
|
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="Pages\SpeisekarteCnDetails.razor.css" />
|
|
||||||
<None Remove="Pages\SpeisekarteDrDetails.razor.css" />
|
|
||||||
<None Remove="Pages\SpeisekarteEtcDetails.razor.css" />
|
|
||||||
<None Remove="Pages\SpeisekarteJpDetails.razor.css" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="Pages\SpeisekarteCnDetails.razor.css" />
|
|
||||||
<Content Include="Pages\SpeisekarteDrDetails.razor.css" />
|
|
||||||
<Content Include="Pages\SpeisekarteEtcDetails.razor.css" />
|
|
||||||
<Content Include="Pages\SpeisekarteJpDetails.razor.css" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="wwwroot\css\Site.css" />
|
<None Include="wwwroot\css\Site.css" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Reference in New Issue
Block a user