Acabado excel, queda la parte de cofiguracion
This commit is contained in:
@@ -0,0 +1,595 @@
|
||||
@page "/Estadisticas"
|
||||
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@using Microsoft.AspNetCore.WebUtilities
|
||||
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using bdHerramientaCACOA.db
|
||||
@rendermode InteractiveServer
|
||||
@inject IJSRuntime JS
|
||||
|
||||
@using ClosedXML.Excel
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
|
||||
<div class="row" style="justify-content:space-between">
|
||||
<div class="form-group mt-4 col-6">
|
||||
<label>Fecha inicio:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaInicio"
|
||||
ValueChanged="OnFechaInicioChanged"
|
||||
ValueExpression="@(() => fechaInicio)" />
|
||||
|
||||
<label>Fecha final:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaFinal"
|
||||
ValueChanged="OnFechaFinalChanged"
|
||||
ValueExpression="@(() => fechaFinal)" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-2">
|
||||
@if (!string.IsNullOrEmpty(mensajeError))
|
||||
{
|
||||
<label class="text-danger fw-semibold">
|
||||
@mensajeError
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
|
||||
<button @onclick="generarExcel" class="btnBlue" style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Generar Excel</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container-fluid pt-3">
|
||||
|
||||
|
||||
|
||||
<Tabs>
|
||||
<Tab Title="Estadisticas Herramienta CASA" Active>
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Estadisticas Licitación CASA">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Estadisticas Herramienta URBAN">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoHerramientaEstadisticaUrban { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticasusos> listadoHerramientaEstadisticaUsos { get; set; } = new List<estadisticasusos>();
|
||||
public List<estadisticasfactores> listadoHerramientaEstadisticaFactores { get; set; } = new List<estadisticasfactores>();
|
||||
|
||||
public DateTime? fechaInicio { get; set; } = null;
|
||||
public DateTime? fechaFinal { get; set; } = null;
|
||||
|
||||
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private string mensajeError = "";
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
private async Task OnFechaInicioChanged(DateTime? value)
|
||||
{
|
||||
fechaInicio = value;
|
||||
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
mensajeError = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inicializarListado();
|
||||
mensajeError = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public bool IsVisible(bdHerramientaCACOA.db.estadisticas listado)
|
||||
{
|
||||
DateTime? ultimaFecha;
|
||||
if (listado.idSimulacionNavigation.FechaModificacion != null)
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaModificacion;
|
||||
}
|
||||
else
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaCreacion;
|
||||
}
|
||||
|
||||
if (fechaFinal != null && listado.idSimulacionNavigation.FechaCreacion.Date >= fechaInicio?.Date && ultimaFecha?.Date <= fechaFinal?.Date)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private async Task OnFechaFinalChanged(DateTime? value)
|
||||
{
|
||||
fechaFinal = value;
|
||||
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
mensajeError = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inicializarListado();
|
||||
mensajeError = "";
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task generarExcel()
|
||||
{
|
||||
try
|
||||
{
|
||||
bool fechaValida = false;
|
||||
|
||||
string nombreExcel = "";
|
||||
|
||||
|
||||
if ((fechaInicio == null && fechaFinal == null) || (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal) && UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal)))
|
||||
{
|
||||
fechaValida = true;
|
||||
}
|
||||
|
||||
if (fechaValida)
|
||||
{
|
||||
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
nombreExcel = "Simulaciones_" + (fechaInicio ?? DateTime.Now).Date.ToString() + (fechaFinal ?? DateTime.Now).Date.ToString() + ".xlsx";
|
||||
}
|
||||
else
|
||||
{
|
||||
nombreExcel = "SimulacionesTotales_" + DateTime.Now.ToString() + ".xlsx";
|
||||
}
|
||||
var wb = new XLWorkbook();
|
||||
wb.Properties.Author = "Tecnosis";
|
||||
wb.Properties.Title = "Datos entre fechas";
|
||||
wb.Properties.Subject = "";
|
||||
|
||||
var ws = wb.Worksheets.Add("Total datos");
|
||||
|
||||
// Generar tabla HERRAMIENTA/LICITACION CASA
|
||||
var tablaPrincipal = generarTablaPrincipal(ws);
|
||||
|
||||
int filaSiguiente = tablaPrincipal.RangeAddress.LastAddress.RowNumber + 5;
|
||||
|
||||
// GENERAR TABLA USOS
|
||||
int ultimaFilaUso = generarTablaUsos(bd, ws, filaSiguiente);
|
||||
ultimaFilaUso = ultimaFilaUso + 5;
|
||||
|
||||
// GENERAR TABLA FACTORES
|
||||
int ultimaFilaFactor = generarTablaFactores(bd, ws, ultimaFilaUso);
|
||||
ultimaFilaFactor = ultimaFilaFactor + 5;
|
||||
|
||||
// GENERAR TABLA HERRAMIENTA/LICITACION URBAN
|
||||
generarTablaUrban(bd, ws, ultimaFilaFactor);
|
||||
|
||||
using var ms = new MemoryStream();
|
||||
wb.SaveAs(ms);
|
||||
var bytes = ms.ToArray();
|
||||
|
||||
await JS.InvokeVoidAsync("descargarExcel", nombreExcel, Convert.ToBase64String(bytes));
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Descarga completada.",
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Warning,
|
||||
Message = $"Fechas incorrectas.",
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Danger,
|
||||
Message = $"Error al generar el excel.",
|
||||
});
|
||||
throw new Exception("Ocurrió un error en la descarga del excel -> " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private IXLTable? generarTablaPrincipal(IXLWorksheet? ws)
|
||||
{
|
||||
var datos = UtilidadesCASA.rellenarListadoCASA(listadoHerramientaEstadistica);
|
||||
|
||||
// INTRODUCIR DATOS PARA LA TABLA
|
||||
var table = ws.Cell("B4").InsertTable(datos);
|
||||
|
||||
// OBTENER TAMAÑO DE LA TABLA
|
||||
var firstCol = table.RangeAddress.FirstAddress.ColumnNumber;
|
||||
var lastCol = table.RangeAddress.LastAddress.ColumnNumber;
|
||||
var firstRow = table.RangeAddress.FirstAddress.RowNumber;
|
||||
var lastRow = table.RangeAddress.LastAddress.RowNumber;
|
||||
|
||||
// AUMENTAMOS EL TAMAÑO DEL HEADER UN POCO
|
||||
int filaHeader = table.HeadersRow().RowNumber();
|
||||
ws.Row(filaHeader).Height += 20;
|
||||
|
||||
// OBTENER PRIMERA FILA DE LA TABLA PARA PONER EL TITULO ARRIBA
|
||||
int filaTabla = table.FirstRow().RowNumber();
|
||||
|
||||
// PONER EL TITULO EN LA FILA DE ARRIBA
|
||||
int filaTitulo = filaTabla - 1;
|
||||
|
||||
// SE ESCRIBE EL TITULO
|
||||
ws.Cell(filaTitulo, 2).Value = "Herramienta CASA / Licitacion CASA";
|
||||
|
||||
// SE UNE LAS COLUMNAS
|
||||
ws.Range(filaTitulo, 2, filaTitulo, table.ColumnCount()).Merge();
|
||||
|
||||
// SE LE PONE UN FORMATO
|
||||
var rangoTitulo = ws.Range(filaTitulo, 2, filaTitulo, table.ColumnCount());
|
||||
rangoTitulo.Merge();
|
||||
rangoTitulo.Style.Font.Bold = true;
|
||||
rangoTitulo.Style.Font.FontSize = 14;
|
||||
rangoTitulo.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Row(filaTitulo).Height = 25;
|
||||
|
||||
|
||||
// LE PONEMOS FORMATO AL HEADER
|
||||
var headerRange = ws.Range(filaHeader, firstCol, filaHeader, lastCol);
|
||||
headerRange.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
headerRange.Style.Font.Bold = true;
|
||||
headerRange.Style.Font.FontColor = XLColor.White;
|
||||
headerRange.Style.Fill.BackgroundColor = XLColor.FromHtml("#156082");
|
||||
|
||||
// CENTRAR LOS DATOS
|
||||
var dataRange = ws.Range(firstRow, firstCol, lastRow, lastCol);
|
||||
dataRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
|
||||
// AJUSTAMOS LA TABLA
|
||||
ws.Columns(firstCol, lastCol).AdjustToContents();
|
||||
|
||||
// SE PONE EL TITULO DE LOS HEADERS
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.idSimulacion)).Name = "Id Simulación";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.numeroTrabajadores)).Name = "Total trabajadores";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.costeAnualTotal)).Name = "Coste anual total";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.horasProduccion)).Name = "Horas de producción";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.costesDirectos)).Name = "Costes directos";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.costesIndirectos)).Name = "Coste indirectos";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.costesVariables)).Name = "Coste variables";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.costeDespacho)).Name = "Coste despacho";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.totalSuperficie)).Name = "Total superficie";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.porcentajeFases)).Name = "% fases";
|
||||
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.horasDocumentacion)).Name = "Horas documentación";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.horasDireccionObra)).Name = "Horas dirección obra";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.horasTrabajo)).Name = "Horas trabajo";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.porcentajeExternalizacion)).Name = "% external.";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.plazoPresentacion)).Name = "Plazo presentación";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.costeProduccion)).Name = "Coste de producción";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.beneficio)).Name = "Beneficio";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.precioTrabajo)).Name = "Precio trabajo";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.totalOtrosTrabajos)).Name = "Total otros trabajos";
|
||||
table.Field(nameof(EstadistiaHerraCasaVM.precioEncargo)).Name = "Precio encargo";
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
private int generarTablaUsos(tsHerramientasCACOA bd, IXLWorksheet ws, int filaValida)
|
||||
{
|
||||
var listaUsos = UtilidadesCASA.rellenarListadoUsos(bd, listadoHerramientaEstadisticaUsos);
|
||||
|
||||
// SE AGRUPA POR IDSIMULACION PARA SEPARAR LOS DATOS POR SIMULACION
|
||||
var simulacion = listaUsos.GroupBy(x => x.idSimulacion);
|
||||
|
||||
int fila = filaValida;
|
||||
|
||||
ws.Cell(fila, 2).Value = "Id Simulación";
|
||||
ws.Cell(fila, 3).Value = "Superficie";
|
||||
ws.Cell(fila, 4).Value = "Uso";
|
||||
ws.Cell(fila, 5).Value = "Tipología";
|
||||
ws.Cell(fila, 6).Value = "Intervención";
|
||||
|
||||
|
||||
// SE PONE EL FORMATO DEL HEADER
|
||||
var headerRange = ws.Range(fila, 2, fila, 6);
|
||||
|
||||
headerRange.Style.Fill.BackgroundColor = XLColor.FromHtml("#156082");
|
||||
headerRange.Style.Font.Bold = true;
|
||||
headerRange.Style.Font.FontColor = XLColor.White;
|
||||
|
||||
headerRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
headerRange.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
|
||||
ws.Row(fila).Height += 20;
|
||||
|
||||
|
||||
|
||||
// SE PONE EL TITULO ARRIBA DE LA TABLA
|
||||
int filaTitulo = filaValida - 1;
|
||||
|
||||
ws.Cell(filaTitulo, 2).Value = "Usos";
|
||||
var rangoTitulo = ws.Range(filaTitulo, 2, filaTitulo, 6);
|
||||
rangoTitulo.Merge();
|
||||
rangoTitulo.Style.Font.Bold = true;
|
||||
rangoTitulo.Style.Font.FontSize = 14;
|
||||
rangoTitulo.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Row(filaTitulo).Height = 25;
|
||||
|
||||
|
||||
fila++;
|
||||
|
||||
// SE CREA LA TABLA RECORRIENDO EL LISTADO
|
||||
foreach (var grupo in simulacion)
|
||||
{
|
||||
// SE PONE CADA COLUMNA
|
||||
foreach (var item in grupo)
|
||||
{
|
||||
ws.Cell(fila, 2).Value = item.idSimulacion;
|
||||
ws.Cell(fila, 3).Value = item.superficie;
|
||||
ws.Cell(fila, 4).Value = item.uso;
|
||||
ws.Cell(fila, 5).Value = item.tipologia;
|
||||
ws.Cell(fila, 6).Value = item.intervencion;
|
||||
|
||||
// SE CENTRA LOS DATOS
|
||||
ws.Range(fila, 2, fila, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Range(fila, 2, fila, 6).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
|
||||
fila++;
|
||||
}
|
||||
|
||||
// FILA DE TOTALES POR CADA SIMULACION
|
||||
ws.Cell(fila, 2).Value = $"Total superficie de simulación: {grupo.Key}";
|
||||
|
||||
// SE SUMA EL TOTAL DE SUPERFICIE Y SE PONE UN FORMATO
|
||||
ws.Cell(fila, 3).Value = grupo.Sum(x=> x.superficie);
|
||||
ws.Range(fila, 2, fila, 6).Style.Font.Bold = true;
|
||||
ws.Range(fila, 2, fila, 6).Style.Fill.BackgroundColor = XLColor.LightGray;
|
||||
|
||||
fila++;
|
||||
}
|
||||
|
||||
// AJSUTAR COLUMNAS
|
||||
ws.Columns().AdjustToContents();
|
||||
|
||||
return fila;
|
||||
}
|
||||
|
||||
private int generarTablaFactores(tsHerramientasCACOA bd, IXLWorksheet ws, int filaValida)
|
||||
{
|
||||
var listaUsos = UtilidadesCASA.rellenarListadoFactores(bd, listadoHerramientaEstadisticaFactores);
|
||||
|
||||
// SE AGRUPA POR EL IDSIMULACION PARA DIVIDIR POR SIMULACION
|
||||
var simulacion = listaUsos.GroupBy(x => x.idSimulacion);
|
||||
|
||||
int fila = filaValida;
|
||||
|
||||
ws.Cell(fila, 2).Value = "Id Simulación";
|
||||
ws.Cell(fila, 3).Value = "Nombre";
|
||||
ws.Cell(fila, 4).Value = "Coeficiente";
|
||||
ws.Cell(fila, 5).Value = "Tipo";
|
||||
|
||||
|
||||
// SE PONE UN FORMATO PARA EL HEADER
|
||||
var headerRange = ws.Range(fila, 2, fila, 5);
|
||||
|
||||
headerRange.Style.Fill.BackgroundColor = XLColor.FromHtml("#156082");
|
||||
headerRange.Style.Font.Bold = true;
|
||||
headerRange.Style.Font.FontColor = XLColor.White;
|
||||
|
||||
headerRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
headerRange.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
|
||||
ws.Row(fila).Height += 20;
|
||||
|
||||
|
||||
// SE PONE EL TITULO
|
||||
|
||||
int filaTitulo = filaValida - 1;
|
||||
|
||||
ws.Cell(filaTitulo, 2).Value = "Factores";
|
||||
var rangoTitulo = ws.Range(filaTitulo, 2, filaTitulo, 5);
|
||||
rangoTitulo.Merge();
|
||||
rangoTitulo.Style.Font.Bold = true;
|
||||
rangoTitulo.Style.Font.FontSize = 14;
|
||||
rangoTitulo.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Row(filaTitulo).Height = 25;
|
||||
|
||||
fila++;
|
||||
|
||||
// RECORREMOS EL LISTADO
|
||||
foreach (var grupo in simulacion)
|
||||
{
|
||||
// SE AGREGA LAS COLUMNAS
|
||||
foreach (var item in grupo)
|
||||
{
|
||||
ws.Cell(fila, 2).Value = item.idSimulacion;
|
||||
ws.Cell(fila, 3).Value = item.nombre;
|
||||
ws.Cell(fila, 4).Value = item.coeficiente;
|
||||
ws.Cell(fila, 5).Value = item.tipo;
|
||||
|
||||
ws.Range(fila, 2, fila, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Range(fila, 2, fila, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
|
||||
fila++;
|
||||
}
|
||||
|
||||
// FILA TOTAL PARA DIVIDIR
|
||||
ws.Cell(fila, 2).Value = $"";
|
||||
ws.Range(fila, 2, fila, 5).Style.Font.Bold = true;
|
||||
ws.Range(fila, 2, fila, 5).Style.Fill.BackgroundColor = XLColor.LightGray;
|
||||
|
||||
fila++;
|
||||
}
|
||||
|
||||
// AJUSTAMOS COLUMNAS
|
||||
ws.Columns().AdjustToContents();
|
||||
|
||||
return fila;
|
||||
}
|
||||
|
||||
private IXLTable? generarTablaUrban(tsHerramientasCACOA bd, IXLWorksheet? ws, int filaValida)
|
||||
{
|
||||
|
||||
var datos = UtilidadesCASA.rellenarListadoURBAN(bd,listadoHerramientaEstadisticaUrban);
|
||||
|
||||
// AGREGAMOS LA TABLA
|
||||
var table = ws.Cell(filaValida, 2).InsertTable(datos);
|
||||
|
||||
// SE OBTIENE LAS DIMENSIONES DE LA TABLA
|
||||
var firstCol = table.RangeAddress.FirstAddress.ColumnNumber;
|
||||
var lastCol = table.RangeAddress.LastAddress.ColumnNumber;
|
||||
var firstRow = table.RangeAddress.FirstAddress.RowNumber;
|
||||
var lastRow = table.RangeAddress.LastAddress.RowNumber;
|
||||
|
||||
// SE AGREGA MAS ALTURA AL HEADER
|
||||
int filaHeader = table.HeadersRow().RowNumber();
|
||||
ws.Row(filaHeader).Height += 20;
|
||||
|
||||
|
||||
// OBTENEMOS LA PRIMERA FILA DE LA TABLA PARA PONER EL TITULO
|
||||
int filaTabla = table.FirstRow().RowNumber();
|
||||
|
||||
int filaTitulo = filaTabla - 1;
|
||||
|
||||
// SE PONE EL TITULO Y SE CREA EL FORMATO
|
||||
ws.Cell(filaTitulo, 2).Value = "Herramienta URBAN / Licitacion URBAN";
|
||||
|
||||
ws.Range(filaTitulo, 2, filaTitulo, table.ColumnCount()).Merge();
|
||||
|
||||
var rangoTitulo = ws.Range(filaTitulo, 2, filaTitulo, table.ColumnCount());
|
||||
rangoTitulo.Merge();
|
||||
rangoTitulo.Style.Font.Bold = true;
|
||||
rangoTitulo.Style.Font.FontSize = 14;
|
||||
rangoTitulo.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Row(filaTitulo).Height = 25;
|
||||
|
||||
|
||||
// PONEMOS EL DISEÑO DEL HEADER
|
||||
var headerRange = ws.Range(filaHeader, firstCol, filaHeader, lastCol);
|
||||
headerRange.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
headerRange.Style.Font.Bold = true;
|
||||
headerRange.Style.Font.FontColor = XLColor.White;
|
||||
headerRange.Style.Fill.BackgroundColor = XLColor.FromHtml("#e97132");
|
||||
|
||||
// CENTRAMOS LOS DATOS
|
||||
var dataRange = ws.Range(firstRow, firstCol, lastRow, lastCol);
|
||||
dataRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
|
||||
// AJUSTAMOS LAS COLUMNAS
|
||||
ws.Columns(firstCol, lastCol).AdjustToContents();
|
||||
|
||||
// SE PONE EL NOMBRE AL HEADER
|
||||
table.Field(nameof(EstadisticasUrbanVM.idSimulacion)).Name = "Id Simulación";
|
||||
table.Field(nameof(EstadisticasUrbanVM.numeroTrabajadores)).Name = "Total trabajadores";
|
||||
table.Field(nameof(EstadisticasUrbanVM.costeAnualTotal)).Name = "Coste anual total";
|
||||
table.Field(nameof(EstadisticasUrbanVM.horasProduccion)).Name = "Horas de producción";
|
||||
table.Field(nameof(EstadisticasUrbanVM.costesDirectos)).Name = "Costes directos";
|
||||
table.Field(nameof(EstadisticasUrbanVM.costesIndirectos)).Name = "Coste indirectos";
|
||||
table.Field(nameof(EstadisticasUrbanVM.costesVariables)).Name = "Coste variables";
|
||||
table.Field(nameof(EstadisticasUrbanVM.costeDespacho)).Name = "Coste despacho";
|
||||
table.Field(nameof(EstadisticasUrbanVM.tipoDocumento)).Name = "Tipo de documento";
|
||||
table.Field(nameof(EstadisticasUrbanVM.documento)).Name = "Documento";
|
||||
table.Field(nameof(EstadisticasUrbanVM.dato1)).Name = "Dato 1";
|
||||
table.Field(nameof(EstadisticasUrbanVM.dato2)).Name = "Dato 2";
|
||||
table.Field(nameof(EstadisticasUrbanVM.dato3)).Name = "Dato 3";
|
||||
table.Field(nameof(EstadisticasUrbanVM.porcentajeFases)).Name = "Fases";
|
||||
table.Field(nameof(EstadisticasUrbanVM.innovacion)).Name = "Innovación";
|
||||
table.Field(nameof(EstadisticasUrbanVM.horasTrabajo)).Name = "Horas trabajo";
|
||||
table.Field(nameof(EstadisticasUrbanVM.porcentajeExternalizacion)).Name = "% external.";
|
||||
table.Field(nameof(EstadisticasUrbanVM.costeExternalizacion)).Name = "Coste externalización";
|
||||
table.Field(nameof(EstadisticasUrbanVM.plazoPresentacion)).Name = "Plazo presentación";
|
||||
table.Field(nameof(EstadisticasUrbanVM.costeProduccion)).Name = "Coste de producción";
|
||||
table.Field(nameof(EstadisticasUrbanVM.beneficio)).Name = "Beneficio";
|
||||
table.Field(nameof(EstadisticasUrbanVM.precioTrabajo)).Name = "Precio trabajo";
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
|
||||
if (fechaInicio == null)
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 31 || x.idSimulacionNavigation.idTipoSimulacion == 32).ToList();
|
||||
listadoHerramientaEstadisticaUrban = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 34 || x.idSimulacionNavigation.idTipoSimulacion == 35).ToList();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var listadoPorTipoCASA = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 31 || x.idSimulacionNavigation.idTipoSimulacion == 32).ToList();
|
||||
|
||||
listadoHerramientaEstadistica = listadoPorTipoCASA.Where(x => (x.idSimulacionNavigation.FechaCreacion >= fechaInicio) && (x.idSimulacionNavigation.FechaModificacion ?? x.idSimulacionNavigation.FechaCreacion).Date <= fechaFinal).ToList();
|
||||
|
||||
var listadoPorTipoURBAN = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 34 || x.idSimulacionNavigation.idTipoSimulacion == 35).ToList();
|
||||
|
||||
listadoHerramientaEstadisticaUrban = listadoPorTipoURBAN.Where(x => (x.idSimulacionNavigation.FechaCreacion >= fechaInicio) && (x.idSimulacionNavigation.FechaModificacion ?? x.idSimulacionNavigation.FechaCreacion).Date <= fechaFinal).ToList();
|
||||
|
||||
}
|
||||
|
||||
listadoHerramientaEstadisticaUsos = bd.estadisticasusos.AsEnumerable().Where(x => listadoHerramientaEstadistica.Any(y => y.idSimulacion == x.idSimulacion)).ToList();
|
||||
|
||||
|
||||
listadoHerramientaEstadisticaFactores = bd.estadisticasfactores.AsEnumerable().Where(x => listadoHerramientaEstadistica.Any(y => y.idSimulacion == x.idsimulacion)).ToList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using ClosedXML.Excel
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<div>
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
<div class="mt-2" style="padding:50px;">
|
||||
<div class="mb-4">
|
||||
<label class="fw-bold">Total simulaciones herramienta CASA: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes directos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesDirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes indirectos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesIndirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes variables:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesVariables.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste hora despacho profesional:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas documentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasDocumentacion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas dirección obra:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasDireccionObra.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas TPE:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total otros trabajos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalOtrosTrabajos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.beneficio.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total número trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mt-5">
|
||||
<label class="tituloLbl">No hay datos entre esas fechas.</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<Grid TItem="estadisticas"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoHerramientaEstadistica"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes directos">
|
||||
<span>@context.costeDirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" Class="text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Total costes indirectos">
|
||||
<span>@context.costeIndirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes Variables">
|
||||
<span>@context.costeVariable</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total coste hora despacho profesional">
|
||||
<span>@context.costeHoraDespachoProf</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total superficie">
|
||||
<span></span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total fases">
|
||||
<span>@context.totalFases</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas documentación">
|
||||
<span>@context.horasTPEDocumentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas dirección de obra">
|
||||
<span>@context.horasTPEDireccionObra</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas trabajo profesional">
|
||||
<span>@context.horasTPE</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total plazos">
|
||||
<span>@context.plazoPresentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes de producción">
|
||||
<span>@context.costeProduccion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total otros trabajos">
|
||||
<span>@context.totalOtrosTrabajos</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje beneficio">
|
||||
<span>@context.porcentajeBeneficio</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total número trabajadores">
|
||||
<span>@context.numeroTrabajadores</span>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoHerramientaEstadisticaAux { get; set; } = new List<estadisticas>();
|
||||
|
||||
public DateTime? fechaInicio { get; set; } = null;
|
||||
public DateTime? fechaFinal { get; set; } = null;
|
||||
|
||||
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private string mensajeError = "";
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costesDirectos =UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeDirecto),totalProyectosTipo);
|
||||
estadisticasTotales.costesIndirectos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeIndirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costesVariables = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeVariable), totalProyectosTipo);
|
||||
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.horasDocumentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPEDocumentacion), totalProyectosTipo);
|
||||
estadisticasTotales.horasDireccionObra = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPEDireccionObra), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
||||
estadisticasTotales.beneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
}
|
||||
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 31).ToList();
|
||||
listadoHerramientaEstadisticaAux = listadoHerramientaEstadistica;
|
||||
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<div>
|
||||
|
||||
<div class="row" style="justify-content:space-between">
|
||||
<div class="form-group mt-4 col-6">
|
||||
<label>Fecha inicio:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaInicio"
|
||||
ValueChanged="OnFechaInicioChanged"
|
||||
ValueExpression="@(() => fechaInicio)" />
|
||||
|
||||
<label>Fecha final:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaFinal"
|
||||
ValueChanged="OnFechaFinalChanged"
|
||||
ValueExpression="@(() => fechaFinal)" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
@if (!string.IsNullOrEmpty(mensajeError))
|
||||
{
|
||||
<label class="text-danger fw-semibold">
|
||||
@mensajeError
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
<div class="mt-5" style="padding:50px;">
|
||||
<div class="mb-4">
|
||||
<label class="fw-bold">Total simulaciones herramienta URBAN: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes directos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDirecto.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes indirectos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeIndirecto.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes variables:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeVariable.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste hora despacho profesional:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeHoraDespachoProf.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas documentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPEDocumentacion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas dirección obra:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPEDireccionObra.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas TPE:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPE.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total otros trabajos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalOtrosTrabajos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeBeneficio.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total número trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mt-5">
|
||||
<label class="tituloLbl">No hay datos entre esas fechas.</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<Grid TItem="estadisticas"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoHerramientaEstadistica"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes directos">
|
||||
<span>@context.costeDirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" Class="text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Total costes indirectos">
|
||||
<span>@context.costeIndirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes Variables">
|
||||
<span>@context.costeVariable</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total coste hora despacho profesional">
|
||||
<span>@context.costeHoraDespachoProf</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total superficie">
|
||||
<span></span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total fases">
|
||||
<span>@context.totalFases</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas documentación">
|
||||
<span>@context.horasTPEDocumentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas dirección de obra">
|
||||
<span>@context.horasTPEDireccionObra</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas trabajo profesional">
|
||||
<span>@context.horasTPE</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total plazos">
|
||||
<span>@context.plazoPresentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes de producción">
|
||||
<span>@context.costeProduccion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total otros trabajos">
|
||||
<span>@context.totalOtrosTrabajos</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje beneficio">
|
||||
<span>@context.porcentajeBeneficio</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total número trabajadores">
|
||||
<span>@context.numeroTrabajadores</span>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoHerramientaEstadisticaAux { get; set; } = new List<estadisticas>();
|
||||
|
||||
public DateTime? fechaInicio { get; set; } = null;
|
||||
public DateTime? fechaFinal { get; set; } = null;
|
||||
|
||||
public estadisticas estadisticasTotales = new estadisticas();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private string mensajeError = "";
|
||||
|
||||
private async Task OnFechaInicioChanged(DateTime? value)
|
||||
{
|
||||
fechaInicio = value;
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnFechaFinalChanged(DateTime? value)
|
||||
{
|
||||
fechaFinal = value;
|
||||
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
|
||||
private void AplicarFiltros()
|
||||
{
|
||||
// Filtra la lista en función de los criterios ingresados
|
||||
listadoHerramientaEstadistica = new List<bdHerramientaCACOA.db.estadisticas>();
|
||||
foreach (bdHerramientaCACOA.db.estadisticas item in listadoHerramientaEstadisticaAux)
|
||||
{
|
||||
if (IsVisible(item) == true)
|
||||
{
|
||||
listadoHerramientaEstadistica.Add(item);
|
||||
}
|
||||
}
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
}
|
||||
|
||||
public bool IsVisible(bdHerramientaCACOA.db.estadisticas listado)
|
||||
{
|
||||
DateTime? ultimaFecha;
|
||||
if (listado.idSimulacionNavigation.FechaModificacion != null)
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaModificacion;
|
||||
}
|
||||
else
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaCreacion;
|
||||
}
|
||||
|
||||
if (fechaFinal != null && listado.idSimulacionNavigation.FechaCreacion.Date >= fechaInicio?.Date && ultimaFecha?.Date <= fechaFinal?.Date)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costeDirecto = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeDirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costeIndirecto = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeIndirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costeVariable = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeVariable), totalProyectosTipo);
|
||||
estadisticasTotales.costeHoraDespachoProf = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
|
||||
estadisticasTotales.horasTPE = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeBeneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
}
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 34).ToList();
|
||||
listadoHerramientaEstadisticaAux = listadoHerramientaEstadistica;
|
||||
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<div>
|
||||
|
||||
<div class="row" style="justify-content:space-between">
|
||||
<div class="form-group mt-4 col-6">
|
||||
<label>Fecha inicio:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaInicio"
|
||||
ValueChanged="OnFechaInicioChanged"
|
||||
ValueExpression="@(() => fechaInicio)" />
|
||||
|
||||
<label>Fecha final:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaFinal"
|
||||
ValueChanged="OnFechaFinalChanged"
|
||||
ValueExpression="@(() => fechaFinal)" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
@if (!string.IsNullOrEmpty(mensajeError))
|
||||
{
|
||||
<label class="text-danger fw-semibold">
|
||||
@mensajeError
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
|
||||
<div class="mt-5" style="padding:50px;">
|
||||
<div class="mb-4">
|
||||
<label class="fw-bold">Total simulaciones licitación CASA: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste hora despacho profesional:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeHoraDespachoProf.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas TPE:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPE.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total otros trabajos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalOtrosTrabajos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mt-5">
|
||||
<label class="tituloLbl">No hay datos entre esas fechas.</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<Grid TItem="estadisticas"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoHerramientaEstadistica"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total coste hora despacho profesional">
|
||||
<span>@context.costeHoraDespachoProf</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total fases">
|
||||
<span>@context.totalFases</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas trabajo profesional">
|
||||
<span>@context.horasTPE</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total plazos">
|
||||
<span>@context.plazoPresentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes de producción">
|
||||
<span>@context.costeProduccion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total otros trabajos">
|
||||
<span>@context.totalOtrosTrabajos</span>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoHerramientaEstadisticaAux { get; set; } = new List<estadisticas>();
|
||||
|
||||
|
||||
public DateTime? fechaInicio { get; set; } = null;
|
||||
public DateTime? fechaFinal { get; set; } = null;
|
||||
|
||||
public estadisticas estadisticasTotales = new estadisticas();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private string mensajeError = "";
|
||||
|
||||
private async Task OnFechaInicioChanged(DateTime? value)
|
||||
{
|
||||
fechaInicio = value;
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnFechaFinalChanged(DateTime? value)
|
||||
{
|
||||
fechaFinal = value;
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
|
||||
private void AplicarFiltros()
|
||||
{
|
||||
// Filtra la lista en función de los criterios ingresados
|
||||
listadoHerramientaEstadistica = new List<bdHerramientaCACOA.db.estadisticas>();
|
||||
foreach (bdHerramientaCACOA.db.estadisticas item in listadoHerramientaEstadisticaAux)
|
||||
{
|
||||
if (IsVisible(item) == true)
|
||||
{
|
||||
listadoHerramientaEstadistica.Add(item);
|
||||
}
|
||||
}
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
}
|
||||
|
||||
public bool IsVisible(bdHerramientaCACOA.db.estadisticas listado)
|
||||
{
|
||||
DateTime? ultimaFecha;
|
||||
if (listado.idSimulacionNavigation.FechaModificacion != null)
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaModificacion;
|
||||
}
|
||||
else
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaCreacion;
|
||||
}
|
||||
|
||||
if (fechaFinal != null && listado.idSimulacionNavigation.FechaCreacion.Date >= fechaInicio?.Date && ultimaFecha?.Date <= fechaFinal?.Date)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costeHoraDespachoProf = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.totalFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.horasTPE = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
||||
}
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 32).ToList();
|
||||
listadoHerramientaEstadisticaAux = listadoHerramientaEstadistica;
|
||||
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex align-items-center justify-content-center colorEMenu dive">
|
||||
<div class="col-6 d-flex align-items-center justify-content-center colorEMenu dive">
|
||||
<a href="PuntosInfo">
|
||||
<div>
|
||||
<h4 class="text-center">Puntos de información</h4>
|
||||
@@ -76,6 +76,14 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-6 d-flex align-items-center justify-content-center colorAMenu dive">
|
||||
<a href="Estadisticas">
|
||||
<div>
|
||||
<h4 class="text-center">Estadisticas</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user