@using MP.AppAuth.Models @using MP.Land.Data @using Microsoft.Extensions.Configuration @inject IConfiguration Configuration @inject AppAuthService DataService @inject LicenseService LicServ @if (authOk()) // disegno box cliccabile e programma attivato {

@CurrItem.AppName 

@(traduci($"{CurrItem.AppName}-TITLE"))
Licenza Attiva
@(traduci($"{CurrItem.AppName}-LIST"))
} else // disegno box non cliccabile e licenza mancante {
@(traduci($"{CurrItem.AppName}-TITLE"))
Licenza Mancante
@(traduci($"{CurrItem.AppName}-LIST"))
} @code { [Parameter] public UpdMan CurrItem { get; set; } protected List AKVList { get { return LicServ.AKVList; } set { LicServ.AKVList = value; } } protected override async Task OnInitializedAsync() { // check init AKV if (AKVList == null || AKVList.Count == 0) { AKVList = await DataService.AnagKeyValList(); LicServ.InitAkv(); } } protected string getAKVString(string nomeVar) { string answ = ""; if (AKVList != null) { var currRec = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar); if (currRec != null) { answ = currRec.ValString; } } return answ; } protected AnagKeyValueModel getAKVRec(string nomeVar) { AnagKeyValueModel answ = new AnagKeyValueModel(); if (AKVList != null) { answ = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar); } return answ; } protected bool authOk() { bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey); if (allOk) { allOk = LicServ.checkLicenseActive(CurrItem.LicenseKey); } return allOk; } protected string fullUrl(string relUrl) { return $"{Configuration["BaseUrl"]}{relUrl}"; } protected MarkupString traduci(string lemma) { MarkupString answ; string rawHtml = DataService.Traduci(lemma, "IT"); answ = new MarkupString(rawHtml); return answ; } }