From c1cc98993ffdaa118b2e97f08ac86772f3993b7e Mon Sep 17 00:00:00 2001 From: Perea Date: Mon, 8 Sep 2025 14:12:02 +0200 Subject: [PATCH] agregado puntos de informacion agregado tabla estadisticas --- .../Layout/ConfiguracionLayout.razor | 3 + .../ConfiguracionPages/PanelControlConf.razor | 9 + .../ConfiguracionPages/PuntosInfoConf.razor | 50 ++++ .../PuntosInfoTabs/PuntosHerraCASAConf.razor | 228 ++++++++++++++++++ .../PuntosInfoTabs/PuntosHerraURBANConf.razor | 228 ++++++++++++++++++ .../PuntosLicitacionCASAConf.razor | 226 +++++++++++++++++ .../PuntosLicitacionURBANConf.razor | 226 +++++++++++++++++ .../Components/Pages/HerramientaCASAS.razor | 2 + .../Components/Pages/HerramientaURBAN.razor | 3 + .../DocumentosLicitacion.razor | 22 +- .../FasesLicitacionesUrban.razor | 7 +- .../InstrumentosLicitacionesUrban.razor | 9 +- .../TablaTrabajadoresUrban.razor | 7 +- .../Components/Pages/LicitacionesURBAN.razor | 12 +- HerramientaCASA/UtilidadesCASA.cs | 19 ++ bdHerramientaCACOA/LicitacionesURBAN.cs | 4 + bdHerramientaCACOA/db/enumeraciones.cs | 2 - bdHerramientaCACOA/db/estadisticas.cs | 41 ++++ bdHerramientaCACOA/db/puntosinformacion.cs | 2 - bdHerramientaCACOA/db/simulaciones.cs | 2 + .../dbcontext/herramientascacoaContext.cs | 26 +- bdHerramientaCACOA/efpt.config.json | 4 + 22 files changed, 1115 insertions(+), 17 deletions(-) create mode 100644 HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoConf.razor create mode 100644 HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraCASAConf.razor create mode 100644 HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraURBANConf.razor create mode 100644 HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionCASAConf.razor create mode 100644 HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionURBANConf.razor create mode 100644 bdHerramientaCACOA/db/estadisticas.cs diff --git a/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor b/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor index 5ea64d8..7dfbda0 100644 --- a/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor +++ b/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor @@ -72,6 +72,9 @@ + diff --git a/HerramientaCASA/Components/Pages/ConfiguracionPages/PanelControlConf.razor b/HerramientaCASA/Components/Pages/ConfiguracionPages/PanelControlConf.razor index 0d7e264..9e32cb2 100644 --- a/HerramientaCASA/Components/Pages/ConfiguracionPages/PanelControlConf.razor +++ b/HerramientaCASA/Components/Pages/ConfiguracionPages/PanelControlConf.razor @@ -67,6 +67,15 @@ + +
+ +
+

Puntos de información

+ @*

Revise sus simulaciones creadas anteriormente

*@ +
+
+
diff --git a/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoConf.razor b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoConf.razor new file mode 100644 index 0000000..7ac2f7c --- /dev/null +++ b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoConf.razor @@ -0,0 +1,50 @@ +@page "/PuntosInfo" + +@inject NavigationManager Navigation +@layout ConfiguracionLayout +@using BlazorBootstrap +@using System.Globalization +@using bdHerramientaCACOA.db + + + +
+ + + +
+ +
+
+
+ + + +
+ +
+
+
+ + + +
+ +
+
+
+ + + +
+ +
+
+
+
+
+ + +@code { + +} diff --git a/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraCASAConf.razor b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraCASAConf.razor new file mode 100644 index 0000000..50e1508 --- /dev/null +++ b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraCASAConf.razor @@ -0,0 +1,228 @@ +@inject NavigationManager Navigation +@layout ConfiguracionLayout +@rendermode InteractiveServer + +@using BlazorBootstrap +@using System.Globalization +@using Microsoft.EntityFrameworkCore +@using bdHerramientaCACOA.db + + + + + + + +
+
+ + +
+
@GetExternalValidationMessage(nameof(TituloPunto))
+
+ +
+
+ + +
+
+
+ + + + +
+
+ +
+ + + + @context.Titulo + + + + @context.Descripcion + + + +
+ + + +
+
+
+
+
+ +@code { + + public List listadoPuntosInfo { get; set; } = new List(); + + [SupplyParameterFromForm] + private puntosinformacion itemSeleccionado { get; set; } = new puntosinformacion(); + + private string tituloPopup = ""; + public string Filter { get; set; } = ""; + private Modal popupGestionDatos = default!; + + private string TituloPunto = ""; + private string DescripcionPunto = ""; + + List mensajes = new List(); + + private EditContext? editContext; + private ValidationMessageStore? messageStore; + public tsHerramientasCACOA bd; + + private int idHerramienta = 31; + + protected override async Task OnInitializedAsync() + { + bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false); + + editContext = new EditContext(itemSeleccionado); + messageStore = new ValidationMessageStore(editContext); + + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + } + + private async Task abrirPopupGestionDatos(puntosinformacion objeto, bool esNuevo) + { + itemSeleccionado = objeto; + + TituloPunto = objeto.Titulo; + DescripcionPunto = objeto.Descripcion; + + tituloPopup = "Modificar punto información"; + + + await popupGestionDatos.ShowAsync(); + } + private async Task cerrarPopupGestionDatos() + { + await popupGestionDatos.HideAsync(); + } + + private void ValidarYActualizar(ChangeEventArgs e, string fieldName) + { + var value = e.Value?.ToString(); + var field = new FieldIdentifier(itemSeleccionado, fieldName); + + switch (fieldName) + { + case nameof(TituloPunto): + if (!string.IsNullOrEmpty(value)) + { + + TituloPunto = value; + } + else + { + TituloPunto = ""; + } + break; + } + + messageStore?.Clear(field); + if (fieldName == nameof(TituloPunto) && TituloPunto == "") + { + messageStore?.Add(field, "El título no puede estar vacío."); + } + editContext?.NotifyValidationStateChanged(); + } + + private void ValidarTodo() + { + ValidarYActualizar(new ChangeEventArgs { Value = TituloPunto }, nameof(TituloPunto)); + } + + private string GetExternalValidationMessage(string fieldName) + { + var field = new FieldIdentifier(itemSeleccionado, fieldName); + return messageStore?[field].FirstOrDefault() ?? string.Empty; + } + + private async Task GestionarDatos(string accion) + { + switch (accion) + { + case "update": + var puntoObtenido = bd.puntosinformacion.Where(x => x.idPuntosInformacion == itemSeleccionado.idPuntosInformacion).FirstOrDefault(); + + + itemSeleccionado.Descripcion = DescripcionPunto; + itemSeleccionado.Titulo = TituloPunto; + + UtilidadesCASA.actualizarPuntoInformacion(bd, puntoObtenido, itemSeleccionado); + + await cerrarPopupGestionDatos(); + + mensajes.Add(new ToastMessage + { + Type = ToastType.Primary, + Message = $"Actualizado correctamente.", + }); + + break; + } + bd.SaveChanges(); + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + await InvokeAsync(StateHasChanged); + } + + // GUARDAR + private async Task guardarFormulario() + { + try + { + ValidarTodo(); + + if (!editContext!.GetValidationMessages().Any()) + { + string accion = "update"; + await 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 void MostrarErrores() + { + messageStore?.Clear(); + foreach (var field in new[] { nameof(TituloPunto)}) + { + ValidarYActualizar(new ChangeEventArgs { Value = typeof(puntosinformacion).GetProperty(field)?.GetValue(itemSeleccionado) }, field); + } + } + +} \ No newline at end of file diff --git a/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraURBANConf.razor b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraURBANConf.razor new file mode 100644 index 0000000..99333bd --- /dev/null +++ b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosHerraURBANConf.razor @@ -0,0 +1,228 @@ +@inject NavigationManager Navigation +@layout ConfiguracionLayout +@rendermode InteractiveServer + +@using BlazorBootstrap +@using System.Globalization +@using Microsoft.EntityFrameworkCore +@using bdHerramientaCACOA.db + + + + + + + +
+
+ + +
+
@GetExternalValidationMessage(nameof(TituloPunto))
+
+ +
+
+ + +
+
+
+ + + + +
+
+ +
+ + + + @context.Titulo + + + + @context.Descripcion + + + +
+ + + +
+
+
+
+
+ +@code { + + public List listadoPuntosInfo { get; set; } = new List(); + + [SupplyParameterFromForm] + private puntosinformacion itemSeleccionado { get; set; } = new puntosinformacion(); + + private string tituloPopup = ""; + public string Filter { get; set; } = ""; + private Modal popupGestionDatos = default!; + + private string TituloPunto = ""; + private string DescripcionPunto = ""; + + List mensajes = new List(); + + private EditContext? editContext; + private ValidationMessageStore? messageStore; + public tsHerramientasCACOA bd; + + private int idHerramienta = 34; + + protected override async Task OnInitializedAsync() + { + bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false); + + editContext = new EditContext(itemSeleccionado); + messageStore = new ValidationMessageStore(editContext); + + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + } + + private async Task abrirPopupGestionDatos(puntosinformacion objeto, bool esNuevo) + { + itemSeleccionado = objeto; + + TituloPunto = objeto.Titulo; + DescripcionPunto = objeto.Descripcion; + + tituloPopup = "Modificar punto información"; + + + await popupGestionDatos.ShowAsync(); + } + private async Task cerrarPopupGestionDatos() + { + await popupGestionDatos.HideAsync(); + } + + private void ValidarYActualizar(ChangeEventArgs e, string fieldName) + { + var value = e.Value?.ToString(); + var field = new FieldIdentifier(itemSeleccionado, fieldName); + + switch (fieldName) + { + case nameof(TituloPunto): + if (!string.IsNullOrEmpty(value)) + { + + TituloPunto = value; + } + else + { + TituloPunto = ""; + } + break; + } + + messageStore?.Clear(field); + if (fieldName == nameof(TituloPunto) && TituloPunto == "") + { + messageStore?.Add(field, "El título no puede estar vacío."); + } + editContext?.NotifyValidationStateChanged(); + } + + private void ValidarTodo() + { + ValidarYActualizar(new ChangeEventArgs { Value = TituloPunto }, nameof(TituloPunto)); + } + + private string GetExternalValidationMessage(string fieldName) + { + var field = new FieldIdentifier(itemSeleccionado, fieldName); + return messageStore?[field].FirstOrDefault() ?? string.Empty; + } + + private async Task GestionarDatos(string accion) + { + switch (accion) + { + case "update": + var puntoObtenido = bd.puntosinformacion.Where(x => x.idPuntosInformacion == itemSeleccionado.idPuntosInformacion).FirstOrDefault(); + + + itemSeleccionado.Descripcion = DescripcionPunto; + itemSeleccionado.Titulo = TituloPunto; + + UtilidadesCASA.actualizarPuntoInformacion(bd, puntoObtenido, itemSeleccionado); + + await cerrarPopupGestionDatos(); + + mensajes.Add(new ToastMessage + { + Type = ToastType.Primary, + Message = $"Actualizado correctamente.", + }); + + break; + } + bd.SaveChanges(); + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + await InvokeAsync(StateHasChanged); + } + + // GUARDAR + private async Task guardarFormulario() + { + try + { + ValidarTodo(); + + if (!editContext!.GetValidationMessages().Any()) + { + string accion = "update"; + await 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 void MostrarErrores() + { + messageStore?.Clear(); + foreach (var field in new[] { nameof(TituloPunto) }) + { + ValidarYActualizar(new ChangeEventArgs { Value = typeof(puntosinformacion).GetProperty(field)?.GetValue(itemSeleccionado) }, field); + } + } + +} \ No newline at end of file diff --git a/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionCASAConf.razor b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionCASAConf.razor new file mode 100644 index 0000000..43cfbf8 --- /dev/null +++ b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionCASAConf.razor @@ -0,0 +1,226 @@ +@inject NavigationManager Navigation +@layout ConfiguracionLayout +@rendermode InteractiveServer + +@using BlazorBootstrap +@using System.Globalization +@using Microsoft.EntityFrameworkCore +@using bdHerramientaCACOA.db + + + + + + + +
+
+ + +
+
@GetExternalValidationMessage(nameof(TituloPunto))
+
+ +
+
+ + +
+
+
+ + + + +
+
+ +
+ + + + @context.Titulo + + + + @context.Descripcion + + + +
+ + + +
+
+
+
+
+ +@code { + + public List listadoPuntosInfo { get; set; } = new List(); + + [SupplyParameterFromForm] + private puntosinformacion itemSeleccionado { get; set; } = new puntosinformacion(); + + private string tituloPopup = ""; + public string Filter { get; set; } = ""; + private Modal popupGestionDatos = default!; + + private string TituloPunto = ""; + private string DescripcionPunto = ""; + + List mensajes = new List(); + + private EditContext? editContext; + private ValidationMessageStore? messageStore; + public tsHerramientasCACOA bd; + + private int idHerramienta = 32; + + protected override async Task OnInitializedAsync() + { + bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false); + + editContext = new EditContext(itemSeleccionado); + messageStore = new ValidationMessageStore(editContext); + + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + } + + private async Task abrirPopupGestionDatos(puntosinformacion objeto, bool esNuevo) + { + itemSeleccionado = objeto; + + TituloPunto = objeto.Titulo; + DescripcionPunto = objeto.Descripcion; + + tituloPopup = "Modificar punto información"; + + + await popupGestionDatos.ShowAsync(); + } + private async Task cerrarPopupGestionDatos() + { + await popupGestionDatos.HideAsync(); + } + + private void ValidarYActualizar(ChangeEventArgs e, string fieldName) + { + var value = e.Value?.ToString(); + var field = new FieldIdentifier(itemSeleccionado, fieldName); + + switch (fieldName) + { + case nameof(TituloPunto): + if (!string.IsNullOrEmpty(value)) + { + + TituloPunto = value; + } + else + { + TituloPunto = ""; + } + break; + } + + messageStore?.Clear(field); + if (fieldName == nameof(TituloPunto) && TituloPunto == "") + { + messageStore?.Add(field, "El título no puede estar vacío."); + } + editContext?.NotifyValidationStateChanged(); + } + + private void ValidarTodo() + { + ValidarYActualizar(new ChangeEventArgs { Value = TituloPunto }, nameof(TituloPunto)); + } + + private string GetExternalValidationMessage(string fieldName) + { + var field = new FieldIdentifier(itemSeleccionado, fieldName); + return messageStore?[field].FirstOrDefault() ?? string.Empty; + } + + private async Task GestionarDatos(string accion) + { + switch (accion) + { + case "update": + var puntoObtenido = bd.puntosinformacion.Where(x => x.idPuntosInformacion == itemSeleccionado.idPuntosInformacion).FirstOrDefault(); + + + itemSeleccionado.Descripcion = DescripcionPunto; + itemSeleccionado.Titulo = TituloPunto; + + UtilidadesCASA.actualizarPuntoInformacion(bd, puntoObtenido, itemSeleccionado); + + await cerrarPopupGestionDatos(); + + mensajes.Add(new ToastMessage + { + Type = ToastType.Primary, + Message = $"Actualizado correctamente.", + }); + + break; + } + bd.SaveChanges(); + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + await InvokeAsync(StateHasChanged); + } + + // GUARDAR + private async Task guardarFormulario() + { + try + { + ValidarTodo(); + + if (!editContext!.GetValidationMessages().Any()) + { + string accion = "update"; + await 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 void MostrarErrores() + { + messageStore?.Clear(); + foreach (var field in new[] { nameof(TituloPunto) }) + { + ValidarYActualizar(new ChangeEventArgs { Value = typeof(puntosinformacion).GetProperty(field)?.GetValue(itemSeleccionado) }, field); + } + } +} \ No newline at end of file diff --git a/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionURBANConf.razor b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionURBANConf.razor new file mode 100644 index 0000000..fc40746 --- /dev/null +++ b/HerramientaCASA/Components/Pages/ConfiguracionPages/PuntosInfoTabs/PuntosLicitacionURBANConf.razor @@ -0,0 +1,226 @@ +@inject NavigationManager Navigation +@layout ConfiguracionLayout +@rendermode InteractiveServer + +@using BlazorBootstrap +@using System.Globalization +@using Microsoft.EntityFrameworkCore +@using bdHerramientaCACOA.db + + + + + + + +
+
+ + +
+
@GetExternalValidationMessage(nameof(TituloPunto))
+
+ +
+
+ + +
+
+
+ + + + +
+
+ +
+ + + + @context.Titulo + + + + @context.Descripcion + + + +
+ + + +
+
+
+
+
+ +@code { + + public List listadoPuntosInfo { get; set; } = new List(); + + [SupplyParameterFromForm] + private puntosinformacion itemSeleccionado { get; set; } = new puntosinformacion(); + + private string tituloPopup = ""; + public string Filter { get; set; } = ""; + private Modal popupGestionDatos = default!; + + private string TituloPunto = ""; + private string DescripcionPunto = ""; + + List mensajes = new List(); + + private EditContext? editContext; + private ValidationMessageStore? messageStore; + public tsHerramientasCACOA bd; + + private int idHerramienta = 35; + + protected override async Task OnInitializedAsync() + { + bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false); + + editContext = new EditContext(itemSeleccionado); + messageStore = new ValidationMessageStore(editContext); + + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + } + + private async Task abrirPopupGestionDatos(puntosinformacion objeto, bool esNuevo) + { + itemSeleccionado = objeto; + + TituloPunto = objeto.Titulo; + DescripcionPunto = objeto.Descripcion; + + tituloPopup = "Modificar punto información"; + + + await popupGestionDatos.ShowAsync(); + } + private async Task cerrarPopupGestionDatos() + { + await popupGestionDatos.HideAsync(); + } + + private void ValidarYActualizar(ChangeEventArgs e, string fieldName) + { + var value = e.Value?.ToString(); + var field = new FieldIdentifier(itemSeleccionado, fieldName); + + switch (fieldName) + { + case nameof(TituloPunto): + if (!string.IsNullOrEmpty(value)) + { + + TituloPunto = value; + } + else + { + TituloPunto = ""; + } + break; + } + + messageStore?.Clear(field); + if (fieldName == nameof(TituloPunto) && TituloPunto == "") + { + messageStore?.Add(field, "El título no puede estar vacío."); + } + editContext?.NotifyValidationStateChanged(); + } + + private void ValidarTodo() + { + ValidarYActualizar(new ChangeEventArgs { Value = TituloPunto }, nameof(TituloPunto)); + } + + private string GetExternalValidationMessage(string fieldName) + { + var field = new FieldIdentifier(itemSeleccionado, fieldName); + return messageStore?[field].FirstOrDefault() ?? string.Empty; + } + + private async Task GestionarDatos(string accion) + { + switch (accion) + { + case "update": + var puntoObtenido = bd.puntosinformacion.Where(x => x.idPuntosInformacion == itemSeleccionado.idPuntosInformacion).FirstOrDefault(); + + + itemSeleccionado.Descripcion = DescripcionPunto; + itemSeleccionado.Titulo = TituloPunto; + + UtilidadesCASA.actualizarPuntoInformacion(bd, puntoObtenido, itemSeleccionado); + + await cerrarPopupGestionDatos(); + + mensajes.Add(new ToastMessage + { + Type = ToastType.Primary, + Message = $"Actualizado correctamente.", + }); + + break; + } + bd.SaveChanges(); + listadoPuntosInfo = bd.puntosinformacion.Where(x => x.idTipoHerramienta == idHerramienta).ToList(); + await InvokeAsync(StateHasChanged); + } + + // GUARDAR + private async Task guardarFormulario() + { + try + { + ValidarTodo(); + + if (!editContext!.GetValidationMessages().Any()) + { + string accion = "update"; + await 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 void MostrarErrores() + { + messageStore?.Clear(); + foreach (var field in new[] { nameof(TituloPunto) }) + { + ValidarYActualizar(new ChangeEventArgs { Value = typeof(puntosinformacion).GetProperty(field)?.GetValue(itemSeleccionado) }, field); + } + } +} \ No newline at end of file diff --git a/HerramientaCASA/Components/Pages/HerramientaCASAS.razor b/HerramientaCASA/Components/Pages/HerramientaCASAS.razor index bb8abe7..cee269e 100644 --- a/HerramientaCASA/Components/Pages/HerramientaCASAS.razor +++ b/HerramientaCASA/Components/Pages/HerramientaCASAS.razor @@ -191,6 +191,8 @@ { int idtipoSimulacion = bd.enumeraciones.First(x => x.Codigo == HerramientaCASA.UtilidadesCASA.obtenerTipoSimulacion(HerramientaCASA.UtilidadesCASA.TiposSimulaciones.CASA)).idEnumeracion; + + string jsonObjeto = Newtonsoft.Json.JsonConvert.SerializeObject(casa); if (string.IsNullOrEmpty(idSimulador)) diff --git a/HerramientaCASA/Components/Pages/HerramientaURBAN.razor b/HerramientaCASA/Components/Pages/HerramientaURBAN.razor index 7940ec7..88061ab 100644 --- a/HerramientaCASA/Components/Pages/HerramientaURBAN.razor +++ b/HerramientaCASA/Components/Pages/HerramientaURBAN.razor @@ -169,6 +169,9 @@ // para evitar loops int idtipoSimulacion = bd.enumeraciones.First(x => x.Codigo == HerramientaCASA.UtilidadesCASA.obtenerTipoSimulacion(HerramientaCASA.UtilidadesCASA.TiposSimulaciones.URBAN)).idEnumeracion; + // para evitar loops + + string jsonObjeto = Newtonsoft.Json.JsonConvert.SerializeObject(urban); if (string.IsNullOrEmpty(idSimulador)) diff --git a/HerramientaCASA/Components/Pages/LicitacionUrban/DocumentosLicitacion.razor b/HerramientaCASA/Components/Pages/LicitacionUrban/DocumentosLicitacion.razor index bfed109..2ad058d 100644 --- a/HerramientaCASA/Components/Pages/LicitacionUrban/DocumentosLicitacion.razor +++ b/HerramientaCASA/Components/Pages/LicitacionUrban/DocumentosLicitacion.razor @@ -27,7 +27,13 @@
- +
- +
- +
-
Fases
+
+ @if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 59).Descripcion)) + { + @UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 59).Descripcion) + } + Fases
diff --git a/HerramientaCASA/Components/Pages/LicitacionUrban/InstrumentosLicitacionesUrban.razor b/HerramientaCASA/Components/Pages/LicitacionUrban/InstrumentosLicitacionesUrban.razor index ad9e077..c3bed6e 100644 --- a/HerramientaCASA/Components/Pages/LicitacionUrban/InstrumentosLicitacionesUrban.razor +++ b/HerramientaCASA/Components/Pages/LicitacionUrban/InstrumentosLicitacionesUrban.razor @@ -10,7 +10,14 @@
-
Innovacion de los instrumentos
+
+ + @if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 58).Descripcion)) + { + @UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 58).Descripcion) + } + Innovacion de los instrumentos +

@* @if (!nuevaRedaccion) { *@ diff --git a/HerramientaCASA/Components/Pages/LicitacionUrban/TablaTrabajadoresUrban.razor b/HerramientaCASA/Components/Pages/LicitacionUrban/TablaTrabajadoresUrban.razor index a7e06ac..c77c909 100644 --- a/HerramientaCASA/Components/Pages/LicitacionUrban/TablaTrabajadoresUrban.razor +++ b/HerramientaCASA/Components/Pages/LicitacionUrban/TablaTrabajadoresUrban.razor @@ -65,7 +65,12 @@

-
Solvencia técnica
+
+ @if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 60).Descripcion)) + { + @UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 60).Descripcion) + } + Solvencia técnica
- Plazo de presentación de la documentación: + + @if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 61).Descripcion)) + { + @UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 61).Descripcion) + } + Plazo de presentación de la documentación:
@* meses *@ @@ -150,6 +155,10 @@ + @if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 62).Descripcion)) + { + @UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 62).Descripcion) + } G.G. + B.I.
(40/19 Junta Consultiva de Contratación Pública del Estado) @@ -314,6 +323,7 @@ { //HACER // para evitar loops + string jsonObjeto = Newtonsoft.Json.JsonConvert.SerializeObject(objetoLicitacionUrban); int idtipoSimulacion = bd.enumeraciones.First(x => x.Codigo == HerramientaCASA.UtilidadesCASA.obtenerTipoSimulacion(HerramientaCASA.UtilidadesCASA.TiposSimulaciones.URBANDSIMP)).idEnumeracion; diff --git a/HerramientaCASA/UtilidadesCASA.cs b/HerramientaCASA/UtilidadesCASA.cs index 344b449..938017e 100644 --- a/HerramientaCASA/UtilidadesCASA.cs +++ b/HerramientaCASA/UtilidadesCASA.cs @@ -155,6 +155,7 @@ namespace HerramientaCASA } } + public static void crearFactorCorrecion(tsHerramientasCACOA bd, factorescorreccion factorCorrecc) { try @@ -198,6 +199,24 @@ namespace HerramientaCASA } } + public static void actualizarPuntoInformacion(tsHerramientasCACOA bd, puntosinformacion puntoOrig, puntosinformacion puntoEdit) + { + try + { + puntoOrig.Descripcion = puntoEdit.Descripcion; + puntoOrig.Titulo = puntoEdit.Titulo; + + bd.puntosinformacion.Update(puntoOrig); + + var cambiarFecha = bd.enumeraciones.First(x => x.Codigo == "CW.FECHAULTMOD"); + cambiarFecha.Fecha1 = DateTime.Now; + bd.enumeraciones.Update(cambiarFecha); + } + catch (Exception ex) + { + + } + } //public static void actualizarCosteDespachoProfesional(tsHerramientasCACOA bd, costedespachoprofesional coste, costedespachoprofesional costeEdit) //{ diff --git a/bdHerramientaCACOA/LicitacionesURBAN.cs b/bdHerramientaCACOA/LicitacionesURBAN.cs index 24a9d55..6d7eb3c 100644 --- a/bdHerramientaCACOA/LicitacionesURBAN.cs +++ b/bdHerramientaCACOA/LicitacionesURBAN.cs @@ -46,6 +46,8 @@ namespace bdHerramientaCACOA public class EnumeradosLicitacionesURBAN { + public List PuntosInformacion { get; set; } = new List(); + public List ListaConvenioColectivo { get; set; } = new List(); public List ListaCDCI { get; set; } = new List(); @@ -159,6 +161,8 @@ namespace bdHerramientaCACOA checkListFasesURBAN(listaFases); + Enumerados.PuntosInformacion = bd.puntosinformacion.Where(x => x.idTipoHerramienta == 35).ToList(); + Enumerados.FasesTrabajo = JsonSerializer.Deserialize>(JsonSerializer.Serialize(TrabajoProfesional.FasesTrabajoProfesional)); } diff --git a/bdHerramientaCACOA/db/enumeraciones.cs b/bdHerramientaCACOA/db/enumeraciones.cs index b4be263..9437607 100644 --- a/bdHerramientaCACOA/db/enumeraciones.cs +++ b/bdHerramientaCACOA/db/enumeraciones.cs @@ -43,8 +43,6 @@ public partial class enumeraciones public virtual gruposenumeraciones? idGrupoEnumeracionNavigation { get; set; } - public virtual ICollection puntosinformacion { get; set; } = new List(); - public virtual ICollection simulaciones { get; set; } = new List(); public virtual ICollection tipologias { get; set; } = new List(); diff --git a/bdHerramientaCACOA/db/estadisticas.cs b/bdHerramientaCACOA/db/estadisticas.cs new file mode 100644 index 0000000..643cd22 --- /dev/null +++ b/bdHerramientaCACOA/db/estadisticas.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; + +namespace bdHerramientaCACOA.db; + +public partial class estadisticas +{ + public int idEstadistica { get; set; } + + public int? idSimulacion { get; set; } + + public double? costeDirecto { get; set; } + + public double? costeIndirecto { get; set; } + + public double? costeVariable { get; set; } + + public double? costeHoraDespachoProf { get; set; } + + public int? totalFases { get; set; } + + public double? horasTPEDocumentacion { get; set; } + + public double? horasTPEDireccionObra { get; set; } + + public double? horasTPE { get; set; } + + public int? porcentajeExternalizacion { get; set; } + + public double? plazoPresentacion { get; set; } + + public double? costeProduccion { get; set; } + + public double? totalOtrosTrabajos { get; set; } + + public int? porcentajeBeneficio { get; set; } + + public int? numeroTrabajadores { get; set; } + + public virtual simulaciones? idSimulacionNavigation { get; set; } +} diff --git a/bdHerramientaCACOA/db/puntosinformacion.cs b/bdHerramientaCACOA/db/puntosinformacion.cs index 59bd045..3f1b2a7 100644 --- a/bdHerramientaCACOA/db/puntosinformacion.cs +++ b/bdHerramientaCACOA/db/puntosinformacion.cs @@ -12,6 +12,4 @@ public partial class puntosinformacion public string? Descripcion { get; set; } public int? idTipoHerramienta { get; set; } - - public virtual enumeraciones? idTipoHerramientaNavigation { get; set; } } diff --git a/bdHerramientaCACOA/db/simulaciones.cs b/bdHerramientaCACOA/db/simulaciones.cs index a710b88..f3660e9 100644 --- a/bdHerramientaCACOA/db/simulaciones.cs +++ b/bdHerramientaCACOA/db/simulaciones.cs @@ -27,6 +27,8 @@ public partial class simulaciones public double? CostesVariables { get; set; } + public virtual ICollection estadisticas { get; set; } = new List(); + public virtual usuarios idCodigoNavigation { get; set; } = null!; public virtual ficheros idFicheroJSONNavigation { get; set; } = null!; diff --git a/bdHerramientaCACOA/dbcontext/herramientascacoaContext.cs b/bdHerramientaCACOA/dbcontext/herramientascacoaContext.cs index e4e3b96..99206a8 100644 --- a/bdHerramientaCACOA/dbcontext/herramientascacoaContext.cs +++ b/bdHerramientaCACOA/dbcontext/herramientascacoaContext.cs @@ -26,6 +26,8 @@ public partial class herramientascacoaContext : DbContext public virtual DbSet enumeraciones { get; set; } + public virtual DbSet estadisticas { get; set; } + public virtual DbSet factorescorreccion { get; set; } public virtual DbSet ficheros { get; set; } @@ -156,6 +158,24 @@ public partial class herramientascacoaContext : DbContext .HasConstraintName("FK_enumeraciones_gruposenumeracion"); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.idEstadistica).HasName("PRIMARY"); + + entity.HasIndex(e => e.idSimulacion, "FK_estadisticas_simulaciones_idx"); + + entity.Property(e => e.idEstadistica).HasColumnType("int(11)"); + entity.Property(e => e.idSimulacion).HasColumnType("int(11)"); + entity.Property(e => e.numeroTrabajadores).HasColumnType("int(11)"); + entity.Property(e => e.porcentajeBeneficio).HasColumnType("int(11)"); + entity.Property(e => e.porcentajeExternalizacion).HasColumnType("int(11)"); + entity.Property(e => e.totalFases).HasColumnType("int(11)"); + + entity.HasOne(d => d.idSimulacionNavigation).WithMany(p => p.estadisticas) + .HasForeignKey(d => d.idSimulacion) + .HasConstraintName("FK_estadisticas_simulaciones"); + }); + modelBuilder.Entity(entity => { entity.HasKey(e => e.idFactorCorreccion).HasName("PRIMARY"); @@ -238,16 +258,10 @@ public partial class herramientascacoaContext : DbContext { entity.HasKey(e => e.idPuntosInformacion).HasName("PRIMARY"); - entity.HasIndex(e => e.idTipoHerramienta, "FK_enumeraciones_idEnumeracion_idx"); - entity.Property(e => e.idPuntosInformacion).HasColumnType("int(11)"); entity.Property(e => e.Descripcion).HasMaxLength(400); entity.Property(e => e.Titulo).HasMaxLength(60); entity.Property(e => e.idTipoHerramienta).HasColumnType("int(11)"); - - entity.HasOne(d => d.idTipoHerramientaNavigation).WithMany(p => p.puntosinformacion) - .HasForeignKey(d => d.idTipoHerramienta) - .HasConstraintName("FK_enumeraciones_idEnumeracion"); }); modelBuilder.Entity(entity => diff --git a/bdHerramientaCACOA/efpt.config.json b/bdHerramientaCACOA/efpt.config.json index 851a7f3..5650140 100644 --- a/bdHerramientaCACOA/efpt.config.json +++ b/bdHerramientaCACOA/efpt.config.json @@ -43,6 +43,10 @@ "Name": "enumeraciones", "ObjectType": 0 }, + { + "Name": "estadisticas", + "ObjectType": 0 + }, { "Name": "factorescorreccion", "ObjectType": 0