@using System.Net.Http.Headers
@using System.Linq.Expressions
@using Newtonsoft.Json
@using System.Text
@using Serialize.Linq.Serializers
@using GestionPersonalWeb.Models
@using BlazorBootstrap
@using bdAntifraude.db
@using Microsoft.AspNetCore.Components
@rendermode InteractiveServer
@inject IJSRuntime JS
@inject NavigationManager NavigationManager
@inject IHttpClientFactory HttpClientFactory
@inject IHttpContextAccessor HttpContextAccessor
@inject UserState UserState

<div class="tablaTabLateral">
    <div class="row mb-3" style=" padding: 20px;border:solid 1px grey">
        @* Numero Sexenio *@
        <div class="col-md-6 d-flex divLabelInp">
            <label for="txtNuSex" class="fw-bold widthLabel">Número Sexenio: </label>
            <input type="number" class="form-control" disabled id="txtNuSex" @bind-value="@Persona.NUMEROSEXENIO" />
            

        </div>
        @* Sexenio *@
        <div class="col-md-6 d-flex divLabelInp">
            <label for="txtSex" class="fw-bold widthLabel li-height50">Sexenio: </label>
            <input type="number" class="form-control" disabled id="txtSex" @bind-value="@Persona.SEXENIOS" />
        </div>
        @* Numero Quinquenio *@
        <div class="col-md-4 d-flex divLabelInp">
            <label for="txtNuQ" class="fw-bold widthLabel li-height50">Número Quinquenio: </label>
            <input type="number" class="form-control" disabled id="txtNuQ" @bind-value="@Persona.NUMEROQUINQUENIO" />
        </div>
        @* Quinquenio *@
        <div class="col-md-4 d-flex divLabelInp">
            <label for="txtQ" class="fw-bold widthLabel li-height50">Quinquenio: </label>
            <input type="number" class="form-control" disabled id="txtQ" @bind-value="@Persona.QUINQUENIO" />
        </div>
        @* Quinquenio extra *@
        <div class="col-md-4 d-flex divLabelInp">
            <label for="txtQEx" class="fw-bold widthLabel li-height50">Quinquenio Extra: </label>
            <input class="form-control" disabled id="txtQEx" step="00" @bind-value="@Persona.QUINQUENIOEXTRA" />
        </div>     
    </div>
</div>
@code {
    [Parameter]
    public PERSONAS Persona { get; set; } = new PERSONAS();
    private HttpClient cliente = new HttpClient();
    [Parameter]
    public EventCallback OnPersonaActualizada { get; set; }
    // private List<TRABAJADORTIEMPOPARCIAL> itmList = new List<>();
    protected override async Task OnInitializedAsync()
    {
        // try
        // {
        //     var listnom = Persona.TRABAJADORTIEMPOPARCIAL;
        //     foreach (TRABAJADORTIEMPOPARCIAL i in listnom) { itmList.Add(i); }
        // }
        // catch (Exception e)
        // {
        //     Console.WriteLine($"Error al obtener los datos: {e.Message}");
        // }
    }
}
