You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

@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());
}
}