Primera versión
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
@using System.Globalization
|
||||
<div class="row">
|
||||
|
||||
<div class="mt-3">
|
||||
<div style="height: 24px;">
|
||||
<b>Costes Asociados Urban</b>
|
||||
</div>
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Concepto</th>
|
||||
<th class="colorB fw-bold text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorFilasIntro fw-bold w4">Plazo de presentación de la documentación:</td>
|
||||
<td class="text-end">
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
@* <InputNumber TValue="int" Locale="es-ES" Min="0" class="inputForm formatoMoneda inputTabla" Value="@objetoLicitaciones.PlazoPresentacionDocumentos" ValueExpression="() => objetoLicitaciones.PlazoPresentacionDocumentos" ValueChanged="(value) => PlazoPresentacionDocumentosCambiado(value)"></InputNumber> meses *@
|
||||
<InputNumber TValue="double" @bind-Value="objetoLicitaciones.PlazoPresentacionDocumentos"
|
||||
step="any"
|
||||
@oninput="e => controlarMeses(e.Value?.ToString())"
|
||||
class="inputForm formatoMoneda inputTabla text-end" /> meses
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">Coste de producción del Trabajo Profesional</td>
|
||||
<td class="text-end"><span> @objetoLicitaciones.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">
|
||||
G.G. + B.I. <br />
|
||||
<span class="fw-normal" style="font-size:10px;">(40/19 Junta Consultiva de Contratación Pública del Estado)</span>
|
||||
</td>
|
||||
<td class="text-end" style="align-content:center;">
|
||||
<div class="d-flex" style="justify-content: end; gap:3px;">
|
||||
@objetoLicitaciones.Beneficio %
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold" style="background: #ffc107;">
|
||||
Precio del Trabajo objeto de la Licitación: <span>@objetoLicitaciones.PrecioTrabProf.MilesYDecimales() €</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public LICITACIONES objetoLicitaciones { get; set; } = new LICITACIONES();
|
||||
|
||||
[CascadingParameter]
|
||||
public HerramientaCASA.Components.Pages.LicitacionesURBAN _Parent { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
}
|
||||
|
||||
private async void PlazoPresentacionDocumentosCambiado(double e)
|
||||
{
|
||||
objetoLicitaciones.PlazoPresentacionDocumentos = e;
|
||||
objetoLicitaciones.CalcularHorasSuperficie();
|
||||
objetoLicitaciones.CalcularCostesProduccion();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
|
||||
private void controlarMeses(string meses)
|
||||
{
|
||||
if (double.TryParse(meses, out var valor))
|
||||
{
|
||||
string parseado = meses.ToString().Replace(",", ".");
|
||||
objetoLicitaciones.PlazoPresentacionDocumentos = double.Parse(parseado, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
PlazoPresentacionDocumentosCambiado(objetoLicitaciones.PlazoPresentacionDocumentos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
@using bdHerramientaCACOA.HerramientaURBAN
|
||||
@using bdHerramientaCACOA.HerramientaUrban
|
||||
@using bdHerramientaCACOA.db
|
||||
@using static bdHerramientaCACOA.HerramientaURBAN.URBAN
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Tipo de Documento:</label>
|
||||
<InputSelect @bind-Value="@itemSeleccionado.idTipoDocumentacion" class="inputForm" @oninput="e => ValidarYActualizar(e, nameof(itemSeleccionado.idTipoDocumentacion))">
|
||||
@foreach (var grupoTipologia in objetoLicitacionUrban.Enumerados.TiposDeDocumentos)
|
||||
{
|
||||
<option value="@grupoTipologia.idEnumeracion">@grupoTipologia.ValorAlfabetico1</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
<div class="col-6 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Documento:</label>
|
||||
<InputSelect @bind-Value="@itemSeleccionado.idTipoProyecto" class="inputForm" @oninput="e => ValidarYActualizar(e, nameof(itemSeleccionado.idTipoProyecto))">
|
||||
@foreach (var tipoProy in tipoProyectoAux)
|
||||
{
|
||||
<option value="@tipoProy.idtipoproyectos">@tipoProy.Descripcion</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Documentación Mínima:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoLicitacionUrban.TrabajoProfesional.DocumentacionMinima"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
Height="100"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="URBAN.DocumentacionURBAN" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción" PropertyName="Documentacion">
|
||||
@context.Descripcion
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Documentación Opcional:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoLicitacionUrban.TrabajoProfesional.DocumentacionOpcional"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
Height="100"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="URBAN.DocumentacionURBAN" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción" PropertyName="Documencación" Class="colorA">
|
||||
@context.Descripcion
|
||||
</GridColumn>
|
||||
<GridColumn TItem="URBAN.DocumentacionURBAN" HeaderTextAlignment="Alignment.Center" HeaderText="Añadida">
|
||||
<div class="d-flex justify-content-center checkTabla">
|
||||
<CheckboxInput Class="align-content-center checkGordo" Value=@context.Checkeada TValue="double" ValueExpression="() => context.Checkeada" ValueChanged="(value) => opcionalCambiado(value,context)"></CheckboxInput>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Datos Necesarios:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoLicitacionUrban.TrabajoProfesional.DatosNecesarios"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
Height="100"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="URBAN.DocumentacionURBAN" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción" PropertyName="Documencación" Class="colorA">
|
||||
@context.Descripcion
|
||||
</GridColumn>
|
||||
<GridColumn TItem="URBAN.DocumentacionURBAN" HeaderTextAlignment="Alignment.Center" HeaderText="Valor">
|
||||
@if (context.esCheckbox)
|
||||
{
|
||||
<div class="d-flex justify-content-center checkTabla">
|
||||
<CheckboxInput Class="align-content-center checkGordo" Value=@context.Checkeada TValue="double" ValueExpression="() => context.Checkeada" ValueChanged="(value) => DatoNecesarioCheckeado(value,context)"></CheckboxInput>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex">
|
||||
<InputNumber Min="0" class="inputForm inputTabla tdAlineadoDerecha pe-0 me-1" Value=@context.ValorNecesario TValue="double" ValueExpression="() => context.ValorNecesario" ValueChanged="(value) => DatoNecesarioCambiado(value,context)"></InputNumber>
|
||||
@* <NumberInput TValue="double" Min="0" @onchange="cambiarNumero" @bind-Value="context.ValorNecesario" class="inputForm"></NumberInput> *@
|
||||
</div>
|
||||
}
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
<CascadingValue Value="this" IsFixed="false">
|
||||
@* <InstrumentosLicitacionesUrban objetoLicitacionUrban="objetoLicitacionUrban"></InstrumentosLicitacionesUrban> *@
|
||||
<InstrumentosLicitacionesUrban @ref="componenteInstrumentos" objetoLicitacionUrban="objetoLicitacionUrban" />
|
||||
|
||||
</CascadingValue>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public bdHerramientaCACOA.LicitacionesURBAN objetoLicitacionUrban { get; set; } = new LicitacionesURBAN();
|
||||
private List<tipoproyectosURBAN> tipoProyectoAux = new List<tipoproyectosURBAN>();
|
||||
|
||||
private InstrumentosLicitacionesUrban componenteInstrumentos;
|
||||
|
||||
private URBANTrabajoProfesional itemSeleccionado = new URBANTrabajoProfesional();
|
||||
|
||||
private string tituloPopup = "";
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private string tituloInfo = "";
|
||||
|
||||
private bool nuevoElemento;
|
||||
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
[CascadingParameter]
|
||||
public HerramientaCASA.Components.Pages.LicitacionesURBAN _Parent { get; set; }
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
itemSeleccionado.idTipoProyecto = objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto;
|
||||
itemSeleccionado.idTipoDocumentacion = objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion;
|
||||
cambiarSelectDocumentos();
|
||||
|
||||
cambiarListasDocumentacion();
|
||||
itemSeleccionado.idInstrumento = objetoLicitacionUrban.TrabajoProfesional.idInstrumento;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async void cambiarNumero()
|
||||
{
|
||||
componenteInstrumentos?.Recargar();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
}
|
||||
private async void ValidarYActualizar(ChangeEventArgs e, string fieldName)
|
||||
{
|
||||
var value = e.Value?.ToString();
|
||||
var field = new FieldIdentifier(itemSeleccionado, fieldName);
|
||||
|
||||
switch (fieldName)
|
||||
{
|
||||
case nameof(itemSeleccionado.idTipoDocumentacion):
|
||||
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
itemSeleccionado.idTipoDocumentacion = int.Parse(value);
|
||||
objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion = itemSeleccionado.idTipoDocumentacion;
|
||||
cambiarSelectDocumentos();
|
||||
calcularHoraTrabajo();
|
||||
}
|
||||
else
|
||||
{
|
||||
itemSeleccionado.idTipoDocumentacion = 0;
|
||||
objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion = itemSeleccionado.idTipoDocumentacion;
|
||||
}
|
||||
|
||||
break;
|
||||
case nameof(itemSeleccionado.idTipoProyecto):
|
||||
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
itemSeleccionado.idTipoProyecto = int.Parse(value);
|
||||
objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto = itemSeleccionado.idTipoProyecto;
|
||||
cambiarListasDocumentacion();
|
||||
calcularHoraTrabajo();
|
||||
}
|
||||
else
|
||||
{
|
||||
itemSeleccionado.idTipoProyecto = 0;
|
||||
objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto = itemSeleccionado.idTipoProyecto;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private async void calcularHoraTrabajo()
|
||||
{
|
||||
foreach (var datos in objetoLicitacionUrban.TrabajoProfesional.DatosNecesarios.ToList())
|
||||
{
|
||||
objetoLicitacionUrban.ActualizarDatoNecesario(datos);
|
||||
}
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
}
|
||||
|
||||
private async Task cambiarSelectDocumentos()
|
||||
{
|
||||
tipoProyectoAux = objetoLicitacionUrban.Enumerados.ProyectosPorTipo(itemSeleccionado.idTipoDocumentacion);
|
||||
|
||||
if (itemSeleccionado.idTipoProyecto == 0)
|
||||
{
|
||||
objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto = tipoProyectoAux.First().idtipoproyectos;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tipoProyectoAux.Any(x => x.idtipoproyectos == itemSeleccionado.idTipoProyecto))
|
||||
{
|
||||
objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto = itemSeleccionado.idTipoProyecto;
|
||||
}
|
||||
else
|
||||
{
|
||||
objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto = tipoProyectoAux.First().idtipoproyectos;
|
||||
}
|
||||
}
|
||||
|
||||
cambiarListasDocumentacion();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
|
||||
}
|
||||
private async Task cambiarListasDocumentacion()
|
||||
{
|
||||
objetoLicitacionUrban.TrabajoProfesional.DocumentacionMinima = objetoLicitacionUrban.DocumentacionMinima(objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto);
|
||||
objetoLicitacionUrban.TrabajoProfesional.DocumentacionOpcional = objetoLicitacionUrban.DocumentacionOpcional(objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto);
|
||||
objetoLicitacionUrban.TrabajoProfesional.DatosNecesarios = objetoLicitacionUrban.DatosNecesarios(objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto);
|
||||
objetoLicitacionUrban.ObtenerHoraTipoDocumento();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
}
|
||||
|
||||
private async void opcionalCambiado(bool e, URBAN.DocumentacionURBAN objeto)
|
||||
{
|
||||
objeto.Checkeada = e;
|
||||
objetoLicitacionUrban.ActualizarDocumentacionOpcional(objeto);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
|
||||
}
|
||||
private async void DatoNecesarioCheckeado(bool e, URBAN.DocumentacionURBAN objeto)
|
||||
{
|
||||
objeto.Checkeada = e;
|
||||
objetoLicitacionUrban.ActualizarDatoNecesario(objeto);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
}
|
||||
private async void DatoNecesarioCambiado(double e, URBAN.DocumentacionURBAN objeto)
|
||||
{
|
||||
objeto.ValorNecesario = (double)e;
|
||||
objetoLicitacionUrban.ActualizarDatoNecesario(objeto);
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
RefreshState();
|
||||
}
|
||||
|
||||
|
||||
public void RefreshState()
|
||||
{
|
||||
_Parent.RefreshState();
|
||||
this.StateHasChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
@using BlazorBootstrap
|
||||
@using System.Text.Json
|
||||
@using bdHerramientaCACOA.HerramientaURBAN
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<div class="d-flex justify-content-between mt-3" style="padding-bottom:6px;">
|
||||
<div><b>Fases</b></div>
|
||||
</div>
|
||||
|
||||
<div style="position:relative;margin-bottom: 35px;">
|
||||
<Grid TItem="URBAN.FasesURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoFases"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
Height="100"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="URBAN.FasesURBAN" HeaderTextAlignment="Alignment.Center" HeaderText="Fases" PropertyName="Denominacion" Class="colorA">
|
||||
@context.Denominacion
|
||||
</GridColumn>
|
||||
<GridColumn TItem="URBAN.FasesURBAN" HeaderText="">
|
||||
<div class="d-flex">
|
||||
<InputNumber Min="0" class="inputForm inputTabla tdAlineadoDerecha pe-0 me-1" Value=@context.Porcentaje TValue="double" ValueExpression="() => context.Porcentaje" ValueChanged="(value) => porcentajeCambiado(value,context)"></InputNumber> %
|
||||
</div>
|
||||
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
<table class="table tablaCACOA mb-0" style="position:absolute;bottom:-33px;">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC">
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="mt-1">
|
||||
<button @onclick="@(() => restablecerValores())" class="btnBlue d-flex align-items-center"> <i class="fas fa-undo pe-1"></i> Restablecer </button>
|
||||
</div>
|
||||
<div style="align-self: center;">
|
||||
@if (totalPorcentaje != 100)
|
||||
{
|
||||
<div>
|
||||
Trabajo en misión parcial: <span> @totalPorcentaje %</span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>
|
||||
Total: <span> @totalPorcentaje %</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
public HerramientaCASA.Components.Pages.LicitacionesURBAN _Parent { get; set; }
|
||||
[Parameter]
|
||||
public bdHerramientaCACOA.LicitacionesURBAN objetoLicitacionUrban { get; set; } = new bdHerramientaCACOA.LicitacionesURBAN();
|
||||
|
||||
private double totalPorcentaje = 0;
|
||||
|
||||
|
||||
public List<URBAN.FasesURBAN> listadoFases { get; set; } = new List<URBAN.FasesURBAN>();
|
||||
|
||||
private string tituloPopup = "";
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private CASA.FasesTrabajo itemSeleccionado = new CASA.FasesTrabajo();
|
||||
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
listadoFases = objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.ToList();
|
||||
|
||||
totalPorcentaje = objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
}
|
||||
|
||||
private async Task OnRowClick(GridRowEventArgs<CASA.FasesTrabajo> objeto)
|
||||
{
|
||||
itemSeleccionado = objeto.Item;
|
||||
}
|
||||
|
||||
private async void porcentajeCambiado(double e, URBAN.FasesURBAN objeto)
|
||||
{
|
||||
|
||||
double porcentajeTotal = calcularPorcentaje(e, objeto);
|
||||
|
||||
if (porcentajeTotal <= 100)
|
||||
{
|
||||
objeto.Porcentaje = (double)e;
|
||||
objetoLicitacionUrban.ActualizarFase(objeto);
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
objeto.Porcentaje = 0;
|
||||
objetoLicitacionUrban.ActualizarFase(objeto);
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Danger,
|
||||
Message = $"La suma de los porcentajes no puede ser mayor de 100.",
|
||||
});
|
||||
}
|
||||
totalPorcentaje = objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
}
|
||||
|
||||
private double calcularPorcentaje(double e, URBAN.FasesURBAN objeto)
|
||||
{
|
||||
double porcentajeTotal = 0;
|
||||
objeto.Porcentaje = e;
|
||||
|
||||
int indice = objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional
|
||||
.FindIndex(x => x.idFase == objeto.idFase);
|
||||
|
||||
if (indice >= 0)
|
||||
{
|
||||
objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional[indice] = objeto;
|
||||
}
|
||||
|
||||
porcentajeTotal = objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
|
||||
return porcentajeTotal;
|
||||
}
|
||||
|
||||
private async void restablecerValores()
|
||||
{
|
||||
var lista = JsonSerializer.Deserialize<List<URBAN.FasesURBAN>>(JsonSerializer.Serialize(objetoLicitacionUrban.Enumerados.FasesTrabajo));
|
||||
objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional = lista;
|
||||
|
||||
listadoFases = objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.ToList();
|
||||
|
||||
totalPorcentaje = objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
|
||||
|
||||
objetoLicitacionUrban.CalcularHorasTrabajoProfesional();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
@using BlazorBootstrap
|
||||
@using System.Text.Json
|
||||
@using Microsoft.AspNetCore.WebUtilities
|
||||
@using bdHerramientaCACOA.HerramientaURBAN
|
||||
@using bdHerramientaCACOA.db
|
||||
@using static bdHerramientaCACOA.CASA
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<div style="height:100%">
|
||||
<div>
|
||||
<div class="mt-3 mb-3"><b>Innovacion de los instrumentos</b></div>
|
||||
<p class="col-6">
|
||||
@* @if (!nuevaRedaccion)
|
||||
{ *@
|
||||
<InputNumber TValue="double" Value="@objetoLicitacionUrban.TrabajoProfesional.valorInstrumentos"
|
||||
ValueExpression="() => objetoLicitacionUrban.TrabajoProfesional.valorInstrumentos"
|
||||
ValueChanged="(value) => ValorModificado(value)"
|
||||
step="any"
|
||||
class="inputForm text-end" /> <span>%</span>
|
||||
@* }
|
||||
else
|
||||
{
|
||||
<label>100 %</label>
|
||||
} *@
|
||||
|
||||
</p>
|
||||
@foreach (var enu in listadoInstrumentos)
|
||||
{
|
||||
<div class="form-check" style="gap:10px;">
|
||||
<input name="instrumentos" checked="@enu.Seleccionado" type="radio" id="@enu.idEnumeracion" class="form-check-input" value="@enu.ValorNumerico1" @onchange="() => Seleccionar(enu)">
|
||||
|
||||
<label class="form-check-label" for="@enu.idEnumeracion">@enu.Descripcion</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<table class="tablaAlter mt-4" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="tdAlter" style="width:50%;">Horas Trabajo Profesional </td>
|
||||
<td class="tdAlineadoDerecha">@objetoLicitacionUrban.TrabajoProfesional.horasTrabProfesional.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
public HerramientaCASA.Components.Pages.LicitacionUrban.DocumentosLicitacion _Parent { get; set; }
|
||||
[Parameter]
|
||||
public bdHerramientaCACOA.LicitacionesURBAN objetoLicitacionUrban { get; set; } = new bdHerramientaCACOA.LicitacionesURBAN();
|
||||
|
||||
private bool nuevaRedaccion = false;
|
||||
private enumeracionesCASA itemSeleccinado;
|
||||
|
||||
public List<CASA.enumeracionesCASA> listadoInstrumentos { get; set; } = new List<CASA.enumeracionesCASA>();
|
||||
|
||||
private CASA.FasesTrabajo itemSeleccionado = new CASA.FasesTrabajo();
|
||||
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
[Parameter]
|
||||
public string? idSimulador { get; set; } = "";
|
||||
|
||||
|
||||
public void Recargar()
|
||||
{
|
||||
// Vuelve a cargar los instrumentos y selecciona el actual
|
||||
listadoInstrumentos = objetoLicitacionUrban.Enumerados.ListaInstrumentos.ToList();
|
||||
var seleccionado = listadoInstrumentos.FirstOrDefault(x => x.idEnumeracion == objetoLicitacionUrban.TrabajoProfesional.idInstrumento);
|
||||
Seleccionar(seleccionado ?? listadoInstrumentos.First());
|
||||
objetoLicitacionUrban.CalcularHorasTrabajoProfesional();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var url = Navigation.ToAbsoluteUri(Navigation.Uri);
|
||||
|
||||
if (QueryHelpers.ParseQuery(url.Query).TryGetValue("idSimulador", out var clValue))
|
||||
{
|
||||
idSimulador = clValue;
|
||||
}
|
||||
|
||||
listadoInstrumentos = objetoLicitacionUrban.Enumerados.ListaInstrumentos.ToList();
|
||||
|
||||
if (string.IsNullOrEmpty(idSimulador))
|
||||
{
|
||||
Seleccionar(listadoInstrumentos.First());
|
||||
}
|
||||
else
|
||||
{
|
||||
Seleccionar(listadoInstrumentos.First(x => x.Seleccionado == true));
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
|
||||
private async void ValorModificado(double valor)
|
||||
{
|
||||
objetoLicitacionUrban.TrabajoProfesional.valorInstrumentos = Convert.ToDouble(valor);
|
||||
objetoLicitacionUrban.TrabajoProfesional.idInstrumento = itemSeleccinado.idEnumeracion;
|
||||
itemSeleccinado.ValorNumerico1 = Convert.ToDouble(valor);
|
||||
|
||||
objetoLicitacionUrban.CalcularHorasTrabajoProfesional();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
|
||||
private async void Seleccionar(enumeracionesCASA item)
|
||||
{
|
||||
|
||||
if (item.Codigo.Contains("NUEVARED"))
|
||||
{
|
||||
nuevaRedaccion = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
nuevaRedaccion = false;
|
||||
}
|
||||
|
||||
itemSeleccinado = item;
|
||||
itemSeleccinado.Seleccionado = true;
|
||||
|
||||
foreach (var intru in listadoInstrumentos.Where(x=>x.idEnumeracion != item.idEnumeracion))
|
||||
{
|
||||
intru.Seleccionado = false;
|
||||
}
|
||||
|
||||
objetoLicitacionUrban.TrabajoProfesional.valorInstrumentos = Convert.ToDouble(item.ValorNumerico1);
|
||||
objetoLicitacionUrban.TrabajoProfesional.idInstrumento = item.idEnumeracion;
|
||||
objetoLicitacionUrban.CalcularHorasTrabajoProfesional();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,410 @@
|
||||
@using BlazorBootstrap
|
||||
@using System.Text.Json
|
||||
@using Microsoft.AspNetCore.WebUtilities
|
||||
@using System.Globalization
|
||||
@using bdHerramientaCACOA.HerramientaURBAN
|
||||
@using bdHerramientaCACOA.db
|
||||
@using static bdHerramientaCACOA.CASA
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<Modal @ref="popupConfirmarBorrado" title="" IsVerticallyCentered="true" UseStaticBackdrop="true" CloseOnEscape="false">
|
||||
<BodyTemplate>
|
||||
<div class="col-12 formatoCampos">
|
||||
¿Estás seguro que desea eliminarlo?
|
||||
</div>
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="cerrarPopupConfirmarBorrado">Cerrar</Button>
|
||||
<Button @onclick="@(() => BorrarItem())" Color="ButtonColor.Danger">Eliminar</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
<EditForm EditContext="@editContext" OnValidSubmit="guardarFormulario" OnInvalidSubmit="@MostrarErrores" FormName="tiposForm">
|
||||
<DataAnnotationsValidator></DataAnnotationsValidator>
|
||||
<Modal @ref="popupGestionDatos" title="@tituloPopup" IsVerticallyCentered="true" UseStaticBackdrop="true" CloseOnEscape="false">
|
||||
<BodyTemplate>
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Descripción:</label>
|
||||
<InputText MaxLength="50" @bind-Value="itemSeleccionado.Descripcion" @oninput="e => ValidarYActualizar(e, nameof(itemSeleccionado.Descripcion))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(itemSeleccionado.Descripcion))</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Nº Trabajadores:</label>
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<InputNumber TValue="int" @bind-Value="itemSeleccionadoTemporal.Cantidad"
|
||||
step="any"
|
||||
@oninput="e => ValidarYActualizar(e, nameof(itemSeleccionadoTemporal.Cantidad))"
|
||||
class="inputForm text-end" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(itemSeleccionadoTemporal.Cantidad))</div>
|
||||
</div>
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Grupo Trabajador:</label>
|
||||
<InputSelect @bind-Value="@itemSeleccionadoTemporal.idConvenioColectivo" class="inputForm" @oninput="e => ValidarYActualizar(e, nameof(itemSeleccionadoTemporal.idConvenioColectivo))">
|
||||
@foreach (var grupoTipologia in objetoLicitacionUrban.Enumerados.ListaGrupoTrabajadores)
|
||||
{
|
||||
<option value="@grupoTipologia.idEnumeracion">@grupoTipologia.ValorAlfabetico1</option>
|
||||
}
|
||||
</InputSelect>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(itemSeleccionadoTemporal.idConvenioColectivo))</div>
|
||||
</div>
|
||||
|
||||
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="cerrarPopupGestionDatos">Cerrar</Button>
|
||||
<Button Type="ButtonType.Submit" Color="ButtonColor.Primary">@(nuevoElemento ? "Añadir" : "Modificar")</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
</EditForm>
|
||||
|
||||
<div>
|
||||
<div style="position:relative;margin-bottom: 45px;">
|
||||
<div class="d-flex justify-content-between mt-3" style="padding-bottom:6px;">
|
||||
<div><b>Solvencia técnica</b></div>
|
||||
</div>
|
||||
<Grid TItem="LicitacionesURBAN.SolvenciaTecnica"
|
||||
Class="tablaCACOA table"
|
||||
Data="listaSolvenciaTecnica"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
Height="100"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="LicitacionesURBAN.SolvenciaTecnica" Class="columna40Ancho" HeaderTextAlignment="Alignment.Center" HeaderText="Trabajadores" PropertyName="Documentacion">
|
||||
@context.Descripcion
|
||||
</GridColumn>
|
||||
<GridColumn TItem="LicitacionesURBAN.SolvenciaTecnica" Class="text-end columna10Ancho" HeaderTextAlignment="Alignment.Center" HeaderText="Nº Trabajadores" PropertyName="Documentacion">
|
||||
@context.Cantidad
|
||||
</GridColumn>
|
||||
<GridColumn TItem="LicitacionesURBAN.SolvenciaTecnica" Class="columna40Ancho" HeaderTextAlignment="Alignment.Center" HeaderText="Categoría Profesional" PropertyName="Documentacion">
|
||||
@context.TipoConvenio
|
||||
</GridColumn>
|
||||
<GridColumn TItem="LicitacionesURBAN.SolvenciaTecnica" Class="botonesTabla columna10Ancho" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context,false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
</span>
|
||||
<span @onclick="@(() => abrirPopupConfirmarBorrado(@context))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-trash"></Icon>
|
||||
</span>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
<table class="table tablaCACOA mb-0" style="position:absolute;bottom:-33px;">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="mt-1">
|
||||
<button @onclick="@(() => abrirPopupGestionDatos(new LicitacionesURBAN.SolvenciaTecnica(),true))" class="btnBlue d-flex align-items-center"> <i class="fas fa-plus-square pe-1"></i> Añadir Trabajadores</button>
|
||||
</div>
|
||||
<div style="align-self: center;">
|
||||
Total trabajadores:
|
||||
<span> @objetoLicitacionUrban.ListaSolvenciaTecnica.Sum(x => x.Cantidad)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@* <table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorA fw-bold">Equipo de trabajo mínimo</th>
|
||||
<th class="colorA fw-bold text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorFilasIntro w4"><p>Titulado grado superior</p> </td>
|
||||
<td class="text-end align-content-center">
|
||||
<div>
|
||||
<InputNumber TValue="int" Locale="es-ES" Min="0" class="inputForm formatoMoneda" Value="@objetoLicitacionUrban.minimoGradoSuperior" ValueExpression="() => objetoLicitacionUrban.minimoGradoSuperior" ValueChanged="(value) => MinimoSupCambiado(value)"></InputNumber>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorFilasIntro w4"><p>Titulado grado medio</p> </td>
|
||||
<td class="text-end align-content-center">
|
||||
<div>
|
||||
<InputNumber TValue="int" Locale="es-ES" Min="0" class="inputForm formatoMoneda" Value="@objetoLicitacionUrban.minimoGradoMedio" ValueExpression="() => objetoLicitacionUrban.minimoGradoMedio" ValueChanged="(value) => MinimoMedCambiado(value)"></InputNumber>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table> *@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
public HerramientaCASA.Components.Pages.LicitacionesURBAN _Parent { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bdHerramientaCACOA.LicitacionesURBAN objetoLicitacionUrban { get; set; } = new bdHerramientaCACOA.LicitacionesURBAN();
|
||||
|
||||
private bool nuevaRedaccion = false;
|
||||
|
||||
public List<CASA.enumeracionesCASA> listadoInstrumentos { get; set; } = new List<CASA.enumeracionesCASA>();
|
||||
|
||||
private LicitacionesURBAN.SolvenciaTecnica itemSeleccionado = new LicitacionesURBAN.SolvenciaTecnica();
|
||||
private LicitacionesURBAN.SolvenciaTecnica itemSeleccionadoTemporal { get; set; } = new LicitacionesURBAN.SolvenciaTecnica();
|
||||
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
[Parameter]
|
||||
public string? idSimulador { get; set; } = "";
|
||||
|
||||
private string tituloPopup = "";
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private EditContext editContext;
|
||||
|
||||
private bool nuevoElemento;
|
||||
private ValidationMessageStore? messageStore;
|
||||
List<LicitacionesURBAN.SolvenciaTecnica> listaSolvenciaTecnica;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
editContext = new EditContext(itemSeleccionado);
|
||||
messageStore = new ValidationMessageStore(editContext);
|
||||
|
||||
listaSolvenciaTecnica = objetoLicitacionUrban.ListaSolvenciaTecnica.ToList();
|
||||
}
|
||||
|
||||
private async Task abrirPopupGestionDatos(LicitacionesURBAN.SolvenciaTecnica objeto, bool esNuevo)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
|
||||
if (esNuevo)
|
||||
{
|
||||
nuevoElemento = true;
|
||||
itemSeleccionadoTemporal = new LicitacionesURBAN.SolvenciaTecnica();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
nuevoElemento = false;
|
||||
itemSeleccionadoTemporal = new LicitacionesURBAN.SolvenciaTecnica()
|
||||
{
|
||||
idConvenioColectivo = objeto.idConvenioColectivo,
|
||||
Cantidad = objeto.Cantidad,
|
||||
Descripcion = objeto.Descripcion
|
||||
};
|
||||
}
|
||||
|
||||
if (!nuevoElemento)
|
||||
{
|
||||
tituloPopup = "Modificar Trabajo";
|
||||
}
|
||||
else
|
||||
{
|
||||
tituloPopup = "Añadir Trabajo";
|
||||
}
|
||||
await popupGestionDatos.ShowAsync();
|
||||
}
|
||||
private void ValidarTodo()
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionadoTemporal.Descripcion }, nameof(itemSeleccionadoTemporal.Descripcion));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionadoTemporal.Cantidad }, nameof(itemSeleccionadoTemporal.Cantidad));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionadoTemporal.idConvenioColectivo }, nameof(itemSeleccionadoTemporal.idConvenioColectivo));
|
||||
}
|
||||
// GUARDAR
|
||||
private async Task guardarFormulario()
|
||||
{
|
||||
try
|
||||
{
|
||||
ValidarTodo();
|
||||
|
||||
if (!editContext!.GetValidationMessages().Any())
|
||||
{
|
||||
string accion = nuevoElemento ? "create" : "update";
|
||||
GestionarDatos(accion);
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Warning,
|
||||
Message = $"Debe rellenar los campos obligatorios.",
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Danger,
|
||||
Message = $"Error al guardar.",
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
private async Task GestionarDatos(string accion)
|
||||
{
|
||||
|
||||
switch (accion)
|
||||
{
|
||||
case "update":
|
||||
rellenarItem();
|
||||
objetoLicitacionUrban.ActualizarSolvenciaTecnica(itemSeleccionado);
|
||||
await cerrarPopupGestionDatos();
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Actualizado correctamente.",
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case "create":
|
||||
rellenarItem();
|
||||
objetoLicitacionUrban.InsertarSolvenciaTecnica(itemSeleccionado);
|
||||
await cerrarPopupGestionDatos();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Guardado correctamente.",
|
||||
});
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
objetoLicitacionUrban.EliminarSolvenciaTecnica(itemSeleccionado);
|
||||
|
||||
await cerrarPopupConfirmarBorrado();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Eliminado correctamente.",
|
||||
});
|
||||
break;
|
||||
}
|
||||
listaSolvenciaTecnica = objetoLicitacionUrban.ListaSolvenciaTecnica.ToList();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
private async Task BorrarItem()
|
||||
{
|
||||
await GestionarDatos("delete");
|
||||
}
|
||||
private void MostrarErrores()
|
||||
{
|
||||
// messageStore?.Clear();
|
||||
// foreach (var field in new[] { nameof(itemSeleccionadoTemporal.Coste), nameof(itemSeleccionadoTemporal.idTrabajo) })
|
||||
// {
|
||||
// ValidarYActualizar(new ChangeEventArgs { Value = typeof(CASA.OtrosTrabajos).GetProperty(field)?.GetValue(itemSeleccionadoTemporal) }, field);
|
||||
// }
|
||||
}
|
||||
private void ValidarYActualizar(ChangeEventArgs e, string fieldName)
|
||||
{
|
||||
var value = e.Value?.ToString();
|
||||
var field = new FieldIdentifier(itemSeleccionadoTemporal, fieldName);
|
||||
|
||||
switch (fieldName)
|
||||
{
|
||||
case nameof(itemSeleccionadoTemporal.Descripcion):
|
||||
itemSeleccionadoTemporal.Descripcion = value;
|
||||
break;
|
||||
case nameof(itemSeleccionadoTemporal.Cantidad):
|
||||
if (value == "")
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
string parseado = value;//.Replace(",", ".");
|
||||
itemSeleccionadoTemporal.Cantidad = int.Parse(parseado, CultureInfo.InvariantCulture);
|
||||
break;
|
||||
case nameof(itemSeleccionadoTemporal.idConvenioColectivo):
|
||||
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
itemSeleccionadoTemporal.idConvenioColectivo = int.Parse(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemSeleccionadoTemporal.idConvenioColectivo = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
messageStore?.Clear(field);
|
||||
if (fieldName == nameof(itemSeleccionadoTemporal.Descripcion) && itemSeleccionadoTemporal.Descripcion == "")
|
||||
{
|
||||
messageStore?.Add(field, "Rellene este campo");
|
||||
}
|
||||
if (fieldName == nameof(itemSeleccionadoTemporal.Cantidad) && itemSeleccionadoTemporal.Cantidad <= 0)
|
||||
{
|
||||
messageStore?.Add(field, "El Nº Trabajadores debe ser mayor que 0.");
|
||||
}
|
||||
|
||||
if (fieldName == nameof(itemSeleccionadoTemporal.idConvenioColectivo) && itemSeleccionadoTemporal.idConvenioColectivo == 0)
|
||||
{
|
||||
messageStore?.Add(field, "Seleccione uno.");
|
||||
}
|
||||
|
||||
editContext?.NotifyValidationStateChanged();
|
||||
}
|
||||
//////// PopUp eliminar registro
|
||||
private async Task abrirPopupConfirmarBorrado(LicitacionesURBAN.SolvenciaTecnica objeto)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
await popupConfirmarBorrado.ShowAsync();
|
||||
}
|
||||
private async Task cerrarPopupConfirmarBorrado()
|
||||
{
|
||||
await popupConfirmarBorrado.HideAsync();
|
||||
}
|
||||
private async Task cerrarPopupGestionDatos()
|
||||
{
|
||||
await popupGestionDatos.HideAsync();
|
||||
}
|
||||
private void rellenarItem()
|
||||
{
|
||||
itemSeleccionado.idConvenioColectivo = itemSeleccionadoTemporal.idConvenioColectivo;
|
||||
itemSeleccionado.Cantidad = itemSeleccionadoTemporal.Cantidad;
|
||||
itemSeleccionado.Descripcion = itemSeleccionadoTemporal.Descripcion;
|
||||
itemSeleccionado.TipoConvenio = objetoLicitacionUrban.Enumerados.ListaGrupoTrabajadores.First(x => x.idEnumeracion == itemSeleccionado.idConvenioColectivo).ValorAlfabetico1;
|
||||
|
||||
}
|
||||
private string GetExternalValidationMessage(string fieldName)
|
||||
{
|
||||
var field = new FieldIdentifier(itemSeleccionadoTemporal, fieldName);
|
||||
return messageStore?[field].FirstOrDefault() ?? string.Empty;
|
||||
}
|
||||
/*
|
||||
private async Task MinimoSupCambiado(int valor)
|
||||
{
|
||||
if (valor < 1)
|
||||
{
|
||||
objetoLicitacionUrban.minimoGradoSuperior = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
objetoLicitacionUrban.minimoGradoSuperior = valor;
|
||||
}
|
||||
await _Parent.CalcularTabla(objetoLicitacionUrban.idProvincia);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
private async Task MinimoMedCambiado(int valor)
|
||||
{
|
||||
|
||||
objetoLicitacionUrban.minimoGradoMedio = valor;
|
||||
await _Parent.CalcularTabla(objetoLicitacionUrban.idProvincia);
|
||||
}*/
|
||||
}
|
||||
Reference in New Issue
Block a user