@using SteUp.Shared.Components.Layout @using SteUp.Shared.Components.Layout.Overlay @using SteUp.Shared.Core.Dto @using SteUp.Shared.Core.Interface.IntegryApi @using SteUp.Shared.Core.Interface.System.Network @inject INetworkService NetworkService @inject IDialogService Dialog @inject IIntegryApiService IntegryApiService
Reparto @if (SteupDataService.Reparti.IsNullOrEmpty()) { } else { @foreach (var fasi in SteupDataService.Reparti) { @fasi.Descrizione } }
Motivo @if (SteupDataService.TipiAttività.IsNullOrEmpty()) { } else { @foreach (var type in SteupDataService.TipiAttività) { @type.ActivityTypeId } }
@*
*@ @* @if (!AttachedList.IsNullOrEmpty()) *@ @* { *@ @* foreach (var item in AttachedList!.Select((p, index) => new { p, index })) *@ @* { *@ @* if (item.p.Type == AttachedDTO.TypeAttached.Position) *@ @* { *@ @* *@ @* @item.p.Description *@ @* *@ @* } *@ @* else *@ @* { *@ @* *@ @* @item.p.Name *@ @* *@ @* } *@ @* } *@ @* } *@ @* *@ @* @if (!IsLoading) *@ @* { *@ @* if (ActivityFileList != null) *@ @* { *@ @* foreach (var file in ActivityFileList) *@ @* { *@ @* *@ @* @file.FileName *@ @* *@ @* } *@ @* } *@ @* } *@ @* else *@ @* { *@ @* *@ @* } *@ @*
*@ @if (!IsView) {
Aggiungi allegati
}
Scadenza
Suggerisci note descrittive
@code { [CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!; private SchedaDto SchedaDto { get; set; } = new(); private bool IsNew { get; set; } private bool IsLoading { get; set; } private bool IsView => !NetworkService.ConnectionAvailable; //Overlay private bool VisibleOverlay { get; set; } private bool SuccessAnimation { get; set; } private string? LabelSave { get; set; } protected override async Task OnInitializedAsync() { Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter; } private async Task Save() { } private async Task OpenAddAttached() { var result = await ModalHelper.OpenAddAttached(Dialog); // if (result is { Canceled: false, Data: not null } && result.Data.GetType() == typeof(AttachedDTO)) // { // var attached = (AttachedDTO)result.Data; // // if (attached.Type == AttachedDTO.TypeAttached.Position) // CanAddPosition = false; // // AttachedList ??= []; // AttachedList.Add(attached); // } } private void OnAfterChangeValue() { if (!IsNew) LabelSave = "Aggiorna"; StateHasChanged(); } private void SuggestActivityDescription() { if (SchedaDto.ActivityTypeId == null) { Snackbar.Add("Indicare prima il motivo", Severity.Error); return; } VisibleOverlay = true; StateHasChanged(); _ = Task.Run(async () => { var activityDescriptions = await IntegryApiService.SuggestActivityDescription(SchedaDto.ActivityTypeId); var modal = await ModalHelper.OpenSuggestActivityDescription(Dialog, activityDescriptions); if (modal is { Canceled: false, Data: not null }) SchedaDto.Note = modal.Data!.ToString(); VisibleOverlay = false; await InvokeAsync(StateHasChanged); }); } }