diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor index b9adcf8..5fe00ad 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor @@ -62,6 +62,9 @@ PaginationItemsTextFormat="{0} - {1} de {2} elementos"> + + + @context.IDNOMINANavigation.DESCRIPCION @@ -134,13 +137,48 @@ } - + + +
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + +
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); + private Modal popupGestionDatos = default; public int? idNom { get; set; } private string titulo { get; set; } private HttpClient cliente = new HttpClient(); @@ -150,6 +188,7 @@ // private List meses = new List(); private List itmList = new List(); private List nombMeses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]; + private INCIDENCIAS ItemEnEdicion { get; set; } = new INCIDENCIAS(); protected override async Task OnInitializedAsync() { try @@ -186,4 +225,24 @@ Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + private async Task abrirPopupModificacion(INCIDENCIAS objeto, bool esNuevo) + { + ItemEnEdicion = objeto; + await popupGestionDatos.ShowAsync(); + } + private async Task cerrarPopupModificacion() + { + await popupGestionDatos.HideAsync(); + } + + // GUARDAR + + private async Task GestionarDatos(INCIDENCIAS inci) + { + + var cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + var response = await Utilidades.ActualizarObjeto(cliente, "/api/INCIDENCIAS/" + inci.IDINCIDENCIA, inci); + await cerrarPopupModificacion(); + await InvokeAsync(StateHasChanged); + } }