protected async Task Aktivovat(OsobaDto2 osoba) { await Progress.ExecuteInProgressAsync(async() => await OsobaWebApiClient.AktivujNeaktivniOsobuAsync(osoba.Id)); osoby.Osoby.Remove(osoba); Toaster.Success($"{osoba.PrijmeniJmeno} aktivován(a)."); }
private async Task LoadDataAsync() { State.AktivniOsoby = null; State.Vzkazy = null; await Progress.ExecuteInProgressAsync(async() => { State.AktivniOsoby = (await OsobaWebApiClient.GetAktivniOsobyAsync()).Osoby.ToList(); State.Vzkazy = (await NastenkaWebApiClient.GetVzkazyAsync()).Vzkazy.ToList(); }); }
protected async Task Smazat(OsobaDto2 osoba) { bool confirmed = await JSRuntime.InvokeAsync <bool>("confirm", $"Opravdu chceš smazat osobu \"{osoba.PrijmeniJmeno}\"?"); if (confirmed) { await Progress.ExecuteInProgressAsync(async() => await OsobaWebApiClient.SmazNeaktivniOsobuAsync(osoba.Id)); osoby.Osoby.Remove(osoba); Toaster.Success($"{osoba.PrijmeniJmeno} smazán(a)."); } }
protected async Task ValidSubmit() { OsobaInputDto novaOsoba = new OsobaInputDto() { Jmeno = formData.Jmeno, Prijmeni = formData.Prijmeni, Email = formData.Email }; await Progress.ExecuteInProgressAsync(async() => await OsobaWebApiClient.VlozOsobuAsync(novaOsoba)); Toaster.Success($"{novaOsoba.Prijmeni} {novaOsoba.Jmeno} založen(a)."); NavigationManager.NavigateTo("/"); }
protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); osoby = await Progress.ExecuteInProgressAsync(async() => await OsobaWebApiClient.GetNeaktivniOsobyAsync()); }