From fced97beb026e60066ca48f449f5ef94be862565 Mon Sep 17 00:00:00 2001 From: zha19115 <105790331+zha19115@users.noreply.github.com> Date: Sat, 24 Jun 2023 15:52:16 +0200 Subject: [PATCH] Admin Login integriert (#45) Co-authored-by: GEI22857 --- src/y4f/Program.cs | 3 +- src/y4f/Shared/Kontoverwaltung.razor | 2 +- src/y4f/Shared/RegistrierungA.razor | 46 ++++++++++++++++--------- src/y4f/Shared/RegistrierungA.razor.css | 7 ++-- src/y4f/y4f.csproj | 1 + 5 files changed, 39 insertions(+), 20 deletions(-) diff --git a/src/y4f/Program.cs b/src/y4f/Program.cs index d1c70e0..17d1fcf 100644 --- a/src/y4f/Program.cs +++ b/src/y4f/Program.cs @@ -1,3 +1,4 @@ +using Blazored.LocalStorage; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using y4f; @@ -6,7 +7,7 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); - +builder.Services.AddBlazoredLocalStorage(); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); diff --git a/src/y4f/Shared/Kontoverwaltung.razor b/src/y4f/Shared/Kontoverwaltung.razor index 19bd801..c74a919 100644 --- a/src/y4f/Shared/Kontoverwaltung.razor +++ b/src/y4f/Shared/Kontoverwaltung.razor @@ -5,7 +5,7 @@
-

AccountID: #1234

+

AccountID: @RegistrierungA.userName

Ihr QR-Code:

diff --git a/src/y4f/Shared/RegistrierungA.razor b/src/y4f/Shared/RegistrierungA.razor index 081abcb..0dce74c 100644 --- a/src/y4f/Shared/RegistrierungA.razor +++ b/src/y4f/Shared/RegistrierungA.razor @@ -1,22 +1,36 @@ -@page "/RegistrierungA" +@page "/RegistrierungA" @layout Registrierung +@inject NavigationManager NavManager +@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage

Benutzername:

-
- -
-

Passwort:

-
- -
-
- -
- -
-
-
-@code { + + +

Passwort:

+ + + + +
+ +@code { + public string inputName { get; set; } = string.Empty; + public string inputPassword { get; set; } = string.Empty; + + public static string userName { get; set; } = string.Empty; + + public void Login() { + if (inputName == userDataName && inputPassword == userDataPassword) { + localStorage.SetItem("name", inputName); + userName = localStorage.GetItem("name"); + NavManager.NavigateTo("/Bestelluebersicht"); + } + } } + +@code { + public string userDataName { get; set; } = ""; + public string userDataPassword { get; set; } = ""; +} \ No newline at end of file diff --git a/src/y4f/Shared/RegistrierungA.razor.css b/src/y4f/Shared/RegistrierungA.razor.css index 71ab076..32856d4 100644 --- a/src/y4f/Shared/RegistrierungA.razor.css +++ b/src/y4f/Shared/RegistrierungA.razor.css @@ -15,5 +15,8 @@ input { } - - +button { + text-align: center; + background-color: #89F9A5; + border-radius: 50px; +} diff --git a/src/y4f/y4f.csproj b/src/y4f/y4f.csproj index 9bb7029..567afc2 100644 --- a/src/y4f/y4f.csproj +++ b/src/y4f/y4f.csproj @@ -12,6 +12,7 @@ +