Update vor Blazorise
This commit is contained in:
33
BlazorApp/Pages/Teacher/Dashboard.razor
Normal file
33
BlazorApp/Pages/Teacher/Dashboard.razor
Normal file
@@ -0,0 +1,33 @@
|
||||
@page "/Teacher/Dashboard"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inject NavigationManager NavManager
|
||||
@inherits Admin.ListBase;
|
||||
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using Syncfusion.Blazor.Navigations;
|
||||
@using Syncfusion.Blazor.Popups;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
@code {
|
||||
string userid = "";
|
||||
private Lehrer _lehrer { get; set; } = new BWPMModels.Lehrer();
|
||||
public List<BWPMModels.Lehrer> Lehrerdaten { get; set; }
|
||||
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender != true) { return; };
|
||||
var authState = await authenticationStateTask;
|
||||
userid = authState.User.Claims.FirstOrDefault().Value;
|
||||
var user = authState.User;
|
||||
await sessionStorage.SetItemAsync("UserID", userid);
|
||||
Lehrerdaten = BlazorApp.Controller.LehrerController.GetByUserID(userid);
|
||||
_lehrer = Lehrerdaten.First<BWPMModels.Lehrer>();
|
||||
await sessionStorage.SetItemAsync("LehrerID", _lehrer.ID.ToString());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user