Files
mapo-core/MP.Land/Components/UserCard.razor
T
Samuele Locatelli f8f9b5bbe2 Fix URL e parametri
2021-09-21 18:33:40 +02:00

68 lines
1.9 KiB
Plaintext

@using MP.AppAuth.Models
@inject IJSRuntime JSRuntime
<div class="card">
<div class="card-header py-2 font-weight-bold">
<div class="row">
<div class="col-4 col-md-4">
<div class="badge badge-pill badge-dark px-2 py-1">
<div class="px-1">
<span>EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></span>
</div>
</div>
</div>
<div class="col-8 text-right">
<h4 class="py-0 mb-0">@Environment</h4>
</div>
</div>
</div>
<div class="card-body px-3">
<div class="row">
<div class="col-6 col-md-4">
<div id="qrCodeImg_@(CurrItem.MatrOpr)"></div>
</div>
<div class="col-6 col-md-8">
<h2><b>@CurrItem.Cognome</b> @CurrItem.Nome</h2>
matr: @CurrItem.MatrOpr
</div>
</div>
</div>
@*<div class="card-footer text-muted py-1">
Card login MAPO-TAB
</div>*@
</div>
@code {
[Parameter]
public AnagraficaOperatori CurrItem { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (!firstRender)
{
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
}
}
[Parameter]
public string BaseUrl { get; set; }
[Parameter]
public string Environment { get; set; }
protected string rawCode
{
get
{
string answ = "";
if (CurrItem != null)
{
answ = $"{BaseUrl}MatrOpr={CurrItem.MatrOpr}&UserAuthKey={CurrItem.AuthKey}";
}
return answ;
}
}
}