diff options
| author | Sjory <Mgj32000@gmail.com> | 2024-12-01 12:42:33 +0100 |
|---|---|---|
| committer | Sjory <Mgj32000@gmail.com> | 2024-12-01 12:42:33 +0100 |
| commit | ca3e50a78787685fb5a39c6f751a87b2beb65c17 (patch) | |
| tree | 6e91f879d8539db0132bd64447a8d1d436ef2dcc /DrinksMachineWebsite/Pages | |
| parent | eedb2bdb2cc1293e6abb4099d700222b7260baaa (diff) | |
testing
made classes for alcohol and drinks
tried to make a list of drinks
gonna try maybe a json to store information and make a page for creating new drinks
Diffstat (limited to 'DrinksMachineWebsite/Pages')
| -rw-r--r-- | DrinksMachineWebsite/Pages/Counter.razor | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/DrinksMachineWebsite/Pages/Counter.razor b/DrinksMachineWebsite/Pages/Counter.razor index ef23cb3..ac2f9c7 100644 --- a/DrinksMachineWebsite/Pages/Counter.razor +++ b/DrinksMachineWebsite/Pages/Counter.razor @@ -1,15 +1,58 @@ @page "/counter" +@using DrinksMachineWebsite.Data -<PageTitle>Counter</PageTitle> +<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> -<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; + 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() { |
