@attribute [Authorize] @page "/management/Eventi" @using Microsoft.EntityFrameworkCore @using StandManager.Model @rendermode InteractiveServer @inject TooltipService tooltipService Eventi
Overview

Eventi

@code { List eventi; RadzenDataGrid eventiGrid; protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); eventi = (await _managerService.EventoService.RicercaQueryable(x => x.Eliminato == false)).Select(x => (EventoViewModel)x).ToList(); } private async Task EditRow(EventoViewModel evento) { _navManager.NavigateTo($"/management/Eventi/Modifica/{evento.Id}"); } private async Task DeleteRow(EventoViewModel evento) { var ok = await _dialogService.Confirm($"Vuoi davvero eliminare l'evento {evento.Titolo}?", "Conferma eliminazione", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" }); if (ok == true) { await _managerService.EventoService.Elimina(evento.Id, await MembershipUtils.GetUserId(_auth)); eventi = (await _managerService.EventoService.RicercaQueryable(x => x.Eliminato == false)).Select(x => (EventoViewModel)x).ToList(); } } private async Task SendInvitation(EventoViewModel evento) { var ok = await _dialogService.Confirm($"Vuoi davvero invitare i clienti all'evento {evento.Titolo}?", "Conferma invito", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" }); if (ok == true) { _dialogService.Close(); //Invito await _dialogService.OpenAsync("Inviti", new Dictionary() { { "eventoId", evento.Id } }); } } void ShowTooltip(ElementReference elementReference, TooltipOptions options = null) => tooltipService.Open(elementReference, options.Text, options); }