Compare commits
67 Commits
main
...
a51fe08db8
Author | SHA1 | Date | |
---|---|---|---|
a51fe08db8 | |||
9cd1376cfd | |||
70541c1b4d | |||
b008d87ec8 | |||
4d9bc7d7b5 | |||
05f95d8085 | |||
e181c13ac2 | |||
7f45436118 | |||
818fe95ca1 | |||
3b6896b630 | |||
2d23f8a022 | |||
bfa440ac5e | |||
901ec9f39a | |||
409f425656 | |||
53038f403a | |||
9a138b44eb | |||
797eec085c | |||
e6a5ad5270 | |||
5e30e0af12 | |||
742ee5c6c8 | |||
32f935af08 | |||
526105a802 | |||
56255c2655 | |||
d28880e4f6 | |||
abaeafde33 | |||
07e0e6e0c0 | |||
fb705d074b | |||
a8d0225f92 | |||
4d73dae8bb | |||
5ea452c653 | |||
2581c2842f | |||
42281147cd | |||
d0df8c3fd6 | |||
b4f74320e0 | |||
b2fecb868e | |||
c067221529 | |||
133e50f24a | |||
11759b2745 | |||
7fe91cbdec | |||
524134a75f | |||
9f505ca6ab | |||
450388e933 | |||
57042af156 | |||
bf8776a4f9 | |||
1969432980 | |||
b77e5c474e | |||
6aa1593f76 | |||
6a9927b8fc | |||
e61ff76dfb | |||
82fd0173e9 | |||
55c5b47978 | |||
a8f606ec54 | |||
b4627caddb | |||
e6eab604e5 | |||
47c0d268b2 | |||
f6345777dd | |||
88acdefc7f | |||
e946c01e23 | |||
10eed12b67 | |||
a987dbeea5 | |||
23d3743be3 | |||
70eb2e53d7 | |||
662b143307 | |||
6a9404cb5f | |||
233f41a1fc | |||
2093696253 | |||
b1fdecbc7e |
2
.gitignore
vendored
@ -136,3 +136,5 @@ $RECYCLE.BIN/
|
||||
.DS_Store
|
||||
|
||||
_NCrunch*
|
||||
/src/WebApi/appsettings.json
|
||||
/src/WebApi/appsettings.json
|
||||
|
@ -1,18 +0,0 @@
|
||||
@page "/counter"
|
||||
|
||||
<PageTitle>Counter</PageTitle>
|
||||
|
||||
<h1>Counter</h1>
|
||||
|
||||
<p role="status">Current count: @currentCount</p>
|
||||
|
||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||
|
||||
@code {
|
||||
private int currentCount = 0;
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
currentCount++;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
@page "/"
|
||||
|
||||
<PageTitle>Index</PageTitle>
|
||||
|
||||
<h1>Hello, world!</h1>
|
||||
|
||||
Welcome to your new app.
|
||||
|
||||
<SurveyPrompt Title="How is Blazor working for you?" />
|
@ -1,17 +0,0 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<div class="page">
|
||||
<div class="sidebar">
|
||||
<NavMenu />
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<div class="top-row px-4">
|
||||
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
|
||||
</div>
|
||||
|
||||
<article class="content px-4">
|
||||
@Body
|
||||
</article>
|
||||
</main>
|
||||
</div>
|
@ -1,81 +0,0 @@
|
||||
.page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #d6d5d5;
|
||||
justify-content: flex-end;
|
||||
height: 3.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
white-space: nowrap;
|
||||
margin-left: 1.5rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.top-row ::deep a:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media (max-width: 640.98px) {
|
||||
.top-row:not(.auth) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.top-row.auth {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.page {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
height: 100vh;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.top-row.auth ::deep a:first-child {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.top-row, article {
|
||||
padding-left: 2rem !important;
|
||||
padding-right: 1.5rem !important;
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
<div class="top-row ps-3 navbar navbar-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="">y4f</a>
|
||||
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
|
||||
<nav class="flex-column">
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
||||
<span class="oi oi-home" aria-hidden="true"></span> Home
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="counter">
|
||||
<span class="oi oi-plus" aria-hidden="true"></span> Counter
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="fetchdata">
|
||||
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
|
||||
</NavLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private bool collapseNavMenu = true;
|
||||
|
||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
|
||||
private void ToggleNavMenu()
|
||||
{
|
||||
collapseNavMenu = !collapseNavMenu;
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
.navbar-toggler {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
height: 3.5rem;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.oi {
|
||||
width: 2rem;
|
||||
font-size: 1.1rem;
|
||||
vertical-align: text-top;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 0.9rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.nav-item:first-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item:last-of-type {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep a {
|
||||
color: #d7d7d7;
|
||||
border-radius: 4px;
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 3rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep a.active {
|
||||
background-color: rgba(255,255,255,0.25);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-item ::deep a:hover {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
color: white;
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.navbar-toggler {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.collapse {
|
||||
/* Never collapse the sidebar for wide screens */
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
/* Allow sidebar to scroll for tall menus */
|
||||
height: calc(100vh - 3.5rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
140
src/WebApi/Controllers/AllergienController.cs
Normal file
@ -0,0 +1,140 @@
|
||||
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.Models;
|
||||
using WebApi.Data;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class AllergienController : ControllerBase
|
||||
{
|
||||
private readonly WebApiContext _context;
|
||||
|
||||
public AllergienController(WebApiContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: api/Allergien
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Allergie>>> GetAllergies()
|
||||
{
|
||||
if (_context.Allergies == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return await _context.Allergies.ToListAsync();
|
||||
}
|
||||
|
||||
// GET: api/Allergien/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<Allergie>> GetAllergie(int id)
|
||||
{
|
||||
if (_context.Allergies == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var allergie = await _context.Allergies.FindAsync(id);
|
||||
|
||||
if (allergie == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return allergie;
|
||||
}
|
||||
|
||||
// PUT: api/Allergien/5
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutAllergie(int id, Allergie allergie)
|
||||
{
|
||||
if (id != allergie.Idallergie)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
_context.Entry(allergie).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!AllergieExists(id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// POST: api/Allergien
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Allergie>> PostAllergie(Allergie allergie)
|
||||
{
|
||||
if (_context.Allergies == null)
|
||||
{
|
||||
return Problem("Entity set 'WebApiContext.Allergies' is null.");
|
||||
}
|
||||
_context.Allergies.Add(allergie);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
if (AllergieExists(allergie.Idallergie))
|
||||
{
|
||||
return Conflict();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedAtAction("GetAllergie", new { id = allergie.Idallergie }, allergie);
|
||||
}
|
||||
|
||||
// DELETE: api/Allergien/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteAllergie(int id)
|
||||
{
|
||||
if (_context.Allergies == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var allergie = await _context.Allergies.FindAsync(id);
|
||||
if (allergie == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
_context.Allergies.Remove(allergie);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
private bool AllergieExists(int id)
|
||||
{
|
||||
return (_context.Allergies?.Any(e => e.Idallergie == id)).GetValueOrDefault();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
138
src/WebApi/Controllers/BestellungspositionenController.cs
Normal file
@ -0,0 +1,138 @@
|
||||
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 BestellungspositionenController : ControllerBase
|
||||
{
|
||||
private readonly WebApiContext _context;
|
||||
|
||||
public BestellungspositionenController(WebApiContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: api/Bestellungspositionen
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Bestellungsposition>>> GetBestellungspositions()
|
||||
{
|
||||
if (_context.Bestellungspositions == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return await _context.Bestellungspositions.ToListAsync();
|
||||
}
|
||||
|
||||
// GET: api/Bestellungspositionen/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<Bestellungsposition>> GetBestellungsposition(int id)
|
||||
{
|
||||
if (_context.Bestellungspositions == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var bestellungsposition = await _context.Bestellungspositions.FindAsync(id);
|
||||
|
||||
if (bestellungsposition == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return bestellungsposition;
|
||||
}
|
||||
|
||||
// PUT: api/Bestellungspositionen/5
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutBestellungsposition(int id, Bestellungsposition bestellungsposition)
|
||||
{
|
||||
if (id != bestellungsposition.Idbestellung)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
_context.Entry(bestellungsposition).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!BestellungspositionExists(id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// POST: api/Bestellungspositionen
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Bestellungsposition>> PostBestellungsposition(Bestellungsposition bestellungsposition)
|
||||
{
|
||||
if (_context.Bestellungspositions == null)
|
||||
{
|
||||
return Problem("Entity set 'WebApiContext.Bestellungspositions' is null.");
|
||||
}
|
||||
_context.Bestellungspositions.Add(bestellungsposition);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
if (BestellungspositionExists(bestellungsposition.Idbestellung))
|
||||
{
|
||||
return Conflict();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedAtAction("GetBestellungsposition", new { id = bestellungsposition.Idbestellung }, bestellungsposition);
|
||||
}
|
||||
|
||||
// DELETE: api/Bestellungspositionen/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteBestellungsposition(int id)
|
||||
{
|
||||
if (_context.Bestellungspositions == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var bestellungsposition = await _context.Bestellungspositions.FindAsync(id);
|
||||
if (bestellungsposition == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
_context.Bestellungspositions.Remove(bestellungsposition);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
private bool BestellungspositionExists(int id)
|
||||
{
|
||||
return (_context.Bestellungspositions?.Any(e => e.Idbestellung == id)).GetValueOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
138
src/WebApi/Controllers/KundenController.cs
Normal file
@ -0,0 +1,138 @@
|
||||
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 KundenController : ControllerBase
|
||||
{
|
||||
private readonly WebApiContext _context;
|
||||
|
||||
public KundenController(WebApiContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: api/Kunden
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Kunde>>> GetKundes()
|
||||
{
|
||||
if (_context.Kundes == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return await _context.Kundes.ToListAsync();
|
||||
}
|
||||
|
||||
// GET: api/Kunden/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<Kunde>> GetKunde(int id)
|
||||
{
|
||||
if (_context.Kundes == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var kunde = await _context.Kundes.FindAsync(id);
|
||||
|
||||
if (kunde == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return kunde;
|
||||
}
|
||||
|
||||
// PUT: api/Kunden/5
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutKunde(int id, Kunde kunde)
|
||||
{
|
||||
if (id != kunde.Idkunde)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
_context.Entry(kunde).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!KundeExists(id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// POST: api/Kunden
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Kunde>> PostKunde(Kunde kunde)
|
||||
{
|
||||
if (_context.Kundes == null)
|
||||
{
|
||||
return Problem("Entity set 'WebApiContext.Kundes' is null.");
|
||||
}
|
||||
_context.Kundes.Add(kunde);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
if (KundeExists(kunde.Idkunde))
|
||||
{
|
||||
return Conflict();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedAtAction("GetKunde", new { id = kunde.Idkunde }, kunde);
|
||||
}
|
||||
|
||||
// DELETE: api/Kunden/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteKunde(int id)
|
||||
{
|
||||
if (_context.Kundes == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var kunde = await _context.Kundes.FindAsync(id);
|
||||
if (kunde == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
_context.Kundes.Remove(kunde);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
private bool KundeExists(int id)
|
||||
{
|
||||
return (_context.Kundes?.Any(e => e.Idkunde == id)).GetValueOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
138
src/WebApi/Controllers/MenuitemHasAllergiesController.cs
Normal file
@ -0,0 +1,138 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
138
src/WebApi/Controllers/MenuitemkategoriesController.cs
Normal file
@ -0,0 +1,138 @@
|
||||
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 MenuitemkategoriesController : ControllerBase
|
||||
{
|
||||
private readonly WebApiContext _context;
|
||||
|
||||
public MenuitemkategoriesController(WebApiContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: api/Menuitemkategories
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Menuitemkategorie>>> GetMenuitemkategories()
|
||||
{
|
||||
if (_context.Menuitemkategories == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return await _context.Menuitemkategories.ToListAsync();
|
||||
}
|
||||
|
||||
// GET: api/Menuitemkategories/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<Menuitemkategorie>> GetMenuitemkategorie(int id)
|
||||
{
|
||||
if (_context.Menuitemkategories == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var menuitemkategorie = await _context.Menuitemkategories.FindAsync(id);
|
||||
|
||||
if (menuitemkategorie == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return menuitemkategorie;
|
||||
}
|
||||
|
||||
// PUT: api/Menuitemkategories/5
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutMenuitemkategorie(int id, Menuitemkategorie menuitemkategorie)
|
||||
{
|
||||
if (id != menuitemkategorie.IdmenuItemKategorie)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
_context.Entry(menuitemkategorie).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!MenuitemkategorieExists(id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// POST: api/Menuitemkategories
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Menuitemkategorie>> PostMenuitemkategorie(Menuitemkategorie menuitemkategorie)
|
||||
{
|
||||
if (_context.Menuitemkategories == null)
|
||||
{
|
||||
return Problem("Entity set 'WebApiContext.Menuitemkategories' is null.");
|
||||
}
|
||||
_context.Menuitemkategories.Add(menuitemkategorie);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
if (MenuitemkategorieExists(menuitemkategorie.IdmenuItemKategorie))
|
||||
{
|
||||
return Conflict();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedAtAction("GetMenuitemkategorie", new { id = menuitemkategorie.IdmenuItemKategorie }, menuitemkategorie);
|
||||
}
|
||||
|
||||
// DELETE: api/Menuitemkategories/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteMenuitemkategorie(int id)
|
||||
{
|
||||
if (_context.Menuitemkategories == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var menuitemkategorie = await _context.Menuitemkategories.FindAsync(id);
|
||||
if (menuitemkategorie == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
_context.Menuitemkategories.Remove(menuitemkategorie);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
private bool MenuitemkategorieExists(int id)
|
||||
{
|
||||
return (_context.Menuitemkategories?.Any(e => e.IdmenuItemKategorie == id)).GetValueOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
138
src/WebApi/Controllers/MenuitemsController.cs
Normal file
@ -0,0 +1,138 @@
|
||||
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 MenuitemsController : ControllerBase
|
||||
{
|
||||
private readonly WebApiContext _context;
|
||||
|
||||
public MenuitemsController(WebApiContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: api/Menuitems
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Menuitem>>> GetMenuitems()
|
||||
{
|
||||
if (_context.Menuitems == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return await _context.Menuitems.ToListAsync();
|
||||
}
|
||||
|
||||
// GET: api/Menuitems/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<Menuitem>> GetMenuitem(int id)
|
||||
{
|
||||
if (_context.Menuitems == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var menuitem = await _context.Menuitems.FindAsync(id);
|
||||
|
||||
if (menuitem == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return menuitem;
|
||||
}
|
||||
|
||||
// PUT: api/Menuitems/5
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutMenuitem(int id, Menuitem menuitem)
|
||||
{
|
||||
if (id != menuitem.IdmenuItem)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
_context.Entry(menuitem).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!MenuitemExists(id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// POST: api/Menuitems
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Menuitem>> PostMenuitem(Menuitem menuitem)
|
||||
{
|
||||
if (_context.Menuitems == null)
|
||||
{
|
||||
return Problem("Entity set 'WebApiContext.Menuitems' is null.");
|
||||
}
|
||||
_context.Menuitems.Add(menuitem);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
if (MenuitemExists(menuitem.IdmenuItem))
|
||||
{
|
||||
return Conflict();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedAtAction("GetMenuitem", new { id = menuitem.IdmenuItem }, menuitem);
|
||||
}
|
||||
|
||||
// DELETE: api/Menuitems/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteMenuitem(int id)
|
||||
{
|
||||
if (_context.Menuitems == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var menuitem = await _context.Menuitems.FindAsync(id);
|
||||
if (menuitem == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
_context.Menuitems.Remove(menuitem);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
private bool MenuitemExists(int id)
|
||||
{
|
||||
return (_context.Menuitems?.Any(e => e.IdmenuItem == id)).GetValueOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
138
src/WebApi/Controllers/MenuitemueberkategoriesController.cs
Normal file
@ -0,0 +1,138 @@
|
||||
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 MenuitemueberkategoriesController : ControllerBase
|
||||
{
|
||||
private readonly WebApiContext _context;
|
||||
|
||||
public MenuitemueberkategoriesController(WebApiContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: api/Menuitemueberkategories
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Menuitemueberkategorie>>> GetMenuitemueberkategories()
|
||||
{
|
||||
if (_context.Menuitemueberkategories == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return await _context.Menuitemueberkategories.ToListAsync();
|
||||
}
|
||||
|
||||
// GET: api/Menuitemueberkategories/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<Menuitemueberkategorie>> GetMenuitemueberkategorie(int id)
|
||||
{
|
||||
if (_context.Menuitemueberkategories == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var menuitemueberkategorie = await _context.Menuitemueberkategories.FindAsync(id);
|
||||
|
||||
if (menuitemueberkategorie == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return menuitemueberkategorie;
|
||||
}
|
||||
|
||||
// PUT: api/Menuitemueberkategories/5
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutMenuitemueberkategorie(int id, Menuitemueberkategorie menuitemueberkategorie)
|
||||
{
|
||||
if (id != menuitemueberkategorie.IdmenuItemUeberkategorie)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
_context.Entry(menuitemueberkategorie).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!MenuitemueberkategorieExists(id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// POST: api/Menuitemueberkategories
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Menuitemueberkategorie>> PostMenuitemueberkategorie(Menuitemueberkategorie menuitemueberkategorie)
|
||||
{
|
||||
if (_context.Menuitemueberkategories == null)
|
||||
{
|
||||
return Problem("Entity set 'WebApiContext.Menuitemueberkategories' is null.");
|
||||
}
|
||||
_context.Menuitemueberkategories.Add(menuitemueberkategorie);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
if (MenuitemueberkategorieExists(menuitemueberkategorie.IdmenuItemUeberkategorie))
|
||||
{
|
||||
return Conflict();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedAtAction("GetMenuitemueberkategorie", new { id = menuitemueberkategorie.IdmenuItemUeberkategorie }, menuitemueberkategorie);
|
||||
}
|
||||
|
||||
// DELETE: api/Menuitemueberkategories/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteMenuitemueberkategorie(int id)
|
||||
{
|
||||
if (_context.Menuitemueberkategories == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var menuitemueberkategorie = await _context.Menuitemueberkategories.FindAsync(id);
|
||||
if (menuitemueberkategorie == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
_context.Menuitemueberkategories.Remove(menuitemueberkategorie);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
private bool MenuitemueberkategorieExists(int id)
|
||||
{
|
||||
return (_context.Menuitemueberkategories?.Any(e => e.IdmenuItemUeberkategorie == id)).GetValueOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
138
src/WebApi/Controllers/RabatteController.cs
Normal file
@ -0,0 +1,138 @@
|
||||
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 RabatteController : ControllerBase
|
||||
{
|
||||
private readonly WebApiContext _context;
|
||||
|
||||
public RabatteController(WebApiContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: api/Rabatte
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Rabatt>>> GetRabatts()
|
||||
{
|
||||
if (_context.Rabatts == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return await _context.Rabatts.ToListAsync();
|
||||
}
|
||||
|
||||
// GET: api/Rabatte/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<Rabatt>> GetRabatt(int id)
|
||||
{
|
||||
if (_context.Rabatts == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var rabatt = await _context.Rabatts.FindAsync(id);
|
||||
|
||||
if (rabatt == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return rabatt;
|
||||
}
|
||||
|
||||
// PUT: api/Rabatte/5
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutRabatt(int id, Rabatt rabatt)
|
||||
{
|
||||
if (id != rabatt.Idrabatt)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
_context.Entry(rabatt).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!RabattExists(id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// POST: api/Rabatte
|
||||
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Rabatt>> PostRabatt(Rabatt rabatt)
|
||||
{
|
||||
if (_context.Rabatts == null)
|
||||
{
|
||||
return Problem("Entity set 'WebApiContext.Rabatts' is null.");
|
||||
}
|
||||
_context.Rabatts.Add(rabatt);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
if (RabattExists(rabatt.Idrabatt))
|
||||
{
|
||||
return Conflict();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedAtAction("GetRabatt", new { id = rabatt.Idrabatt }, rabatt);
|
||||
}
|
||||
|
||||
// DELETE: api/Rabatte/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteRabatt(int id)
|
||||
{
|
||||
if (_context.Rabatts == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var rabatt = await _context.Rabatts.FindAsync(id);
|
||||
if (rabatt == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
_context.Rabatts.Remove(rabatt);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
private bool RabattExists(int id)
|
||||
{
|
||||
return (_context.Rabatts?.Any(e => e.Idrabatt == id)).GetValueOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
266
src/WebApi/Data/WebApiContext.cs
Normal file
@ -0,0 +1,266 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using WebApi.Models;
|
||||
|
||||
namespace WebApi.Data;
|
||||
|
||||
public partial class WebApiContext : DbContext
|
||||
{
|
||||
public WebApiContext(DbContextOptions<WebApiContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<Allergie> Allergies { get; set; }
|
||||
|
||||
public virtual DbSet<Bestellungsposition> Bestellungspositions { get; set; }
|
||||
|
||||
public virtual DbSet<Kunde> Kundes { get; set; }
|
||||
|
||||
public virtual DbSet<Menuitem> Menuitems { get; set; }
|
||||
|
||||
public virtual DbSet<Menuitemkategorie> Menuitemkategories { get; set; }
|
||||
|
||||
public virtual DbSet<Menuitemueberkategorie> Menuitemueberkategories { get; set; }
|
||||
|
||||
public virtual DbSet<Rabatt> Rabatts { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder
|
||||
.UseCollation("utf8_general_ci")
|
||||
.HasCharSet("utf8");
|
||||
|
||||
modelBuilder.Entity<Allergie>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Idallergie).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("allergie");
|
||||
|
||||
entity.Property(e => e.Idallergie)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("IDAllergie");
|
||||
entity.Property(e => e.Beschreibung).HasMaxLength(45);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Bestellungsposition>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Idbestellung).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("bestellungsposition");
|
||||
|
||||
entity.HasIndex(e => e.KundeIdkunde, "fk_Bestellung_Kunde");
|
||||
|
||||
entity.HasIndex(e => e.RabattIdrabatt, "fk_Bestellungsposition_Rabatt1");
|
||||
|
||||
entity.Property(e => e.Idbestellung)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("IDBestellung");
|
||||
entity.Property(e => e.Datum).HasColumnType("datetime");
|
||||
entity.Property(e => e.KundeIdkunde)
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("Kunde_IDKunde");
|
||||
entity.Property(e => e.Menge).HasColumnType("int(11)");
|
||||
entity.Property(e => e.RabattIdrabatt)
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("Rabatt_IDRabatt");
|
||||
|
||||
entity.HasOne(d => d.KundeIdkundeNavigation).WithMany(p => p.Bestellungspositions)
|
||||
.HasForeignKey(d => d.KundeIdkunde)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_Bestellung_Kunde");
|
||||
|
||||
entity.HasOne(d => d.RabattIdrabattNavigation).WithMany(p => p.Bestellungspositions)
|
||||
.HasForeignKey(d => d.RabattIdrabatt)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_Bestellungsposition_Rabatt1");
|
||||
|
||||
entity.HasMany(d => d.MenuItemIdmenuItems).WithMany(p => p.BestellungspositionIdbestellungs)
|
||||
.UsingEntity<Dictionary<string, object>>(
|
||||
"BestellungspositionHasMenuitem",
|
||||
r => r.HasOne<Menuitem>().WithMany()
|
||||
.HasForeignKey("MenuItemIdmenuItem")
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_Bestellungsposition_has_MenuItem_MenuItem1"),
|
||||
l => l.HasOne<Bestellungsposition>().WithMany()
|
||||
.HasForeignKey("BestellungspositionIdbestellung")
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_Bestellungsposition_has_MenuItem_Bestellungsposition1"),
|
||||
j =>
|
||||
{
|
||||
j.HasKey("BestellungspositionIdbestellung", "MenuItemIdmenuItem")
|
||||
.HasName("PRIMARY")
|
||||
.HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });
|
||||
j.ToTable("bestellungsposition_has_menuitem");
|
||||
j.HasIndex(new[] { "MenuItemIdmenuItem" }, "fk_Bestellungsposition_has_MenuItem_MenuItem1");
|
||||
j.IndexerProperty<int>("BestellungspositionIdbestellung")
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("Bestellungsposition_IDBestellung");
|
||||
j.IndexerProperty<int>("MenuItemIdmenuItem")
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("MenuItem_IDMenuItem");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Kunde>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Idkunde).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("kunde");
|
||||
|
||||
entity.Property(e => e.Idkunde)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("IDKunde");
|
||||
entity.Property(e => e.Code)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("code");
|
||||
entity.Property(e => e.Treuepunkte).HasColumnType("int(11)");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Menuitem>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdmenuItem).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("menuitem");
|
||||
|
||||
entity.HasIndex(e => e.MenuItemKategorieIdmenuItemKategorie, "fk_MenuItem_MenuItemKategorie1");
|
||||
|
||||
entity.Property(e => e.IdmenuItem)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("IDMenuItem");
|
||||
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
||||
entity.Property(e => e.MenuItemKategorieIdmenuItemKategorie)
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("MenuItemKategorie_IDMenuItemKategorie");
|
||||
entity.Property(e => e.Preis).HasPrecision(8, 2);
|
||||
entity.Property(e => e.Zusatzinformation).HasMaxLength(45);
|
||||
|
||||
entity.HasOne(d => d.MenuItemKategorieIdmenuItemKategorieNavigation).WithMany(p => p.Menuitems)
|
||||
.HasForeignKey(d => d.MenuItemKategorieIdmenuItemKategorie)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_MenuItem_MenuItemKategorie1");
|
||||
|
||||
//entity.HasMany(d => d.AllergieIdallergies).WithMany(p => p.MenuItemIdmenuItems)
|
||||
// .UsingEntity<Dictionary<string, object>>(
|
||||
// "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");
|
||||
// });
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Menuitemkategorie>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdmenuItemKategorie).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("menuitemkategorie");
|
||||
|
||||
entity.HasIndex(e => e.MenuItemUeberkategorieIdmenuItemUeberkategorie, "fk_MenuItemKategorie_MenuItemUeberkategorie1");
|
||||
|
||||
entity.Property(e => e.IdmenuItemKategorie)
|
||||
.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)
|
||||
.HasForeignKey(d => d.MenuItemUeberkategorieIdmenuItemUeberkategorie)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_MenuItemKategorie_MenuItemUeberkategorie1");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Menuitemueberkategorie>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdmenuItemUeberkategorie).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("menuitemueberkategorie");
|
||||
|
||||
entity.Property(e => e.IdmenuItemUeberkategorie)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("IDMenuItemUeberkategorie");
|
||||
entity.Property(e => e.Bezeichnung).HasMaxLength(45);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Rabatt>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Idrabatt).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("rabatt");
|
||||
|
||||
entity.Property(e => e.Idrabatt)
|
||||
.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.HasKey(e => e.Id).HasName("PRIMARY");
|
||||
// entity.ToTable("admin");
|
||||
// entity.Property(e => e.Id)
|
||||
// .ValueGeneratedNever()
|
||||
// .HasColumnType("int(11)")
|
||||
// .HasColumnName("Id");
|
||||
// entity.Property(e => e.Username).HasMaxLength(100);
|
||||
// entity.Property(e => e.Password).HasMaxLength(100);
|
||||
//});
|
||||
|
||||
//modelBuilder.Entity<BestellungspositionHasMenuitem>(entity =>
|
||||
//{
|
||||
// entity.HasKey(e => new { e.BestellungspositionId, e.MenuitemId })
|
||||
// .HasName("PRIMARY");
|
||||
|
||||
// entity.ToTable("bestellungsposition_has_menuitem");
|
||||
|
||||
// entity.Property(e => e.BestellungspositionId).HasColumnType("int(11)");
|
||||
// entity.Property(e => e.MenuitemId).HasColumnType("int(11)");
|
||||
//});
|
||||
|
||||
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);
|
||||
|
||||
public DbSet<WebApi.Models.MenuitemHasAllergie> MenuitemHasAllergie { get; set; } = default!;
|
||||
}
|
13
src/WebApi/Models/Allergie.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebApi.Models;
|
||||
|
||||
public partial class Allergie
|
||||
{
|
||||
public int Idallergie { get; set; }
|
||||
|
||||
public string? Beschreibung { get; set; }
|
||||
|
||||
public virtual ICollection<Menuitem> MenuItemIdmenuItems { get; set; } = new List<Menuitem>();
|
||||
}
|
23
src/WebApi/Models/Bestellungsposition.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebApi.Models;
|
||||
|
||||
public partial 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>();
|
||||
}
|
15
src/WebApi/Models/Kunde.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebApi.Models;
|
||||
|
||||
public partial 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>();
|
||||
}
|
23
src/WebApi/Models/Menuitem.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebApi.Models;
|
||||
|
||||
public partial 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>();
|
||||
}
|
11
src/WebApi/Models/MenuitemHasAllergie.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace WebApi.Models
|
||||
{
|
||||
public class MenuitemHasAllergie
|
||||
{
|
||||
// navigation references Menuitem
|
||||
public int? MenuItem_IDMenuItem { get; set; }
|
||||
|
||||
// navigation references Allergie
|
||||
public int? Allergie_IDAllergie { get; set; }
|
||||
}
|
||||
}
|
17
src/WebApi/Models/Menuitemkategorie.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebApi.Models;
|
||||
|
||||
public partial 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>();
|
||||
}
|
13
src/WebApi/Models/Menuitemueberkategorie.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebApi.Models;
|
||||
|
||||
public partial class Menuitemueberkategorie
|
||||
{
|
||||
public int IdmenuItemUeberkategorie { get; set; }
|
||||
|
||||
public string? Bezeichnung { get; set; }
|
||||
|
||||
public virtual ICollection<Menuitemkategorie> Menuitemkategories { get; set; } = new List<Menuitemkategorie>();
|
||||
}
|
17
src/WebApi/Models/Rabatt.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebApi.Models;
|
||||
|
||||
public partial 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>();
|
||||
}
|
44
src/WebApi/Program.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
using WebApi.Data;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
builder.Services.AddDbContext<WebApiContext>(options =>
|
||||
{
|
||||
options.UseMySql(builder.Configuration.GetConnectionString("Y4FDB"),
|
||||
Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.23-mysql"));
|
||||
});
|
||||
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
//ip:port from y4f
|
||||
app.UseCors(policy =>
|
||||
policy.WithOrigins("http://localhost:5248", "https://localhost:7138")
|
||||
.AllowAnyMethod()
|
||||
.WithHeaders(HeaderNames.ContentType)
|
||||
);
|
||||
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
41
src/WebApi/Properties/launchSettings.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:38447",
|
||||
"sslPort": 44303
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5226",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7076;http://localhost:5226",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
0
src/WebApi/README.md
Normal file
24
src/WebApi/WebApi.csproj
Normal file
@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.7" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
8
src/WebApi/appsettings.Development.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
90
src/y4f/Pages/Allergene.razor
Normal file
@ -0,0 +1,90 @@
|
||||
@page "/allergene"
|
||||
|
||||
<PageTitle>Allergene</PageTitle>
|
||||
|
||||
<table class="tg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="tg-c3ow" colspan="3">Allergeninformation<br>gemäß Codex-Empfehlung </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="tg-0pky">Visuelles</td>
|
||||
<td class="tg-0pky">Kurzbezeichnung</td>
|
||||
<td class="tg-0pky">Buchstabencode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/getreide.png" alt="Getreide"></td>
|
||||
<td class="tg-0pky">glutenhaltiges Getreide</td>
|
||||
<td class="tg-c3ow">A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/krebstiere.png" alt="Krebstiere"></td>
|
||||
<td class="tg-0pky">Krebstiere</td>
|
||||
<td class="tg-c3ow">B</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/ei.png" alt="Ei"></td>
|
||||
<td class="tg-0pky">Ei</td>
|
||||
<td class="tg-c3ow">C</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/fisch.png" alt="Fisch"></td>
|
||||
<td class="tg-0pky">Fisch</td>
|
||||
<td class="tg-c3ow">D</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/erdnuss.png" alt="Erdnuss"></td>
|
||||
<td class="tg-0pky">Erdnuss</td>
|
||||
<td class="tg-c3ow">E</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/soja.png" alt="Soja"></td>
|
||||
<td class="tg-0pky">Soja</td>
|
||||
<td class="tg-c3ow">F</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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-c3ow">G</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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-c3ow">H</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/sellerie.png" alt="Sellerie"></td>
|
||||
<td class="tg-0pky">Sellerie</td>
|
||||
<td class="tg-c3ow">L</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/senf.png" alt="Senf"></td>
|
||||
<td class="tg-0pky">Senf</td>
|
||||
<td class="tg-c3ow">M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/sesam.png" alt="Sesam"></td>
|
||||
<td class="tg-0pky">Sesam</td>
|
||||
<td class="tg-c3ow">N</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/sulfite.png" alt="Sulfite"></td>
|
||||
<td class="tg-0pky">Sulfite</td>
|
||||
<td class="tg-c3ow">O</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/lupinen.png" alt="Lupinen"></td>
|
||||
<td class="tg-0pky">Lupinen</td>
|
||||
<td class="tg-c3ow">P</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0pky"><img class="icon" src="assets/weichtiere.png" alt="Weichtiere"></td>
|
||||
<td class="tg-0pky">Weichtiere</td>
|
||||
<td class="tg-c3ow">R</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br><br><br><br>
|
49
src/y4f/Pages/Allergene.razor.css
Normal file
@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
.tg {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.tg td {
|
||||
border-color: black;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
overflow: hidden;
|
||||
padding: 10px 5px;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.tg th {
|
||||
border-color: black;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
font-weight: normal;
|
||||
overflow: hidden;
|
||||
padding: 10px 5px;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.tg .tg-c3ow {
|
||||
border-color: inherit;
|
||||
text-align: center;
|
||||
vertical-align: center;
|
||||
}
|
||||
|
||||
.tg .tg-0pky {
|
||||
border-color: inherit;
|
||||
text-align: center;
|
||||
vertical-align: center;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 100%;
|
||||
max-width: 100px;
|
||||
height: auto;
|
||||
}
|
20
src/y4f/Pages/Index.razor
Normal file
@ -0,0 +1,20 @@
|
||||
@page "/"
|
||||
@layout Startseite
|
||||
|
||||
|
||||
<PageTitle>Yummy4Friends</PageTitle>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<img src="assets/Logo_new.png" class="img" title="logo image">
|
||||
|
||||
<form action="Speisekarte">
|
||||
<input type="submit" value="Zur Speisekarte" class="btn" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
129
src/y4f/Pages/ShoppingCart.razor
Normal file
@ -0,0 +1,129 @@
|
||||
@page "/shopping_cart"
|
||||
|
||||
<PageTitle>Warenkorb</PageTitle>
|
||||
|
||||
<h1>Warenkorb</h1>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<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</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg_lightgreen">
|
||||
<tr>
|
||||
<td class="br" style="padding-top:20px; padding-bottom:0px; border-bottom-width: 0px;">
|
||||
1 Nudel mit Hühnerfleisch (groß)
|
||||
<div style="font-size:0.7rem;padding-left:15px;">mit Knoblauchsoße</div>
|
||||
</td>
|
||||
<td class="d-flex justify-content-center align-items-center" style="padding-top:20px; padding-bottom:0px;">9,10€</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
</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"></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>
|
||||
|
||||
</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="20" />
|
||||
<input type="number" style="width:80px" min="0" max="59" />
|
||||
|
||||
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 ">
|
||||
<button class="btn_back w-75">Zurück</button>
|
||||
<button class="btn_forward w-75">Weiter</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
100
src/y4f/Pages/Speisekarte.razor
Normal file
@ -0,0 +1,100 @@
|
||||
@page "/Speisekarte"
|
||||
|
||||
@inject HttpClient Http
|
||||
|
||||
<h1>Speisekarte</h1>
|
||||
<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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">@item.Bezeichnung</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item2 in menuitemkategories)
|
||||
{
|
||||
if (item.IdmenuItemUeberkategorie == item2.MenuItemUeberkategorieIdmenuItemUeberkategorie)
|
||||
{
|
||||
if (@item.Bezeichnung == "Chinesisch")
|
||||
{
|
||||
<tr>
|
||||
<td><a href="/SpeisekarteChinesich">@item2.Bezeichnung</a></td>
|
||||
</tr>
|
||||
}
|
||||
else if (@item.Bezeichnung == "Japanisch")
|
||||
{
|
||||
<tr>
|
||||
<td><a href="/SpeisekarteJapanisch">@item2.Bezeichnung</a></td>
|
||||
</tr>
|
||||
}
|
||||
else if (@item.Bezeichnung == "Getränke")
|
||||
{
|
||||
<tr>
|
||||
<td><a href="/SpeisekarteGetraenke">@item2.Bezeichnung</a></td>
|
||||
</tr>
|
||||
}
|
||||
else if (@item.Bezeichnung == "Sonstiges")
|
||||
{
|
||||
<tr>
|
||||
<td><a href="/SpeisekarteSonstiges">@item2.Bezeichnung</a></td>
|
||||
</tr>
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<td><a href="/">@item2.Bezeichnung</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>
|
||||
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
private List<Menuitemkategorie> menuitemkategories = new List<Menuitemkategorie>();
|
||||
private List<Menuitemueberkategorie> menuitemueberkategories = new List<Menuitemueberkategorie>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
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; }
|
||||
}
|
||||
|
||||
|
||||
}
|
33
src/y4f/Pages/Speisekarte.razor.css
Normal file
@ -0,0 +1,33 @@
|
||||
.table {
|
||||
text-align: center;
|
||||
border-radius: 30px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover, a:focus {
|
||||
color: #2A6496;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #89f9a5;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
td {
|
||||
border-color: black;
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
.lowest {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.tablecolumn {
|
||||
margin-left: 3%;
|
||||
margin-right: 3%;
|
||||
}
|
197
src/y4f/Pages/SpeisekarteCnDetails.razor
Normal file
@ -0,0 +1,197 @@
|
||||
@page "/SpeisekarteChinesich"
|
||||
|
||||
@inject HttpClient Http
|
||||
|
||||
<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 ">
|
||||
<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>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Nudeln mit Hühnerfleisch</h5>
|
||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">9.10€</span></p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Coca Cola</h5>
|
||||
@*<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>*@
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">3.10€</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="#" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
||||
<a href="#" class="btn btn-primary mx-2 mt-1">Weiter</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
||||
|
||||
private List<Allergie> allergien = new List<Allergie>();
|
||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
||||
private List<Kunde> kunden = new List<Kunde>();
|
||||
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()
|
||||
{
|
||||
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>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
81
src/y4f/Pages/SpeisekarteCnDetails.razor.css
Normal file
@ -0,0 +1,81 @@
|
||||
/**{
|
||||
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;
|
||||
}
|
204
src/y4f/Pages/SpeisekarteDrDetails.razor
Normal file
@ -0,0 +1,204 @@
|
||||
@page "/SpeisekarteGetraenke"
|
||||
|
||||
@inject HttpClient Http
|
||||
|
||||
<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 ">
|
||||
<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>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Nudeln mit Hühnerfleisch</h5>
|
||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">9.10€</span></p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Coca Cola</h5>
|
||||
@*<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>*@
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">3.10€</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="#" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
||||
<a href="#" class="btn btn-primary mx-2 mt-1">Weiter</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
||||
|
||||
private List<Allergie> allergien = new List<Allergie>();
|
||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
||||
private List<Kunde> kunden = new List<Kunde>();
|
||||
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()
|
||||
{
|
||||
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>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
81
src/y4f/Pages/SpeisekarteDrDetails.razor.css
Normal file
@ -0,0 +1,81 @@
|
||||
/**{
|
||||
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;
|
||||
}
|
199
src/y4f/Pages/SpeisekarteEtcDetails.razor
Normal file
@ -0,0 +1,199 @@
|
||||
@page "/SpeisekarteSonstiges"
|
||||
|
||||
@inject HttpClient Http
|
||||
|
||||
<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 == "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 ">
|
||||
<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>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Nudeln mit Hühnerfleisch</h5>
|
||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">9.10€</span></p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Coca Cola</h5>
|
||||
@*<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>*@
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">3.10€</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="#" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
||||
<a href="#" class="btn btn-primary mx-2 mt-1">Weiter</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
||||
|
||||
private List<Allergie> allergien = new List<Allergie>();
|
||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
||||
private List<Kunde> kunden = new List<Kunde>();
|
||||
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()
|
||||
{
|
||||
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>();
|
||||
}
|
||||
}
|
81
src/y4f/Pages/SpeisekarteEtcDetails.razor.css
Normal file
@ -0,0 +1,81 @@
|
||||
/**{
|
||||
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;
|
||||
}
|
206
src/y4f/Pages/SpeisekarteJpDetails.razor
Normal file
@ -0,0 +1,206 @@
|
||||
@page "/SpeisekarteJapanisch"
|
||||
|
||||
@inject HttpClient Http
|
||||
|
||||
<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 ">
|
||||
<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>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Nudeln mit Hühnerfleisch</h5>
|
||||
<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">9.10€</span></p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" style="font-size:10pt; margin-bottom:0px;">1 Coca Cola</h5>
|
||||
@*<p class="card-text" style="font-size:8pt;margin-bottom:0px;">mit Knoblauchsoße</p>*@
|
||||
<p class="card-text" id="preis" style="text-align:right; "><span style="background-color:#c7ffd5; border-radius:20px; font-size:10pt; padding:5px">3.10€</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<a href="#" class="btn btn-primary mx-2 mt-5">Zurück</a>
|
||||
<a href="#" class="btn btn-primary mx-2 mt-1">Weiter</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
// allergien, bestellungsposition, kunde, menuitem, menuitemkategorie, menuitemueberkategorie, rabatt
|
||||
|
||||
private List<Allergie> allergien = new List<Allergie>();
|
||||
private List<Bestellungsposition> bestellungspositions = new List<Bestellungsposition>();
|
||||
private List<Kunde> kunden = new List<Kunde>();
|
||||
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()
|
||||
{
|
||||
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>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
81
src/y4f/Pages/SpeisekarteJpDetails.razor.css
Normal file
@ -0,0 +1,81 @@
|
||||
/**{
|
||||
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
@ -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; }
|
||||
}
|
||||
}
|
7
src/y4f/Pages/YummyPoints.razor
Normal file
@ -0,0 +1,7 @@
|
||||
@page "/yummypoints"
|
||||
|
||||
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%";'>
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
</div>
|
||||
</body>
|
@ -6,6 +6,8 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
||||
|
||||
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||
|
||||
await builder.Build().RunAsync();
|
||||
await builder.Build().RunAsync();
|
1
src/y4f/README.md
Normal file
@ -0,0 +1 @@
|
||||
# y4f
|
36
src/y4f/Shared/Bestellabschluss.razor
Normal file
@ -0,0 +1,36 @@
|
||||
@page "/Bestellabschluss"
|
||||
|
||||
<body>
|
||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||
<p>Sie haben derzeit <b>1 Yummy-Punkt(e)</b></p>
|
||||
<p class="text">Bei einem Mindestbestellwert von 8€ erhalten Sie ein Yummy-Punkt.
|
||||
Ab der 10ten Bestellung gibt es einen Rabatt 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>
|
||||
|
||||
<form id="button2" action="Confirm">
|
||||
<input type="submit" value="Vorbestellen" class="btn">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
@code {
|
||||
|
||||
|
||||
}
|
40
src/y4f/Shared/Bestellabschluss.razor.css
Normal file
@ -0,0 +1,40 @@
|
||||
body, html {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 20%;
|
||||
height: auto;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: grey;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.button {
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#button1, #button2 {
|
||||
margin: 10px;
|
||||
display: inline-block;
|
||||
border-radius: 50px;
|
||||
}
|
||||
|
||||
#button1 {
|
||||
background-color: #F9BE89;
|
||||
}
|
||||
|
||||
#button2 {
|
||||
background-color: #89F9A5;
|
||||
}
|
||||
|
37
src/y4f/Shared/Bestellbestätigung.razor
Normal file
@ -0,0 +1,37 @@
|
||||
@page "/Bestellbestätigung"
|
||||
|
||||
<body>
|
||||
<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>
|
||||
<p class="text">
|
||||
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.
|
||||
<br><br><br><br>
|
||||
</p>
|
||||
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-warning progress-bar-striped progress-bar-animated" style="width:50%"></div>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tr class="loadtext">
|
||||
<td>Bestellung eingegangen</td>
|
||||
<td class="load2">Bestellung wird zubereitet</td>
|
||||
<td class="load3">Essen abholbereit</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="button">
|
||||
<br><br><br><br>
|
||||
<form id="button1" action="/">
|
||||
<input type="submit" value="Zur Startseite" class="btn">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
@code {
|
||||
|
||||
|
||||
}
|
50
src/y4f/Shared/Bestellbestätigung.razor.css
Normal file
@ -0,0 +1,50 @@
|
||||
body, html {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 20%;
|
||||
height: auto;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: grey;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.button {
|
||||
padding-left: 25%;
|
||||
padding-right: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#button1 {
|
||||
background-color: #89F9A5;
|
||||
padding-left: 25%;
|
||||
padding-right: 25%;
|
||||
display: inline-block;
|
||||
border-radius: 50px;
|
||||
}
|
||||
h5 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.load2 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.load3 {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
.loadtext {
|
||||
font-size: 14px;
|
||||
}
|
27
src/y4f/Shared/Footer.razor
Normal file
@ -0,0 +1,27 @@
|
||||
@*<footer class="text-center text-lg-start bg-light text-muted">
|
||||
<section class="d-flex justify-content-center justify-content-lg-between p-4 border-bottom"></section>
|
||||
<section class="">
|
||||
<div class="container text-center text-md-start mt-5">
|
||||
<div class="col-md-3 col-lg-6 col-xl-12 mx-auto mb-4">
|
||||
<center>
|
||||
<h6 class="text-uppercase fw-bold mb-4">
|
||||
<a href="">Kontakt</a> | <a href="">Impressum</a> | <a href="">Datenschutzerklärung</a> | <a href="">Cookies</a>
|
||||
</h6>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</footer>*@
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<a href="">Kontakt</a> |
|
||||
<a href="">Impressum</a> |
|
||||
<a href="">Datenschutzerklärung</a> |
|
||||
<a href="">Cookies</a>
|
||||
</div>
|
||||
</footer>
|
||||
@code {
|
||||
|
||||
}
|
27
src/y4f/Shared/Footer.razor.css
Normal file
@ -0,0 +1,27 @@
|
||||
a {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover, a:focus {
|
||||
color: #2A6496;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h6 {
|
||||
color: grey;
|
||||
}
|
||||
|
||||
|
||||
footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background-color: #89f9a5;
|
||||
color: black;
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
margin-top: 100px;
|
||||
}
|
30
src/y4f/Shared/Kontoverwaltung.razor
Normal file
@ -0,0 +1,30 @@
|
||||
@page "/Kontoverwaltung"
|
||||
|
||||
<h3>Wichtige Informationen</h3> <br>
|
||||
|
||||
|
||||
|
||||
<div class="container mt-auto">
|
||||
<h4>AccountID: #1234</h4>
|
||||
<h4>Ihr QR-Code: </h4>
|
||||
<img src="assets/K-QR.png" class="img" title="logo image">
|
||||
|
||||
<p>Ihr Konto wird 30 Tage nach der Deaktivierung unwiderruflich gelöscht.</p>
|
||||
<button class="btn" type="button" onclick="@ChangeButton" id="button1">@button1</button>
|
||||
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
@code {
|
||||
bool changeButtonBool { get; set; } = true;
|
||||
|
||||
string button1 => changeButtonBool ? "Konto deaktivieren" : "Konto aktivieren";
|
||||
|
||||
void ChangeButton()
|
||||
{
|
||||
//TODO Datenbankaktualisierung
|
||||
changeButtonBool = !changeButtonBool;
|
||||
}
|
||||
}
|
||||
|
22
src/y4f/Shared/Kontoverwaltung.razor.css
Normal file
@ -0,0 +1,22 @@
|
||||
body {
|
||||
background-color: white;
|
||||
|
||||
}
|
||||
|
||||
|
||||
img {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #89f9a5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
14
src/y4f/Shared/MainLayout.razor
Normal file
@ -0,0 +1,14 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<div >
|
||||
<NavMenu />
|
||||
|
||||
<main class="container">
|
||||
|
||||
|
||||
@Body
|
||||
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
</div>
|
61
src/y4f/Shared/NavMenu.razor
Normal file
@ -0,0 +1,61 @@
|
||||
<nav class="navbar navbar-expand-md navbar-light mb-4 me-5 ms-5 ">
|
||||
<div class="container-fluid">
|
||||
@*<a class="navbar-brand" href="">Yummy4Friends</a>*@
|
||||
<a class="navbar-brand" href="">
|
||||
<img src="assets/Logo_new.png" alt="Yummy4Friends" width="60px" height="auto">
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler @NavButtonCssClass" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse"
|
||||
aria-controls="navbarCollapse" aria-label="Toggle navigation" @onclick="ToggleNavMenu">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse justify-content-end @NavBarCssClass" id="navbarCollapse" @onclick="ToggleNavMenu">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="allergene">
|
||||
Allergene
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="speisekarte">
|
||||
Speisekarte
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="yummy-punkte">
|
||||
Yummy-Punkte
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="shopping_cart">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-cart3" viewBox="0 0 16 16">
|
||||
<path d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .49.598l-1 5a.5.5 0 0 1-.465.401l-9.397.472L4.415 11H13a.5.5 0 0 1 0 1H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5zM3.102 4l.84 4.479 9.144-.459L13.89 4H3.102zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-7 1a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm7 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" />
|
||||
</svg>
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="Kontoverwaltung">
|
||||
#12345
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">
|
||||
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" />
|
||||
</svg>
|
||||
</NavLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@code {
|
||||
private bool collapseNavMenu = true;
|
||||
private string? NavBarCssClass => collapseNavMenu ? null : "show";
|
||||
private string? NavButtonCssClass => collapseNavMenu ? "collapsed" : null;
|
||||
|
||||
|
||||
private void ToggleNavMenu()
|
||||
{
|
||||
collapseNavMenu = !collapseNavMenu;
|
||||
}
|
||||
}
|
12
src/y4f/Shared/Startseite.razor
Normal file
@ -0,0 +1,12 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<main class="container">
|
||||
|
||||
|
||||
@Body
|
||||
|
||||
</main>
|
||||
</div>
|
5
src/y4f/Shared/Startseite.razor.css
Normal file
@ -0,0 +1,5 @@
|
||||
html, body {
|
||||
/*background-color: #C7FFD5;*/
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
29
src/y4f/Shared/Yummy-Punkte.razor
Normal file
@ -0,0 +1,29 @@
|
||||
@page "/Yummy-Punkte"
|
||||
|
||||
<body>
|
||||
<div class="container col-lg-5 col-md-9 col-sm-12 d-flex flex-column " id="content">
|
||||
<h4><b>Ihre Yummy-Punkte</b></h4>
|
||||
|
||||
<div class="img" >
|
||||
@for(int i = 0; i < 10; i++)
|
||||
{
|
||||
<img src="assets/White-Circle.png ">
|
||||
}
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<p class="text">Bei einem Mindestbestellwert von 8€ erhalten Sie ein Yummy-Punkt. Ab der 10ten Bestellung gibt es einen Rabatt zu Ihrer nächsten Bestellung.</p>
|
||||
|
||||
<div class="button">
|
||||
<form id="button1" action="/">
|
||||
<input type="submit" value="Zurück" class="btn">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
@code {
|
||||
|
||||
|
||||
}
|
37
src/y4f/Shared/Yummy-Punkte.razor.css
Normal file
@ -0,0 +1,37 @@
|
||||
body, html {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 20%;
|
||||
height: auto;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: grey;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.button {
|
||||
padding-left: 25%;
|
||||
padding-right: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#button1 {
|
||||
background-color: #F9BE89;
|
||||
padding-left: 25%;
|
||||
padding-right: 25%;
|
||||
display: inline-block;
|
||||
border-radius: 50px;
|
||||
}
|
||||
h4 {
|
||||
text-align: center;
|
||||
}
|
BIN
src/y4f/wwwroot/assets/K-QR.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
src/y4f/wwwroot/assets/Logo_new.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
src/y4f/wwwroot/assets/White-Circle.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
src/y4f/wwwroot/assets/ei.png
Normal file
After Width: | Height: | Size: 313 KiB |
BIN
src/y4f/wwwroot/assets/erdnuss.png
Normal file
After Width: | Height: | Size: 441 KiB |
BIN
src/y4f/wwwroot/assets/fisch.png
Normal file
After Width: | Height: | Size: 243 KiB |
BIN
src/y4f/wwwroot/assets/getreide.png
Normal file
After Width: | Height: | Size: 236 KiB |
BIN
src/y4f/wwwroot/assets/krebstiere.png
Normal file
After Width: | Height: | Size: 359 KiB |
BIN
src/y4f/wwwroot/assets/lupinen.png
Normal file
After Width: | Height: | Size: 395 KiB |
BIN
src/y4f/wwwroot/assets/milch.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
src/y4f/wwwroot/assets/schalenfruechte.png
Normal file
After Width: | Height: | Size: 649 KiB |
BIN
src/y4f/wwwroot/assets/sellerie.png
Normal file
After Width: | Height: | Size: 430 KiB |
BIN
src/y4f/wwwroot/assets/senf.png
Normal file
After Width: | Height: | Size: 424 KiB |
BIN
src/y4f/wwwroot/assets/sesam.png
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
src/y4f/wwwroot/assets/soja.png
Normal file
After Width: | Height: | Size: 234 KiB |
BIN
src/y4f/wwwroot/assets/sulfite.png
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
src/y4f/wwwroot/assets/weichtiere.png
Normal file
After Width: | Height: | Size: 421 KiB |
28
src/y4f/wwwroot/css/Site.css
Normal file
@ -0,0 +1,28 @@
|
||||
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
|
||||
|
||||
html, body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#content {
|
||||
background-color: #C7FFD1;
|
||||
padding: 5%;
|
||||
margin-top: 1%;
|
||||
border-radius: 10px;
|
||||
position: center;
|
||||
}
|
||||
|
||||
.img {
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
margin: 10%;
|
||||
}
|
||||
|
||||
form {
|
||||
text-align: center;
|
||||
background-color: #89F9A5;
|
||||
border-radius: 50px;
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
html, body {
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
background-color: #C7FFD1;
|
||||
}
|
||||
|
||||
h1:focus {
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
41
src/y4f/wwwroot/css/shopping_cart.css
Normal file
@ -0,0 +1,41 @@
|
||||
.tbl-container {
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.bg_green {
|
||||
background-color: #89F9A5;
|
||||
}
|
||||
|
||||
.bdr {
|
||||
border-radius: 17px;
|
||||
overflow: hidden;
|
||||
border-color: #C7FFD5;
|
||||
}
|
||||
|
||||
.bg_lightgreen {
|
||||
background-color: #C7FFD5;
|
||||
}
|
||||
|
||||
.br {
|
||||
border-right: solid 1px black;
|
||||
border-collapse: collapse;
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.btn_back {
|
||||
background-color: #F9BE89;
|
||||
/*width: 60%;*/
|
||||
margin-bottom: 13px;
|
||||
border-radius: 30px;
|
||||
height: 50px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.btn_forward {
|
||||
background-color: #89F9A5;
|
||||
/*width: 60%;*/
|
||||
border-radius: 30px;
|
||||
height: 50px;
|
||||
border: 0px;
|
||||
}
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |