@page "/students/details"
@attribute [Authorize]
@using Microsoft.EntityFrameworkCore
@using WebApp.Components.Shared.Components
@inject AppDbContext context
@inject NavigationManager NavigationManager
@inject IJSRuntime JSRuntime
@if (student is null)
{
Loading...
return;
}
Print
Edit
Student Information
First Name
@student.FirstName
Last Name
@student.LastName
Grade
@student.Grade
Email
@student.Email
Phone Number
@student.PhoneNumber
TSA Year
@student.TsaYear
TSA IDs
State ID
@student.StateId
Regional ID
@student.RegionalId
National ID
@student.NationalId
Officer Role
@student.OfficerRole
@code {
private Student? student;
[SupplyParameterFromQuery]
private int Id { get; set; }
[SupplyParameterFromQuery]
private string? ReturnUrl { get; set; }
protected override async Task OnInitializedAsync()
{
student = await context.Students.FirstOrDefaultAsync(m => m.Id == Id);
if (student is null)
{
NavigationManager.NavigateTo("notfound");
}
}
private async Task PrintPage()
{
await JSRuntime.InvokeVoidAsync("window.print");
}
}