aboutsummaryrefslogtreecommitdiff
path: root/DrinksMachineWebsite/Pages
diff options
context:
space:
mode:
authorSjory <Mgj32000@gmail.com>2024-12-05 13:23:12 +0100
committerSjory <Mgj32000@gmail.com>2024-12-05 13:23:12 +0100
commitdae84a9660ed572dc150e548eb71ac38a0efbf6e (patch)
tree285a1321c9cc0a403122449d81970729522930b7 /DrinksMachineWebsite/Pages
parentca3e50a78787685fb5a39c6f751a87b2beb65c17 (diff)
Updated to .Net v8.0
since there was almost no development made except a few test. i startet from scratch with .Net 8.0 and made a Blazor (Auot - Server/Web app)
Diffstat (limited to 'DrinksMachineWebsite/Pages')
-rw-r--r--DrinksMachineWebsite/Pages/Counter.razor61
-rw-r--r--DrinksMachineWebsite/Pages/Error.cshtml42
-rw-r--r--DrinksMachineWebsite/Pages/Error.cshtml.cs27
-rw-r--r--DrinksMachineWebsite/Pages/FetchData.razor47
-rw-r--r--DrinksMachineWebsite/Pages/Index.razor9
-rw-r--r--DrinksMachineWebsite/Pages/_Host.cshtml34
6 files changed, 0 insertions, 220 deletions
diff --git a/DrinksMachineWebsite/Pages/Counter.razor b/DrinksMachineWebsite/Pages/Counter.razor
deleted file mode 100644
index ac2f9c7..0000000
--- a/DrinksMachineWebsite/Pages/Counter.razor
+++ /dev/null
@@ -1,61 +0,0 @@
-@page "/counter"
-@using DrinksMachineWebsite.Data
-
-<PageTitle>Drinks</PageTitle>
-
-<h1>List of Drinks</h1>
-
-@if (drinks[0] == null)
-{
- <p><em>Loading...</em></p>
-}
-else
-{
-<table class="table">
- <thead>
- <tr>
- <th>Name</th>
- <th>Description</th>
- <th>Alcohol</th>
- <th>Amount of shots</th>
- </tr>
- </thead>
- <tbody>
- @for (int i = 0; i < 1; i++)
- {
-
- <tr>
- <td>@drinks[i].Name</td>
- <td>@drinks[i].Description</td>
- <td>@drinks[i].AlcoholAndAmounts.Alcohol.name</td>
- <td>@drinks[i].AlcoholAndAmounts.amountOfShots</td>
- </tr>
-
- }
-
- </tbody>
-</table>
-}
-<button class="btn btn-primary" @onclick="Updatelist">make gin Tonic</button>
-
-
-
-
-@code {
- private int currentCount = 0;
- public static Alcohol gin = new Alcohol("Gin", 40, 70);
- private static AlcoholAndAmount ginInGinTnoic = new AlcoholAndAmount(gin, 2);
- public Drinks ginTonic = new Drinks("Gin & Tonic", "a nice classic that my dear babesiboo loves", ginInGinTnoic);
-
- public Drinks[] drinks = new Drinks[100];
-
- public void Updatelist(){
- drinks[0] = ginTonic;
- }
-
-
- private void IncrementCount()
- {
- currentCount++;
- }
-}
diff --git a/DrinksMachineWebsite/Pages/Error.cshtml b/DrinksMachineWebsite/Pages/Error.cshtml
deleted file mode 100644
index a628403..0000000
--- a/DrinksMachineWebsite/Pages/Error.cshtml
+++ /dev/null
@@ -1,42 +0,0 @@
-@page
-@model DrinksMachineWebsite.Pages.ErrorModel
-
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
- <title>Error</title>
- <link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
- <link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
-</head>
-
-<body>
- <div class="main">
- <div class="content px-4">
- <h1 class="text-danger">Error.</h1>
- <h2 class="text-danger">An error occurred while processing your request.</h2>
-
- @if (Model.ShowRequestId)
- {
- <p>
- <strong>Request ID:</strong> <code>@Model.RequestId</code>
- </p>
- }
-
- <h3>Development Mode</h3>
- <p>
- Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
- </p>
- <p>
- <strong>The Development environment shouldn't be enabled for deployed applications.</strong>
- It can result in displaying sensitive information from exceptions to end users.
- For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
- and restarting the app.
- </p>
- </div>
- </div>
-</body>
-
-</html>
diff --git a/DrinksMachineWebsite/Pages/Error.cshtml.cs b/DrinksMachineWebsite/Pages/Error.cshtml.cs
deleted file mode 100644
index 0c7af17..0000000
--- a/DrinksMachineWebsite/Pages/Error.cshtml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.RazorPages;
-using System.Diagnostics;
-
-namespace DrinksMachineWebsite.Pages
-{
- [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
- [IgnoreAntiforgeryToken]
- public class ErrorModel : PageModel
- {
- public string? RequestId { get; set; }
-
- public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
-
- private readonly ILogger<ErrorModel> _logger;
-
- public ErrorModel(ILogger<ErrorModel> logger)
- {
- _logger = logger;
- }
-
- public void OnGet()
- {
- RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
- }
- }
-} \ No newline at end of file
diff --git a/DrinksMachineWebsite/Pages/FetchData.razor b/DrinksMachineWebsite/Pages/FetchData.razor
deleted file mode 100644
index 2aefd4a..0000000
--- a/DrinksMachineWebsite/Pages/FetchData.razor
+++ /dev/null
@@ -1,47 +0,0 @@
-@page "/fetchdata"
-@using DrinksMachineWebsite.Data
-@inject WeatherForecastService ForecastService
-
-<PageTitle>Weather forecast</PageTitle>
-
-<h1>Weather forecast</h1>
-
-<p>This component demonstrates fetching data from a service.</p>
-
-@if (forecasts == null)
-{
- <p><em>Loading...</em></p>
-}
-else
-{
- <table class="table">
- <thead>
- <tr>
- <th>Date</th>
- <th>Temp. (C)</th>
- <th>Temp. (F)</th>
- <th>Summary</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var forecast in forecasts)
- {
- <tr>
- <td>@forecast.Date.ToShortDateString()</td>
- <td>@forecast.TemperatureC</td>
- <td>@forecast.TemperatureF</td>
- <td>@forecast.Summary</td>
- </tr>
- }
- </tbody>
- </table>
-}
-
-@code {
- private WeatherForecast[]? forecasts;
-
- protected override async Task OnInitializedAsync()
- {
- forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
- }
-}
diff --git a/DrinksMachineWebsite/Pages/Index.razor b/DrinksMachineWebsite/Pages/Index.razor
deleted file mode 100644
index 6085c4a..0000000
--- a/DrinksMachineWebsite/Pages/Index.razor
+++ /dev/null
@@ -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?" />
diff --git a/DrinksMachineWebsite/Pages/_Host.cshtml b/DrinksMachineWebsite/Pages/_Host.cshtml
deleted file mode 100644
index 09cd543..0000000
--- a/DrinksMachineWebsite/Pages/_Host.cshtml
+++ /dev/null
@@ -1,34 +0,0 @@
-@page "/"
-@using Microsoft.AspNetCore.Components.Web
-@namespace DrinksMachineWebsite.Pages
-@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <base href="~/" />
- <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
- <link href="css/site.css" rel="stylesheet" />
- <link href="DrinksMachineWebsite.styles.css" rel="stylesheet" />
- <link rel="icon" type="image/png" href="favicon.png"/>
- <component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
-</head>
-<body>
- <component type="typeof(App)" render-mode="ServerPrerendered" />
-
- <div id="blazor-error-ui">
- <environment include="Staging,Production">
- An error has occurred. This application may no longer respond until reloaded.
- </environment>
- <environment include="Development">
- An unhandled exception has occurred. See browser dev tools for details.
- </environment>
- <a href="" class="reload">Reload</a>
- <a class="dismiss">🗙</a>
- </div>
-
- <script src="_framework/blazor.server.js"></script>
-</body>
-</html>