Compare commits
75 Commits
8fd4c26c06
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8255115560 | |||
| 6349a50151 | |||
| 702c097c32 | |||
| 71a7f453ee | |||
| 61e55497e3 | |||
| fe101a5554 | |||
| f740b95a1c | |||
| 6abb41f398 | |||
| f670b16eb6 | |||
| e5ff734014 | |||
| a285563f6c | |||
| c17d8c4cc8 | |||
| 9d78928892 | |||
| bb393c803d | |||
| a983f7f45e | |||
| 317c8c1112 | |||
| 36b5b4c30c | |||
| 8f7b606be0 | |||
| e1d6e4d7c3 | |||
| 5f655b6f37 | |||
| 41d201c3aa | |||
| ae43080975 | |||
| ca50f76e02 | |||
| b5efdb3e9c | |||
| 454e4a317c | |||
| 7f33a1ddd8 | |||
| bc74e0c376 | |||
| ddfe628977 | |||
| 46257d0de4 | |||
| 09b451624a | |||
| a2dbe693ce | |||
| 31de59ed81 | |||
| 9a562b3373 | |||
| 4b864df8a0 | |||
| 4a98c36b1a | |||
| 0706572833 | |||
| 4d11042fb1 | |||
| c9d929c57d | |||
| d80d2e2dc8 | |||
| 029498c540 | |||
| 692d880529 | |||
| 8a329314d9 | |||
| c1cc98993f | |||
| 08f9560b11 | |||
| 2c22dbbbc1 | |||
| bab4e591a1 | |||
| be2f55153a | |||
| bb5fa8658d | |||
| 70dbd2d3f6 | |||
| 8f6352b70e | |||
| 666ea2caad | |||
| 9e4c01309b | |||
| 1a8813c65b | |||
| bba6d0a741 | |||
| a6b7d1551e | |||
| a3a771108e | |||
| 74a7bbbe62 | |||
| c02530587a | |||
| f4559362a3 | |||
| 0423f4bf11 | |||
| 620ee3b432 | |||
| de86f47388 | |||
| 3dffad97e0 | |||
| 3671c8329a | |||
| 108c157beb | |||
| 43a042e173 | |||
| d906dee081 | |||
| bb39218a5f | |||
| 29f7847950 | |||
| 6a9bf44e3d | |||
| 02ddb77d61 | |||
| 44098efd88 | |||
| d180046348 | |||
| d75634b07e | |||
| 811b8fc0c0 |
23
HerramientaCASA/AssemnlyLoadwkhtmltox.cs
Normal file
23
HerramientaCASA/AssemnlyLoadwkhtmltox.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
|
||||
namespace HerramientaCASA
|
||||
{
|
||||
public class AssemnlyLoadwkhtmltox : AssemblyLoadContext
|
||||
{
|
||||
public IntPtr LoadUnmanagedLibrary(string absolutePath)
|
||||
{
|
||||
return LoadUnmanagedDll(absolutePath);
|
||||
}
|
||||
|
||||
protected override IntPtr LoadUnmanagedDll(string unmanagedDllPath)
|
||||
{
|
||||
return LoadUnmanagedDllFromPath(unmanagedDllPath);
|
||||
}
|
||||
|
||||
protected override Assembly Load(AssemblyName assemblyName)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="_content/Blazor.Bootstrap/blazor.bootstrap.js"></script>
|
||||
<script src="Scripts/Util.js"></script>
|
||||
<script src="_framework/blazor.web.js"></script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
@using BlazorBootstrap;
|
||||
@using HerramientaCASA.Model
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject NavigationManager Navigation
|
||||
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
||||
@inject ProtectedLocalStorage ProtectedLocalStore
|
||||
@inject UserState userState
|
||||
@inject IJSRuntime JS
|
||||
|
||||
|
||||
<head>
|
||||
@@ -12,7 +15,7 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/Blazor.Bootstrap.bundle.scp.css" rel="stylesheet" />
|
||||
<link href="Content/Site.css?v=0.15" rel="stylesheet" />
|
||||
<link href="Content/Site.css?v=0.16" rel="stylesheet" />
|
||||
<link href="Content/all.min.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<script src="Scripts/jquery.min.js"></script>
|
||||
@@ -67,11 +70,20 @@
|
||||
<NavLink class="nav-link" href="ConvenioColectivo">Convenio Colectivo</NavLink>
|
||||
</li>
|
||||
<li id="liMS" class="nav-item">
|
||||
<NavLink class="nav-link" href="DocumentosUrban">Documentos URBAN</NavLink>
|
||||
<NavLink class="nav-link" href="DocumentosUrban">Documentos Urbanismo</NavLink>
|
||||
</li>
|
||||
<li id="liMS" class="nav-item">
|
||||
<NavLink class="nav-link" href="CalculoCDCI">Calculo CD+CI</NavLink>
|
||||
</li>
|
||||
<li id="liMS" class="nav-item">
|
||||
<NavLink class="nav-link" href="PuntosInfo">Puntos de información</NavLink>
|
||||
</li>
|
||||
<li id="liMS" class="nav-item">
|
||||
<NavLink class="nav-link" href="Estadisticas">Estadisticas</NavLink>
|
||||
</li>
|
||||
<li id="liMS" class="nav-item">
|
||||
<NavLink class="nav-link" href="Manuales">Manuales</NavLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ml-auto">
|
||||
@@ -96,14 +108,55 @@
|
||||
@code {
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
// protected override async Task OnInitializedAsync()
|
||||
// {
|
||||
// // Redirigir al home si no hay token y la ruta no es pública
|
||||
// if (userState.idUser == 0)
|
||||
// {
|
||||
// Navigation.NavigateTo("/", true);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
string? urlAnterior = "";
|
||||
|
||||
bool urlVaida = true;
|
||||
string rutaActual = "";
|
||||
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
var obtenerDatoAdmin = await ProtectedLocalStore.GetAsync<bool>("EsAdmin");
|
||||
var obtenerDatoId = await ProtectedLocalStore.GetAsync<int>("idUsuario");
|
||||
// Redirigir al home si no hay token y la ruta no es pública
|
||||
if (obtenerDatoId.Value == 0 || !obtenerDatoAdmin.Value)
|
||||
if (firstRender)
|
||||
{
|
||||
Navigation.NavigateTo("/", true);
|
||||
urlAnterior = await JS.InvokeAsync<string>("eval", "document.referrer");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(urlAnterior))
|
||||
{
|
||||
|
||||
rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri);
|
||||
|
||||
|
||||
if (rutaActual != "Denegado")
|
||||
{
|
||||
if (!urlAnterior.Contains("cacoa.es"))
|
||||
{
|
||||
Navigation.NavigateTo("/Denegado", true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo("/Denegado", true);
|
||||
}
|
||||
|
||||
|
||||
if (userState.idUser == 0)
|
||||
{
|
||||
Navigation.NavigateTo("/", true);
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,32 +3,35 @@
|
||||
@using HerramientaCASA.Model
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@inject UserState UserState
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject NavigationManager Navigation
|
||||
@inject IJSRuntime JS
|
||||
|
||||
|
||||
<head>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/Blazor.Bootstrap.bundle.scp.css" rel="stylesheet" />
|
||||
<link href="Content/Site.css?v=0.4" rel="stylesheet" />
|
||||
<link href="Content/all.min.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<script src="Scripts/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<!-- Add chart.js reference if chart components are used in your application. -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.0.1/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<!-- Add sortable.js reference if SortableList component is used in your application. -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
|
||||
<script src="_content/Blazor.Bootstrap/blazor.bootstrap.js"></script>
|
||||
<script src="Scripts/popper.min.js"></script>
|
||||
<script src="Scripts/all.min.js"></script>
|
||||
<script src="Scripts/Util.js"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/Blazor.Bootstrap.bundle.scp.css" rel="stylesheet" />
|
||||
<link href="Content/Site.css?v=0.62" rel="stylesheet" />
|
||||
<link href="Content/all.min.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<script src="Scripts/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<!-- Add chart.js reference if chart components are used in your application. -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.0.1/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<!-- Add sortable.js reference if SortableList component is used in your application. -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
|
||||
<script src="_content/Blazor.Bootstrap/blazor.bootstrap.js"></script>
|
||||
<script src="Scripts/popper.min.js"></script>
|
||||
<script src="Scripts/all.min.js"></script>
|
||||
<script src="Scripts/Util.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<div class="main">
|
||||
<div class="main" style="position: absolute;width: 100%;top: 0px;">
|
||||
<div class="">
|
||||
@Body
|
||||
</div>
|
||||
@@ -37,4 +40,43 @@
|
||||
|
||||
@code{
|
||||
|
||||
|
||||
string? urlAnterior = "";
|
||||
|
||||
bool urlVaida = true;
|
||||
string rutaActual = "";
|
||||
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
urlAnterior = await JS.InvokeAsync<string>("eval", "document.referrer");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(urlAnterior))
|
||||
{
|
||||
|
||||
rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri);
|
||||
|
||||
|
||||
if (rutaActual != "Denegado")
|
||||
{
|
||||
if (!urlAnterior.Contains("cacoa.es") )
|
||||
{
|
||||
Navigation.NavigateTo("/Denegado", true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo("/Denegado", true);
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
@using HerramientaCASA.Model
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@inherits LayoutComponentBase
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject NavigationManager Navigation
|
||||
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
||||
@inject ProtectedLocalStorage ProtectedLocalStore
|
||||
@inject UserState userState
|
||||
@inject IJSRuntime JS
|
||||
|
||||
|
||||
<head>
|
||||
@@ -12,7 +15,7 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
||||
<link href="_content/Blazor.Bootstrap/Blazor.Bootstrap.bundle.scp.css" rel="stylesheet" />
|
||||
<link href="Content/Site.css?v=0.44" rel="stylesheet" />
|
||||
<link href="Content/Site.css?v=0.64" rel="stylesheet" />
|
||||
<link href="Content/all.min.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<script src="Scripts/jquery.min.js"></script>
|
||||
@@ -31,13 +34,13 @@
|
||||
|
||||
<div class="page">
|
||||
<main style="height: 100%;">
|
||||
<header class="d-none d-md-block">
|
||||
<header class="">
|
||||
<div class="pa-header-t1">
|
||||
<div class="pa-header-row1">
|
||||
<nav class="navbar navbar-expand-lg navbar-light fixed-top bg-light navCACOA">
|
||||
<div class="container-fluid">
|
||||
<div>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#topMenu" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<button class="navbar-toggler" type="button" onclick="cambiar()">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="https://www.cacoa.es/">
|
||||
@@ -48,23 +51,23 @@
|
||||
@if (!MostrarExtra)
|
||||
{
|
||||
<ul class="navbar-nav mr-auto ulMenu">
|
||||
<li id="liPC" class="nav-item">
|
||||
<li id="liPC" class="nav-item" onclick="cambiar()">
|
||||
<NavLink class="nav-link headNav" href="PanelControl"><i class="fa-solid fa-house"></i> Menú</NavLink>
|
||||
</li>
|
||||
<li id="liCC" class="nav-item">
|
||||
<NavLink class="nav-link headNav" href="HerramientaCASASimulaciones">CASA – Edificación</NavLink>
|
||||
<li id="liCC" class="nav-item" onclick="cambiar()">
|
||||
<NavLink class="@IsActive("HerramientaCASASimulaciones", "herramientacasas")" href="HerramientaCASASimulaciones">CASA – Edificación</NavLink>
|
||||
</li>
|
||||
<li id="liCS" class="nav-item">
|
||||
<NavLink class="nav-link headNav" href="LicitacionCASASimulaciones">Licitaciones Edificación</NavLink>
|
||||
<li id="liCS" class="nav-item" onclick="cambiar()">
|
||||
<NavLink class="@IsActive("LicitacionCASASimulaciones", "LicitacionCASA")" href="LicitacionCASASimulaciones">Licitaciones Edificación</NavLink>
|
||||
</li>
|
||||
<li id="liCS" class="nav-item">
|
||||
<NavLink class="nav-link headNav" href="HerramientaURBANSimulaciones">CASA – Urbanismo</NavLink>
|
||||
<li id="liCS" class="nav-item" onclick="cambiar()">
|
||||
<NavLink class="@IsActive("HerramientaURBANSimulaciones", "HerramientaURBAN")" href="HerramientaURBANSimulaciones">CASA – Urbanismo</NavLink>
|
||||
</li>
|
||||
<li id="liCS" class="nav-item">
|
||||
<NavLink class="nav-link headNav" href="LicitacionUrbanSimulaciones">Licitaciones Urbanismo</NavLink>
|
||||
<li id="liCS" class="nav-item" onclick="cambiar()">
|
||||
<NavLink class="@IsActive("LicitacionUrbanSimulaciones", "LicitacionesUrban")" href="LicitacionUrbanSimulaciones">Licitaciones Urbanismo</NavLink>
|
||||
</li>
|
||||
@* <li id="liCB" class="nav-item">
|
||||
<NavLink class="nav-link headNav" href="BajasSimulaciones">Licitaciones Bajas</NavLink>
|
||||
<NavLink class="@IsActive("BajasSimulaciones", "Bajas")" href="BajasSimulaciones">Licitaciones Bajas</NavLink>
|
||||
</li> *@
|
||||
<li id="liMS" class="nav-item">
|
||||
<NavLink class="nav-link headNav" href="MisSimulaciones">Mis Simulaciones</NavLink>
|
||||
@@ -77,6 +80,7 @@
|
||||
<label class="headNav" style="color: #078b98 !important; font-size: large; font-weight: bold;">Costes Asociados a los Servicios de Arquitectura - CASA</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="ml-auto">
|
||||
<ul class="navbar-nav mr-auto ulMenu">
|
||||
@@ -95,20 +99,96 @@
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<script>
|
||||
const navbarCollapse = document.getElementById('topMenu');
|
||||
const bsCollapse = new bootstrap.Collapse(navbarCollapse, {
|
||||
toggle: false // No lo colapsa automáticamente al inicializar
|
||||
});
|
||||
function cambiar(){
|
||||
bsCollapse.toggle()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@code {
|
||||
private bool MostrarExtra => Navigation.Uri.Contains("PanelControl", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
string? urlAnterior = "";
|
||||
|
||||
bool urlVaida = true;
|
||||
string rutaActual = "";
|
||||
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
var obtenerDatoAdmin = await ProtectedLocalStore.GetAsync<bool>("EsAdmin");
|
||||
var obtenerDatoId = await ProtectedLocalStore.GetAsync<int>("idUsuario");
|
||||
// Redirigir al home si no hay token y la ruta no es pública
|
||||
if (obtenerDatoId.Value == 0 || obtenerDatoAdmin.Value)
|
||||
urlAnterior = await JS.InvokeAsync<string>("eval", "document.referrer");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(urlAnterior))
|
||||
{
|
||||
Navigation.NavigateTo("/", true);
|
||||
|
||||
rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri);
|
||||
|
||||
|
||||
if (rutaActual != "Denegado")
|
||||
{
|
||||
if (!urlAnterior.Contains("cacoa.es"))
|
||||
{
|
||||
Navigation.NavigateTo("/Denegado", true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo("/Denegado", true);
|
||||
}
|
||||
|
||||
|
||||
if (userState.idUser == 0 )
|
||||
{
|
||||
Navigation.NavigateTo("/", true);
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
// Redirigir al home si no hay token y la ruta no es pública
|
||||
|
||||
}
|
||||
|
||||
|
||||
private string IsActive(params string[] rutas)
|
||||
{
|
||||
var uri = Navigation.ToBaseRelativePath(Navigation.Uri).ToLower();
|
||||
|
||||
|
||||
return rutas.Any(r => uri == r.ToLower() || uri.Contains(r.ToLower()))
|
||||
? "nav-link headNav active"
|
||||
: "nav-link headNav";
|
||||
}
|
||||
|
||||
|
||||
// protected override void OnAfterRender(bool firstRender)
|
||||
// {
|
||||
// if (firstRender)
|
||||
// {
|
||||
// string? urlAnterior = HttpContextAccessor.HttpContext?.Request.Headers["Referer"].ToString();
|
||||
// string rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri);
|
||||
|
||||
// if (rutaActual != "Denegado")
|
||||
// {
|
||||
// if (string.IsNullOrEmpty(urlAnterior) || urlAnterior.Contains("cacoa.es"))
|
||||
// {
|
||||
// Navigation.NavigateTo("/Denegado", true);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -89,6 +89,8 @@
|
||||
<button @onclick="@(() => abrirPopupGuardar())" class="btnBlue d-flex align-items-center"> <i class="fas fa-save pe-1"></i>@TituloBoton</button>
|
||||
<b class="Fuente2 ps-2 pe-2 nomSim">Nombre de la simulación: </b>
|
||||
<InputText @bind-Value="objetoBaja.Descripcion" class="form-control inputForm formatoMoneda inputTabla " style="text-align:left;font-weight:bold;"></InputText>
|
||||
<button class="btnBlue d-flex align-items-center ms-1" style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Imprimir</button>
|
||||
<button class="btnBlue d-flex align-items-center ms-1" style="background-color: #65b7c3 !important;"> <i class="fas fa-book pe-2"></i>Manual</button>
|
||||
</div>
|
||||
<div class="col-md-6 mt-3 mb-2">
|
||||
<div><b>Convenio Colectivo:</b></div>
|
||||
|
||||
@@ -58,7 +58,27 @@
|
||||
|
||||
<div class="mt-3">
|
||||
<div style="height: 24px;">
|
||||
<b>Otros trabajos incluidos en el Encargo</b>
|
||||
<div class="puntoInfo">
|
||||
@if (_HerramientaCASAPadre != null)
|
||||
{
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 30).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 30).Descripcion)
|
||||
}
|
||||
|
||||
<b>Otros trabajos incluidos en el Encargo </b>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (!string.IsNullOrEmpty(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 36).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 36).Descripcion)
|
||||
}
|
||||
<b>Otros trabajos incluidos en la Licitación </b>
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div style="position:relative;margin-bottom: 15px;">
|
||||
<Grid TItem="CASA.OtrosTrabajos"
|
||||
|
||||
@@ -6,12 +6,38 @@
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<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="factoCompleForm">
|
||||
<DataAnnotationsValidator></DataAnnotationsValidator>
|
||||
<Modal @ref="popupGestionDatos" title="@tituloPopup" IsVerticallyCentered="true" UseStaticBackdrop="true" CloseOnEscape="false">
|
||||
<BodyTemplate>
|
||||
<div class="row">
|
||||
|
||||
@if (nuevoElemento)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Rendimiento:</label>
|
||||
<InputSelect @bind-Value="@idProviItem" class="inputForm">
|
||||
@foreach (var provi in listadoProvincias)
|
||||
{
|
||||
<option value="@provi.CodigoProvincia">@provi.Nombre</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Titulado Superior:</label>
|
||||
<NumberInput Min="0" TValue="double" @bind-Value="itemSeleccionado.valorGradoSup" @oninput="e => ValidarYActualizar(e, nameof(itemSeleccionado.valorGradoSup))" class="inputForm"></NumberInput>
|
||||
@@ -39,9 +65,15 @@
|
||||
</EditForm>
|
||||
|
||||
<div class="container-fluid mt-3">
|
||||
<div class="form-group mt-4">
|
||||
<input class="form-control" type="text" style="width: 400px;" placeholder="Filtrar..."
|
||||
@bind-value="Filter" @bind-value:after="AplicarFiltros" />
|
||||
<div class="row" style="justify-content:space-between">
|
||||
<div class="form-group mt-4 col-6">
|
||||
<input class="form-control" type="text" style="width: 400px;" placeholder="Filtrar..."
|
||||
@bind-value="Filter" @bind-value:after="AplicarFiltros" />
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end mt-3 col-2">
|
||||
<button @onclick="@(() => abrirPopupGestionDatos(new ConvenioProvincia(), true))" class="btnBlue d-flex align-items-center"> <i class="fas fa-plus-square pe-1"></i> Nuevo convenio colectivo</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Grid TItem="ConvenioProvincia"
|
||||
@@ -79,11 +111,11 @@
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context,false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
</span>
|
||||
</div>
|
||||
@*
|
||||
|
||||
<span @onclick="@(() => abrirPopupConfirmarBorrado(@context))" style="cursor: pointer;">
|
||||
<Icon CustomIconName="fas fa-trash"></Icon>
|
||||
</span> *@
|
||||
</span>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
@@ -94,6 +126,8 @@
|
||||
public List<ConvenioProvincia> listadoConProv = new List<ConvenioProvincia>();
|
||||
public List<ConvenioProvincia> listadoCCAux = new List<ConvenioProvincia>();
|
||||
|
||||
public List<bdHerramientaCACOA.db.provincias> listadoProvincias = new List<bdHerramientaCACOA.db.provincias>();
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
private ConvenioProvincia itemSeleccionado { get; set; } = new ConvenioProvincia();
|
||||
|
||||
@@ -102,6 +136,8 @@
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private string idProviItem = "";
|
||||
|
||||
private bool nuevoElemento;
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
@@ -129,6 +165,8 @@
|
||||
}
|
||||
private void obtenerListaConvenioProvincia()
|
||||
{
|
||||
listadoConProv = new List<ConvenioProvincia>();
|
||||
|
||||
var listadoCC = bd.conveniocolectivo.OrderBy(x => x.idProvincia).ToList();
|
||||
var listadoCP = listadoCC.GroupBy(x => x.idProvincia).ToList();
|
||||
for (int i = 0; i < listadoCP.Count; i++)
|
||||
@@ -159,10 +197,7 @@
|
||||
listadoConProv.Add(cp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
listadoCCAux = listadoConProv;
|
||||
|
||||
listadoCCAux = listadoConProv.ToList();
|
||||
}
|
||||
private void AplicarFiltros()
|
||||
{
|
||||
@@ -198,6 +233,13 @@
|
||||
|
||||
if (esNuevo)
|
||||
{
|
||||
var idsProvi = listadoConProv.Select(y => y.idProvincia).ToList();
|
||||
|
||||
listadoProvincias = bd.provincias
|
||||
.Where(x => !idsProvi.Contains(x.CodigoProvincia))
|
||||
.ToList();
|
||||
|
||||
idProviItem = listadoProvincias.First().CodigoProvincia;
|
||||
nuevoElemento = true;
|
||||
}
|
||||
else
|
||||
@@ -207,11 +249,11 @@
|
||||
|
||||
if (!nuevoElemento)
|
||||
{
|
||||
tituloPopup = "Modificar CD+CI: " + itemSeleccionado.NombreProvincia;
|
||||
tituloPopup = "Modificar Convenio Colectivo: " + itemSeleccionado.NombreProvincia;
|
||||
}
|
||||
else
|
||||
{
|
||||
tituloPopup = "Nuevo CD+CI";
|
||||
tituloPopup = "Nuevo Convenio Colectivo";
|
||||
}
|
||||
|
||||
await popupGestionDatos.ShowAsync();
|
||||
@@ -294,7 +336,7 @@
|
||||
|
||||
private void ValidarTodo()
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionado.valorGradoSup }, nameof(itemSeleccionado.valorGradoSup));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionado.valorGradoSup }, nameof(itemSeleccionado.valorGradoSup));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionado.valorGradoMed }, nameof(itemSeleccionado.valorGradoMed));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionado.valorDelinPro }, nameof(itemSeleccionado.valorDelinPro));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = itemSeleccionado.valorAdmin }, nameof(itemSeleccionado.valorAdmin));
|
||||
@@ -326,30 +368,33 @@
|
||||
|
||||
break;
|
||||
|
||||
// case "create":
|
||||
// UtilidadesCASA.crearConvenioColectivo(bd, itemSeleccionado);
|
||||
case "create":
|
||||
itemSeleccionado.idProvincia = idProviItem;
|
||||
|
||||
// await cerrarPopupGestionDatos();
|
||||
// mensajes.Add(new ToastMessage
|
||||
// {
|
||||
// Type = ToastType.Primary,
|
||||
// Message = $"Guardado correctamente.",
|
||||
// });
|
||||
// break;
|
||||
UtilidadesCASA.crearConvenioColectivo(bd, itemSeleccionado);
|
||||
|
||||
// case "delete":
|
||||
// UtilidadesCASA.eliminarCosteDespachoProfesional(bd, costeObtenido);
|
||||
await cerrarPopupGestionDatos();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Guardado correctamente.",
|
||||
});
|
||||
break;
|
||||
|
||||
// await cerrarPopupConfirmarBorrado();
|
||||
// mensajes.Add(new ToastMessage
|
||||
// {
|
||||
// Type = ToastType.Primary,
|
||||
// Message = $"Eliminado correctamente.",
|
||||
// });
|
||||
// break;
|
||||
case "delete":
|
||||
UtilidadesCASA.eliminarConvenioColectivo(bd, itemSeleccionado);
|
||||
|
||||
await cerrarPopupConfirmarBorrado();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Eliminado correctamente.",
|
||||
});
|
||||
break;
|
||||
}
|
||||
bd.SaveChanges();
|
||||
obtenerListaConvenioProvincia();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
}
|
||||
|
||||
@@ -38,15 +38,21 @@
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Fases" Name="tabFases">
|
||||
<Tab Title="Fases CASA" Name="tabFases">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.FasesConf></HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.FasesConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Costes Variables" Name="tabCosteVariable">
|
||||
<Tab Title="Fases URBAN" Name="tabFases">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.FasesURBANConf></HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.FasesURBANConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
<Tab Title="Costes Variables CASA" Name="tabCosteVariable">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.CostesVariablesConf></HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.CostesVariablesConf>
|
||||
@@ -54,6 +60,14 @@
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Costes Variables URBAN" Name="tabCosteVariable">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.CostesVariablesURBANConf></HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.CostesVariablesURBANConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Otros Trabajos" Name="tabOtrosTrabajos">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
@@ -76,6 +90,14 @@
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Textos PDF" Name="tabFactRend">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.TextosPDFConf></HerramientaCASA.Components.Pages.ConfiguracionPages.EnumeracionesTabs.TextosPDFConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<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="puestoTrabForm">
|
||||
<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="40" @bind-Value="descripcionItem" @oninput="e => ValidarYActualizar(e, nameof(descripcionItem))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(descripcionItem))</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Orden:</label>
|
||||
<InputNumber TValue="int?" @bind-Value="ordenItem"
|
||||
step="any"
|
||||
class="inputForm" />
|
||||
|
||||
</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 class="d-flex justify-content-end mt-3">
|
||||
<p><b class="Fuente2"></b> </p>
|
||||
<button @onclick="@(() => abrirPopupGestionDatos(new enumeraciones(), true))" class="btnBlue d-flex align-items-center"> <i class="fas fa-plus-square pe-1"></i> Nuevo coste variable</button>
|
||||
</div>
|
||||
|
||||
<Grid TItem="enumeraciones"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoCostesVariables"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="enumeraciones" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.ValorAlfabetico1</span>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="enumeraciones" Class="columna10Ancho text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Orden">
|
||||
<span>@context.Orden</span>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="enumeraciones" Class="botonesTabla" 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>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<enumeraciones> listadoCostesVariables { get; set; } = new List<enumeraciones>();
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
private enumeraciones itemSeleccionado { get; set; } = new enumeraciones();
|
||||
|
||||
private string tituloPopup = "";
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private bool nuevoElemento;
|
||||
|
||||
private string descripcionItem = "";
|
||||
private int? ordenItem = 0;
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
private EditContext? editContext;
|
||||
private ValidationMessageStore? messageStore;
|
||||
public tsHerramientasCACOA bd;
|
||||
private string codigoEnumeracion = "CVURB";
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
editContext = new EditContext(itemSeleccionado);
|
||||
messageStore = new ValidationMessageStore(editContext);
|
||||
|
||||
listadoCostesVariables = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
}
|
||||
|
||||
|
||||
private async Task abrirPopupGestionDatos(enumeraciones objeto, bool esNuevo)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
|
||||
if (esNuevo)
|
||||
{
|
||||
nuevoElemento = true;
|
||||
descripcionItem = "";
|
||||
ordenItem = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
nuevoElemento = false;
|
||||
descripcionItem = objeto.ValorAlfabetico1;
|
||||
ordenItem = objeto.Orden;
|
||||
}
|
||||
|
||||
if (!nuevoElemento)
|
||||
{
|
||||
tituloPopup = "Modificar coste variable";
|
||||
}
|
||||
else
|
||||
{
|
||||
tituloPopup = "Nuevo coste variable";
|
||||
}
|
||||
|
||||
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(descripcionItem):
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
descripcionItem = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
descripcionItem = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
messageStore?.Clear(field);
|
||||
if (fieldName == nameof(descripcionItem) && descripcionItem == "")
|
||||
{
|
||||
messageStore?.Add(field, "La descripción no puede estar vacía.");
|
||||
}
|
||||
|
||||
editContext?.NotifyValidationStateChanged();
|
||||
}
|
||||
|
||||
private void ValidarTodo()
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = descripcionItem }, nameof(descripcionItem));
|
||||
}
|
||||
|
||||
private string GetExternalValidationMessage(string fieldName)
|
||||
{
|
||||
var field = new FieldIdentifier(itemSeleccionado, fieldName);
|
||||
return messageStore?[field].FirstOrDefault() ?? string.Empty;
|
||||
}
|
||||
|
||||
private async Task GestionarDatos(string accion)
|
||||
{
|
||||
|
||||
var enumObtenido = bd.enumeraciones.Where(x => x.idEnumeracion == itemSeleccionado.idEnumeracion).FirstOrDefault();
|
||||
|
||||
itemSeleccionado.ValorAlfabetico1 = descripcionItem;
|
||||
itemSeleccionado.Orden = ordenItem;
|
||||
|
||||
switch (accion)
|
||||
{
|
||||
case "update":
|
||||
UtilidadesCASA.guardarEnumeracion(bd, itemSeleccionado, codigoEnumeracion, nuevoElemento, enumObtenido);
|
||||
|
||||
await cerrarPopupGestionDatos();
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Actualizado correctamente.",
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case "create":
|
||||
UtilidadesCASA.guardarEnumeracion(bd, itemSeleccionado, codigoEnumeracion, nuevoElemento);
|
||||
|
||||
await cerrarPopupGestionDatos();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Guardado correctamente.",
|
||||
});
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
UtilidadesCASA.eliminarEnumeracion(bd, enumObtenido);
|
||||
|
||||
await cerrarPopupConfirmarBorrado();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Eliminado correctamente.",
|
||||
});
|
||||
break;
|
||||
}
|
||||
bd.SaveChanges();
|
||||
listadoCostesVariables = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
|
||||
private async Task BorrarItem()
|
||||
{
|
||||
await GestionarDatos("delete");
|
||||
}
|
||||
//////// PopUp eliminar registro
|
||||
private async Task abrirPopupConfirmarBorrado(enumeraciones objeto)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
await popupConfirmarBorrado.ShowAsync();
|
||||
}
|
||||
private async Task cerrarPopupConfirmarBorrado()
|
||||
{
|
||||
await popupConfirmarBorrado.HideAsync();
|
||||
}
|
||||
|
||||
// GUARDAR
|
||||
private async Task guardarFormulario()
|
||||
{
|
||||
try
|
||||
{
|
||||
ValidarTodo();
|
||||
|
||||
if (!editContext!.GetValidationMessages().Any())
|
||||
{
|
||||
string accion = nuevoElemento ? "create" : "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(descripcionItem) })
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = typeof(enumeraciones).GetProperty(field)?.GetValue(itemSeleccionado) }, field);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,425 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<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="PeriodosForm">
|
||||
<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="40" @bind-Value="descripcionItem" @oninput="e => ValidarYActualizar(e, nameof(descripcionItem))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(descripcionItem))</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Valor numérico:</label>
|
||||
<InputNumber TValue="double?" @bind-Value="valorNumericoItem"
|
||||
step="any"
|
||||
@oninput="e => ValidarYActualizar(e, nameof(valorNumericoItem))"
|
||||
class="inputForm" />
|
||||
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(valorNumericoItem))</div>
|
||||
|
||||
<div class="col-6 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazos:</label>
|
||||
<InputNumber TValue="double?" @bind-Value="plazosItem"
|
||||
step="any"
|
||||
@oninput="e => ValidarYActualizar(e, nameof(plazosItem))"
|
||||
class="inputForm" />
|
||||
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(plazosItem))</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Orden:</label>
|
||||
<InputNumber TValue="int?" @bind-Value="ordenItem"
|
||||
step="any"
|
||||
class="inputForm" />
|
||||
|
||||
</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 class="d-flex justify-content-between mt-3">
|
||||
<p><b class="Fuente2"></b> </p>
|
||||
<button @onclick="@(() => abrirPopupGestionDatos(new enumeraciones(), true))" class="btnBlue d-flex align-items-center"> <i class="fas fa-plus-square pe-1"></i> Nueva fase</button>
|
||||
</div>
|
||||
|
||||
<Grid TItem="enumeraciones"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoFases"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="enumeraciones" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.ValorAlfabetico1</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="enumeraciones" HeaderTextAlignment="Alignment.Center" Class="columna20Ancho text-end" HeaderText="Valor Numérico">
|
||||
<span>@context.ValorNumerico1</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="enumeraciones" Class="columna10Ancho text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Plazos">
|
||||
<span>@context.ValorNumerico2</span>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="enumeraciones" HeaderTextAlignment="Alignment.Center" Class="columna10Ancho text-end" HeaderText="Orden">
|
||||
<span>@context.Orden</span>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="enumeraciones" Class="botonesTabla" 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>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<enumeraciones> listadoFases { get; set; } = new List<enumeraciones>();
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
private enumeraciones itemSeleccionado { get; set; } = new enumeraciones();
|
||||
|
||||
private string tituloPopup = "";
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private double? valorNumericoOriginal;
|
||||
|
||||
private bool nuevoElemento;
|
||||
|
||||
private string descripcionItem = "";
|
||||
private int? ordenItem = 0;
|
||||
private double? valorNumericoItem = 0;
|
||||
private double? plazosItem = 0;
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
private EditContext? editContext;
|
||||
private ValidationMessageStore? messageStore;
|
||||
public tsHerramientasCACOA bd;
|
||||
private string codigoEnumeracion = "FASURB";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
editContext = new EditContext(itemSeleccionado);
|
||||
messageStore = new ValidationMessageStore(editContext);
|
||||
|
||||
listadoFases = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
}
|
||||
|
||||
|
||||
private async Task abrirPopupGestionDatos(enumeraciones objeto, bool esNuevo)
|
||||
{
|
||||
valorNumericoOriginal = objeto.ValorNumerico1;
|
||||
itemSeleccionado = objeto;
|
||||
|
||||
if (esNuevo)
|
||||
{
|
||||
nuevoElemento = true;
|
||||
|
||||
|
||||
descripcionItem = "";
|
||||
ordenItem = 0;
|
||||
valorNumericoItem = 0;
|
||||
plazosItem = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
nuevoElemento = false;
|
||||
|
||||
descripcionItem = objeto.ValorAlfabetico1;
|
||||
ordenItem = objeto.Orden;
|
||||
valorNumericoItem = objeto.ValorNumerico1;
|
||||
plazosItem = objeto.ValorNumerico2;
|
||||
}
|
||||
|
||||
if (!nuevoElemento)
|
||||
{
|
||||
tituloPopup = "Modificar fase";
|
||||
}
|
||||
else
|
||||
{
|
||||
tituloPopup = "Nueva fase";
|
||||
}
|
||||
|
||||
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(descripcionItem):
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
descripcionItem = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
descripcionItem = "";
|
||||
}
|
||||
break;
|
||||
|
||||
case nameof(valorNumericoItem):
|
||||
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
string parseado = value.Replace(",", ".");
|
||||
valorNumericoItem = double.Parse(parseado, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
break;
|
||||
case nameof(plazosItem):
|
||||
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
string parseado = value.Replace(",", ".");
|
||||
plazosItem = double.Parse(parseado, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
messageStore?.Clear(field);
|
||||
if (fieldName == nameof(descripcionItem) && descripcionItem == "")
|
||||
{
|
||||
messageStore?.Add(field, "La descripción no puede estar vacía.");
|
||||
}
|
||||
|
||||
if (fieldName == nameof(valorNumericoItem) && valorNumericoItem == null)
|
||||
{
|
||||
messageStore?.Add(field, "El valor numérico no puede estar vacío.");
|
||||
}
|
||||
|
||||
editContext?.NotifyValidationStateChanged();
|
||||
}
|
||||
|
||||
|
||||
private void ValidarTodo()
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = descripcionItem }, nameof(descripcionItem));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = valorNumericoItem }, nameof(valorNumericoItem));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = plazosItem }, nameof(plazosItem));
|
||||
}
|
||||
|
||||
private string GetExternalValidationMessage(string fieldName)
|
||||
{
|
||||
var field = new FieldIdentifier(itemSeleccionado, fieldName);
|
||||
return messageStore?[field].FirstOrDefault() ?? string.Empty;
|
||||
}
|
||||
|
||||
private async Task GestionarDatos(string accion)
|
||||
{
|
||||
|
||||
var enumObtenido = bd.enumeraciones.Where(x => x.idEnumeracion == itemSeleccionado.idEnumeracion).FirstOrDefault();
|
||||
|
||||
itemSeleccionado.ValorAlfabetico1 = descripcionItem;
|
||||
itemSeleccionado.Orden = ordenItem;
|
||||
itemSeleccionado.ValorNumerico1 = valorNumericoItem;
|
||||
itemSeleccionado.ValorNumerico2 = plazosItem;
|
||||
|
||||
|
||||
switch (accion)
|
||||
{
|
||||
case "update":
|
||||
UtilidadesCASA.guardarEnumeracion(bd, itemSeleccionado, codigoEnumeracion, nuevoElemento, enumObtenido);
|
||||
|
||||
await cerrarPopupGestionDatos();
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Actualizado correctamente.",
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case "create":
|
||||
UtilidadesCASA.guardarEnumeracion(bd, itemSeleccionado, codigoEnumeracion, nuevoElemento);
|
||||
|
||||
await cerrarPopupGestionDatos();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Guardado correctamente.",
|
||||
});
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
UtilidadesCASA.eliminarEnumeracion(bd, enumObtenido);
|
||||
|
||||
await cerrarPopupConfirmarBorrado();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Eliminado correctamente.",
|
||||
});
|
||||
break;
|
||||
}
|
||||
bd.SaveChanges();
|
||||
listadoFases = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
|
||||
private async Task BorrarItem()
|
||||
{
|
||||
await GestionarDatos("delete");
|
||||
}
|
||||
//////// PopUp eliminar registro
|
||||
private async Task abrirPopupConfirmarBorrado(enumeraciones objeto)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
await popupConfirmarBorrado.ShowAsync();
|
||||
}
|
||||
private async Task cerrarPopupConfirmarBorrado()
|
||||
{
|
||||
await popupConfirmarBorrado.HideAsync();
|
||||
}
|
||||
|
||||
// GUARDAR
|
||||
private async Task guardarFormulario()
|
||||
{
|
||||
try
|
||||
{
|
||||
ValidarTodo();
|
||||
|
||||
if (!editContext!.GetValidationMessages().Any())
|
||||
{
|
||||
string accion = nuevoElemento ? "create" : "update";
|
||||
bool porcentajeMenosCien = comprobarPorcentaje();
|
||||
|
||||
if (porcentajeMenosCien)
|
||||
{
|
||||
await GestionarDatos(accion);
|
||||
}
|
||||
else
|
||||
{
|
||||
await cerrarPopupGestionDatos();
|
||||
itemSeleccionado.ValorNumerico1 = valorNumericoOriginal;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Warning,
|
||||
Message = $"El porcentaje total no puede ser mayor de 100.",
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
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(descripcionItem), nameof(valorNumericoItem) })
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = typeof(enumeraciones).GetProperty(field)?.GetValue(itemSeleccionado) }, field);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool comprobarPorcentaje()
|
||||
{
|
||||
bool menorCien = false;
|
||||
|
||||
var porcentajeTotal = listadoFases.Sum(x => x.ValorNumerico1);
|
||||
|
||||
if (!nuevoElemento)
|
||||
{
|
||||
if (porcentajeTotal <= 100)
|
||||
{
|
||||
menorCien = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (porcentajeTotal + valorNumericoItem <= 100)
|
||||
{
|
||||
menorCien = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return menorCien;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<EditForm EditContext="@editContext" OnValidSubmit="guardarFormulario" FormName="puestoTrabForm">
|
||||
<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">Texto:</label>
|
||||
<TextAreaInput Style="height:220px; max-height:220px" MaxLength="2000" @bind-Value="@textoItem" Rows="3" TextAlignment="Alignment.Start" />
|
||||
</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>
|
||||
|
||||
<Grid TItem="enumeraciones"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoTextosPDF"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="enumeraciones" Class="columna20Ancho" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.Descripcion</span>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="enumeraciones" HeaderTextAlignment="Alignment.Center" HeaderText="Texto">
|
||||
<span>@context.ValorAlfabeticoLargo</span>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="enumeraciones" Class="botonesTabla" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context, false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
</span>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<enumeraciones> listadoTextosPDF { get; set; } = new List<enumeraciones>();
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
private enumeraciones itemSeleccionado { get; set; } = new enumeraciones();
|
||||
|
||||
private string tituloPopup = "";
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private bool nuevoElemento;
|
||||
|
||||
private string textoItem = "";
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
private EditContext? editContext;
|
||||
private ValidationMessageStore? messageStore;
|
||||
public tsHerramientasCACOA bd;
|
||||
private string codigoEnumeracion = "VARPDF";
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
editContext = new EditContext(itemSeleccionado);
|
||||
messageStore = new ValidationMessageStore(editContext);
|
||||
|
||||
listadoTextosPDF = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
}
|
||||
|
||||
|
||||
private async Task abrirPopupGestionDatos(enumeraciones objeto, bool esNuevo)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
|
||||
nuevoElemento = false;
|
||||
textoItem = objeto.ValorAlfabeticoLargo;
|
||||
|
||||
tituloPopup = "Modificar texto";
|
||||
|
||||
await popupGestionDatos.ShowAsync();
|
||||
}
|
||||
private async Task cerrarPopupGestionDatos()
|
||||
{
|
||||
await popupGestionDatos.HideAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private async Task GestionarDatos(string accion)
|
||||
{
|
||||
|
||||
var enumObtenido = bd.enumeraciones.Where(x => x.idEnumeracion == itemSeleccionado.idEnumeracion).FirstOrDefault();
|
||||
|
||||
itemSeleccionado.ValorAlfabeticoLargo = textoItem;
|
||||
|
||||
switch (accion)
|
||||
{
|
||||
case "update":
|
||||
UtilidadesCASA.guardarEnumeracion(bd, itemSeleccionado, codigoEnumeracion, nuevoElemento, enumObtenido);
|
||||
|
||||
await cerrarPopupGestionDatos();
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Actualizado correctamente.",
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
bd.SaveChanges();
|
||||
listadoTextosPDF = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task cerrarPopupConfirmarBorrado()
|
||||
{
|
||||
await popupConfirmarBorrado.HideAsync();
|
||||
}
|
||||
|
||||
// GUARDAR
|
||||
private async Task guardarFormulario()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!editContext!.GetValidationMessages().Any())
|
||||
{
|
||||
string accion = nuevoElemento ? "create" : "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.",
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
@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 container-fluid mt-4" 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>
|
||||
|
||||
<div class="container-fluid pt-3">
|
||||
|
||||
<Tabs>
|
||||
<Tab Title="Estadisticas CASA - Edificación" Active>
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<CascadingValue Value="this">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab ListadoHerraCASA="@listadoHerramientaEstadistica" ListadoFactoresCASA="listadoHerramientaEstadisticaFactores" ListadoUsosCASA="listadoHerramientaEstadisticaUsos"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
</Content>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Estadisticas Licitaciones Edificación">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<CascadingValue Value="this">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab ListadoLiciCASA="@listadoLicitacionesEstadistica" ListadoUsosLicitacion="listadoLicitacionUsos"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab>
|
||||
</CascadingValue>
|
||||
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Estadisticas CASA - Urbanismo">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<CascadingValue Value="this">
|
||||
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab ListadoHerraURBAN="@listadoHerramientaEstadisticaUrban"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab>
|
||||
</CascadingValue>
|
||||
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Estadisticas Licitación Urbanismo">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<CascadingValue Value="this">
|
||||
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciURBANTab ListadoLiciURBAN="@listadoLicitacionesEstadisticaUrban"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciURBANTab>
|
||||
</CascadingValue>
|
||||
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoLicitacionesEstadistica { get; set; } = new List<estadisticas>();
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadisticaUrban { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoLicitacionesEstadisticaUrban { get; set; } = new List<estadisticas>();
|
||||
|
||||
public List<estadisticasusos> listadoHerramientaEstadisticaUsos { get; set; } = new List<estadisticasusos>();
|
||||
public List<estadisticasusos> listadoLicitacionUsos { 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 = "";
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
|
||||
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 = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task generarExcel(byte[] arrayListados)
|
||||
{
|
||||
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");
|
||||
|
||||
var bytes = arrayListados;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
|
||||
if (fechaInicio == null)
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 31).ToList();
|
||||
listadoLicitacionesEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 32).ToList();
|
||||
|
||||
listadoHerramientaEstadisticaUrban = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 34).ToList();
|
||||
listadoLicitacionesEstadisticaUrban = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 35).ToList();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var listadoHerraCASA = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 31).ToList();
|
||||
var listadoLicitacionCASA = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 32).ToList();
|
||||
|
||||
listadoHerramientaEstadistica = listadoHerraCASA.Where(x => (x.idSimulacionNavigation.FechaCreacion >= fechaInicio) && (x.idSimulacionNavigation.FechaModificacion ?? x.idSimulacionNavigation.FechaCreacion).Date <= fechaFinal).ToList();
|
||||
listadoLicitacionesEstadistica = listadoHerraCASA.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();
|
||||
listadoLicitacionUsos = bd.estadisticasusos.AsEnumerable().Where(x => listadoLicitacionesEstadistica.Any(y => y.idSimulacion == x.idSimulacion)).ToList();
|
||||
|
||||
listadoHerramientaEstadisticaFactores = bd.estadisticasfactores.AsEnumerable().Where(x => listadoHerramientaEstadistica.Any(y => y.idSimulacion == x.idsimulacion)).ToList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using ClosedXML.Excel
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
@inject IJSRuntime JS
|
||||
|
||||
@using ClosedXML.Excel
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
<div class="col-12 text-end">
|
||||
<button @onclick="ExportarExcelCasa" class="btnBlue col-1 " style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Generar Excel</button>
|
||||
</div>
|
||||
<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">Nº total trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores.MilesYDecimales()</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste anual total:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeAnualTotal.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasProduccion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes directos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesDirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes indirectos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesIndirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes variables:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesVariables.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total superficie:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalSuperficie.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas documentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasDocumentacion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas dirección obra:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasDireccionObra.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeExternalizacion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.beneficio.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.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 class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio encargo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioEncargo.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mt-5">
|
||||
<label class="tituloLbl">No hay datos entre esas fechas.</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoHerraCASA { get; set; } = new List<estadisticas>();
|
||||
[Parameter]
|
||||
public List<estadisticasfactores> ListadoFactoresCASA { get; set; } = new List<estadisticasfactores>();
|
||||
[Parameter]
|
||||
public List<estadisticasusos> ListadoUsosCASA { get; set; } = new List<estadisticasusos>();
|
||||
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
||||
|
||||
[CascadingParameter]
|
||||
public ConfiguracionPages.EstadisticasConf _Parent { get; set; }
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
estadisticasTotales.costeAnualTotal = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalCosteAnual), totalProyectosTipo);
|
||||
estadisticasTotales.horasProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasProduccion), totalProyectosTipo);
|
||||
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.totalSuperficie= UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalSupeficie), 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.costeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.beneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
||||
estadisticasTotales.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
||||
estadisticasTotales.precioEncargo= UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioEncargo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
totalProyectosTipo = ListadoHerraCASA.Count();
|
||||
|
||||
hacerCalculos(ListadoHerraCASA);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private async Task ExportarExcelCasa()
|
||||
{
|
||||
var bytes = UtilidadesCASA.GenerarExcelCasa(bd,ListadoHerraCASA, ListadoUsosCASA, ListadoFactoresCASA);
|
||||
|
||||
_Parent.generarExcel(bytes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<div>
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
<div class="col-12 text-end">
|
||||
<button @onclick="generarTablaUrban" class="btnBlue col-1 " style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Generar Excel</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-2" 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">Nº total trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores.MilesYDecimales()</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste anual total:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeAnualTotal.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasProduccion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes directos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesDirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes indirectos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesIndirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes variables:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesVariables.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Innovación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.innovacion.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeExternalizacion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.beneficio.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.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="ListadoHerraURBAN"
|
||||
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 {
|
||||
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoHerraURBAN { get; set; } = new List<estadisticas>();
|
||||
|
||||
public EstadisticasUrbanVM estadisticasTotales = new EstadisticasUrbanVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
|
||||
[CascadingParameter]
|
||||
public ConfiguracionPages.EstadisticasConf _Parent { get; set; }
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
}
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
estadisticasTotales.costeAnualTotal = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalCosteAnual), totalProyectosTipo);
|
||||
estadisticasTotales.horasProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasProduccion), totalProyectosTipo);
|
||||
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.innovacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.innovacion), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.beneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
||||
estadisticasTotales.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
totalProyectosTipo = ListadoHerraURBAN.Count();
|
||||
|
||||
hacerCalculos(ListadoHerraURBAN);
|
||||
}
|
||||
|
||||
|
||||
private async Task generarTablaUrban()
|
||||
{
|
||||
var bytes = UtilidadesCASA.GenerarExcelURBAN(bd, ListadoHerraURBAN, "Herramienta URBAN");
|
||||
|
||||
_Parent.generarExcel(bytes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<div>
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
<div class="col-12 text-end">
|
||||
<button @onclick="ExportarExcelCasa" class="btnBlue col-1 " style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Generar Excel</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-2" 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">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total superficie:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalSuperficie.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.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 class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio encargo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioEncargo.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="ListadoLiciCASA"
|
||||
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 {
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoLiciCASA { get; set; } = new List<estadisticas>();
|
||||
|
||||
[Parameter]
|
||||
public List<estadisticasusos> ListadoUsosLicitacion { get; set; } = new List<estadisticasusos>();
|
||||
|
||||
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
[CascadingParameter]
|
||||
public ConfiguracionPages.EstadisticasConf _Parent { get; set; }
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
}
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.totalSuperficie = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalSupeficie), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = 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.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
||||
estadisticasTotales.precioEncargo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioEncargo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
inicializarListado();
|
||||
}
|
||||
private void inicializarListado()
|
||||
{
|
||||
totalProyectosTipo = ListadoLiciCASA.Count();
|
||||
hacerCalculos(ListadoLiciCASA);
|
||||
}
|
||||
|
||||
private async Task ExportarExcelCasa()
|
||||
{
|
||||
var bytes = UtilidadesCASA.GenerarExcelCasa(bd, ListadoLiciCASA, ListadoUsosLicitacion, null);
|
||||
|
||||
_Parent.generarExcel(bytes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<div>
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
|
||||
<div class="col-12 text-end">
|
||||
<button @onclick="generarTablaUrban" class="btnBlue col-1 " style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Generar Excel</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-2" style="padding:50px;">
|
||||
<div class="mb-4">
|
||||
<label class="fw-bold">Total simulaciones licitación URBAN: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Innovación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.innovacion.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.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="ListadoLiciURBAN"
|
||||
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 {
|
||||
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoLiciURBAN { get; set; } = new List<estadisticas>();
|
||||
public EstadisticasUrbanVM estadisticasTotales = new EstadisticasUrbanVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
|
||||
[CascadingParameter]
|
||||
public ConfiguracionPages.EstadisticasConf _Parent { get; set; }
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
}
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.innovacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.innovacion), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = 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.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
totalProyectosTipo = ListadoLiciURBAN.Count();
|
||||
|
||||
hacerCalculos(ListadoLiciURBAN);
|
||||
}
|
||||
|
||||
|
||||
private async Task generarTablaUrban()
|
||||
{
|
||||
var bytes = UtilidadesCASA.GenerarExcelURBAN(bd, ListadoLiciURBAN, "Licitación URBAN");
|
||||
|
||||
_Parent.generarExcel(bytes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,353 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
@page "/Manuales"
|
||||
|
||||
<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="PeriodosForm">
|
||||
<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="40" @bind-Value="descripcionItem" @oninput="e => ValidarYActualizar(e, nameof(descripcionItem))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(descripcionItem))</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">URL:</label>
|
||||
<InputText MaxLength="255" @bind-Value="urlItem" @oninput="e => ValidarYActualizar(e, nameof(urlItem))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(urlItem))</div>
|
||||
</div>
|
||||
|
||||
@* <div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Orden:</label>
|
||||
<InputNumber TValue="int?" @bind-Value="ordenItem"
|
||||
step="any"
|
||||
class="inputForm" />
|
||||
</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 class="d-flex justify-content-between mt-3">
|
||||
<p><b class="Fuente2"></b> </p>
|
||||
<button @onclick="@(() => abrirPopupGestionDatos(new enumeraciones(), true))" class="btnBlue d-flex align-items-center"> <i class="fas fa-plus-square pe-1"></i> Nuevo manual</button>
|
||||
</div> *@
|
||||
|
||||
<Grid TItem="enumeraciones"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoManuales"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="enumeraciones" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.ValorAlfabetico1</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="enumeraciones" HeaderTextAlignment="Alignment.Center" HeaderText="URL">
|
||||
<span>@context.ValorAlfabeticoLargo</span>
|
||||
</GridColumn>
|
||||
|
||||
@* <GridColumn TItem="enumeraciones" Class="columna10Ancho text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Orden">
|
||||
<span>@context.Orden</span>
|
||||
</GridColumn> *@
|
||||
<GridColumn TItem="enumeraciones" Class="botonesTabla" 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>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<enumeraciones> listadoManuales { get; set; } = new List<enumeraciones>();
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
private enumeraciones itemSeleccionado { get; set; } = new enumeraciones();
|
||||
|
||||
private string tituloPopup = "";
|
||||
private Modal popupGestionDatos = default!;
|
||||
private Modal popupConfirmarBorrado = default!;
|
||||
|
||||
private bool nuevoElemento;
|
||||
|
||||
private string descripcionItem = "";
|
||||
private string urlItem = "";
|
||||
private int? ordenItem = 0;
|
||||
|
||||
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
private EditContext? editContext;
|
||||
private ValidationMessageStore? messageStore;
|
||||
public tsHerramientasCACOA bd;
|
||||
private string codigoEnumeracion = "MANUAL";
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
editContext = new EditContext(itemSeleccionado);
|
||||
messageStore = new ValidationMessageStore(editContext);
|
||||
|
||||
listadoManuales = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
}
|
||||
|
||||
|
||||
private async Task abrirPopupGestionDatos(enumeraciones objeto, bool esNuevo)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
|
||||
if (esNuevo)
|
||||
{
|
||||
nuevoElemento = true;
|
||||
descripcionItem = "";
|
||||
urlItem = "";
|
||||
ordenItem = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
nuevoElemento = false;
|
||||
descripcionItem = objeto.ValorAlfabetico1;
|
||||
urlItem = objeto.ValorAlfabeticoLargo;
|
||||
ordenItem = objeto.Orden;
|
||||
}
|
||||
|
||||
if (!nuevoElemento)
|
||||
{
|
||||
tituloPopup = "Modificar manual";
|
||||
}
|
||||
else
|
||||
{
|
||||
tituloPopup = "Nuevo manual";
|
||||
}
|
||||
|
||||
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(descripcionItem):
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
descripcionItem = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
descripcionItem = "";
|
||||
}
|
||||
break;
|
||||
|
||||
case nameof(urlItem):
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
|
||||
urlItem = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
urlItem = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
messageStore?.Clear(field);
|
||||
if (fieldName == nameof(descripcionItem) && descripcionItem == "")
|
||||
{
|
||||
messageStore?.Add(field, "La descripción no puede estar vacía.");
|
||||
}
|
||||
|
||||
|
||||
if (fieldName == nameof(urlItem) && urlItem == "")
|
||||
{
|
||||
messageStore?.Add(field, "La url no puede estar vacía.");
|
||||
}
|
||||
|
||||
editContext?.NotifyValidationStateChanged();
|
||||
}
|
||||
|
||||
|
||||
private void ValidarTodo()
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = descripcionItem }, nameof(descripcionItem));
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = urlItem }, nameof(urlItem));
|
||||
}
|
||||
|
||||
private string GetExternalValidationMessage(string fieldName)
|
||||
{
|
||||
var field = new FieldIdentifier(itemSeleccionado, fieldName);
|
||||
return messageStore?[field].FirstOrDefault() ?? string.Empty;
|
||||
}
|
||||
|
||||
private async Task GestionarDatos(string accion)
|
||||
{
|
||||
try
|
||||
{
|
||||
var enumObtenido = bd.enumeraciones.Where(x => x.idEnumeracion == itemSeleccionado.idEnumeracion).FirstOrDefault();
|
||||
|
||||
itemSeleccionado.ValorAlfabetico1 = descripcionItem;
|
||||
itemSeleccionado.ValorAlfabeticoLargo = urlItem;
|
||||
itemSeleccionado.Orden = ordenItem;
|
||||
|
||||
switch (accion)
|
||||
{
|
||||
case "update":
|
||||
UtilidadesCASA.guardarEnumeracion(bd, itemSeleccionado, codigoEnumeracion, nuevoElemento, enumObtenido);
|
||||
|
||||
await cerrarPopupGestionDatos();
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Actualizado correctamente.",
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case "create":
|
||||
UtilidadesCASA.guardarEnumeracion(bd, itemSeleccionado, codigoEnumeracion, nuevoElemento);
|
||||
|
||||
await cerrarPopupGestionDatos();
|
||||
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Guardado correctamente.",
|
||||
});
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
UtilidadesCASA.eliminarEnumeracion(bd, enumObtenido);
|
||||
|
||||
await cerrarPopupConfirmarBorrado();
|
||||
mensajes.Add(new ToastMessage
|
||||
{
|
||||
Type = ToastType.Primary,
|
||||
Message = $"Eliminado correctamente.",
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
bd.SaveChanges();
|
||||
listadoManuales = UtilidadesCASA.devolverListadoOrdenadoEnumeracion(bd, codigoEnumeracion);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string error = ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task BorrarItem()
|
||||
{
|
||||
await GestionarDatos("delete");
|
||||
}
|
||||
//////// PopUp eliminar registro
|
||||
private async Task abrirPopupConfirmarBorrado(enumeraciones objeto)
|
||||
{
|
||||
itemSeleccionado = objeto;
|
||||
await popupConfirmarBorrado.ShowAsync();
|
||||
}
|
||||
private async Task cerrarPopupConfirmarBorrado()
|
||||
{
|
||||
await popupConfirmarBorrado.HideAsync();
|
||||
}
|
||||
|
||||
// GUARDAR
|
||||
private async Task guardarFormulario()
|
||||
{
|
||||
try
|
||||
{
|
||||
ValidarTodo();
|
||||
|
||||
if (!editContext!.GetValidationMessages().Any())
|
||||
{
|
||||
string accion = nuevoElemento ? "create" : "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(descripcionItem) })
|
||||
{
|
||||
ValidarYActualizar(new ChangeEventArgs { Value = typeof(enumeraciones).GetProperty(field)?.GetValue(itemSeleccionado) }, field);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,6 +34,15 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-6 d-flex align-items-center justify-content-center colorAMenu dive">
|
||||
<a href="ConvenioColectivo">
|
||||
<div>
|
||||
<h4 class="text-center">Convenio Colectivo</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-6 d-flex align-items-center justify-content-center colorEMenu dive">
|
||||
<a href="DocumentosUrban">
|
||||
<div>
|
||||
@@ -41,13 +50,40 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-6 d-flex align-items-center justify-content-center colorAMenu dive">
|
||||
|
||||
|
||||
<div class="col-6 d-flex align-items-center justify-content-center colorBMenu dive">
|
||||
<a href="CalculoCDCI">
|
||||
<div>
|
||||
<h4 class="text-center">CD+CI</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-6 d-flex align-items-center justify-content-center colorCMenu dive">
|
||||
<a href="Manuales">
|
||||
<div>
|
||||
<h4 class="text-center">Manuales</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
@* <p style="text-align: center;">Revise sus simulaciones creadas anteriormente</p> *@
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
@page "/PuntosInfo"
|
||||
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
|
||||
|
||||
<div class="container-fluid pt-3">
|
||||
<Tabs>
|
||||
<Tab Title="Información Herramienta CASA" Active>
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosHerraCASAConf></HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosHerraCASAConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Información Licitación CASA">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosLicitacionCASAConf></HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosLicitacionCASAConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Información Herramienta URBAN">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosHerraURBANConf></HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosHerraURBANConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Información Licitación URBAN">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosLicitacionURBANConf></HerramientaCASA.Components.Pages.ConfiguracionPages.PuntosInfoTabs.PuntosLicitacionURBANConf>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<EditForm EditContext="@editContext" OnValidSubmit="guardarFormulario" OnInvalidSubmit="@MostrarErrores" FormName="PuntoInfoForm">
|
||||
<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">Título:</label>
|
||||
<InputText MaxLength="60" @bind-Value="TituloPunto" @oninput="e => ValidarYActualizar(e, nameof(TituloPunto))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(TituloPunto))</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Descripción:</label>
|
||||
<TextAreaInput Style="height:220px; max-height:220px" MaxLength="400" @bind-Value="@DescripcionPunto" Rows="3" TextAlignment="Alignment.Start" />
|
||||
</div>
|
||||
</div>
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="cerrarPopupGestionDatos">Cerrar</Button>
|
||||
<Button Type="ButtonType.Submit" Color="ButtonColor.Primary">@("Modificar")</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
</EditForm>
|
||||
|
||||
<div>
|
||||
<Grid TItem="puntosinformacion"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoPuntosInfo"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" Class="columna20Ancho" HeaderText="Título">
|
||||
<span>@context.Titulo</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.Descripcion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" Class="botonesTabla columna3Ancho" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context, false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
</span>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<puntosinformacion> listadoPuntosInfo { get; set; } = new List<puntosinformacion>();
|
||||
|
||||
[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<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<EditForm EditContext="@editContext" OnValidSubmit="guardarFormulario" OnInvalidSubmit="@MostrarErrores" FormName="PuntoInfoForm">
|
||||
<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">Título:</label>
|
||||
<InputText MaxLength="60" @bind-Value="TituloPunto" @oninput="e => ValidarYActualizar(e, nameof(TituloPunto))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(TituloPunto))</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Descripción:</label>
|
||||
<TextAreaInput Style="height:220px; max-height:220px" MaxLength="400" @bind-Value="@DescripcionPunto" Rows="3" TextAlignment="Alignment.Start" />
|
||||
</div>
|
||||
</div>
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="cerrarPopupGestionDatos">Cerrar</Button>
|
||||
<Button Type="ButtonType.Submit" Color="ButtonColor.Primary">@("Modificar")</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
</EditForm>
|
||||
|
||||
<div>
|
||||
<Grid TItem="puntosinformacion"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoPuntosInfo"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" Class="columna20Ancho" HeaderText="Título">
|
||||
<span>@context.Titulo</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.Descripcion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" Class="botonesTabla columna3Ancho" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context, false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
</span>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<puntosinformacion> listadoPuntosInfo { get; set; } = new List<puntosinformacion>();
|
||||
|
||||
[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<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<EditForm EditContext="@editContext" OnValidSubmit="guardarFormulario" OnInvalidSubmit="@MostrarErrores" FormName="PuntoInfoForm">
|
||||
<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">Título:</label>
|
||||
<InputText MaxLength="60" @bind-Value="TituloPunto" @oninput="e => ValidarYActualizar(e, nameof(TituloPunto))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(TituloPunto))</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Descripción:</label>
|
||||
<TextAreaInput Style="height:220px; max-height:220px" MaxLength="400" @bind-Value="@DescripcionPunto" Rows="3" TextAlignment="Alignment.Start" />
|
||||
</div>
|
||||
</div>
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="cerrarPopupGestionDatos">Cerrar</Button>
|
||||
<Button Type="ButtonType.Submit" Color="ButtonColor.Primary">@("Modificar")</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
</EditForm>
|
||||
|
||||
<div>
|
||||
<Grid TItem="puntosinformacion"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoPuntosInfo"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" Class="columna20Ancho" HeaderText="Título">
|
||||
<span>@context.Titulo</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.Descripcion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" Class="botonesTabla columna3Ancho" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context, false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
</span>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<puntosinformacion> listadoPuntosInfo { get; set; } = new List<puntosinformacion>();
|
||||
|
||||
[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<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<EditForm EditContext="@editContext" OnValidSubmit="guardarFormulario" OnInvalidSubmit="@MostrarErrores" FormName="PuntoInfoForm">
|
||||
<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">Título:</label>
|
||||
<InputText MaxLength="60" @bind-Value="TituloPunto" @oninput="e => ValidarYActualizar(e, nameof(TituloPunto))" class="inputForm"></InputText>
|
||||
</div>
|
||||
<div class="validation-message">@GetExternalValidationMessage(nameof(TituloPunto))</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Descripción:</label>
|
||||
<TextAreaInput Style="height:220px; max-height:220px" MaxLength="400" @bind-Value="@DescripcionPunto" Rows="3" TextAlignment="Alignment.Start" />
|
||||
</div>
|
||||
</div>
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="cerrarPopupGestionDatos">Cerrar</Button>
|
||||
<Button Type="ButtonType.Submit" Color="ButtonColor.Primary">@("Modificar")</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
</EditForm>
|
||||
|
||||
<div>
|
||||
<Grid TItem="puntosinformacion"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoPuntosInfo"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" Class="columna20Ancho" HeaderText="Título">
|
||||
<span>@context.Titulo</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" HeaderTextAlignment="Alignment.Center" HeaderText="Descripción">
|
||||
<span>@context.Descripcion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="puntosinformacion" Class="botonesTabla columna3Ancho" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context, false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
</span>
|
||||
</div>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<puntosinformacion> listadoPuntosInfo { get; set; } = new List<puntosinformacion>();
|
||||
|
||||
[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<ToastMessage> mensajes = new List<ToastMessage>();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -3,42 +3,42 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mt-3">
|
||||
<div style="height: 24px;">
|
||||
<!--style="width:47%;"-->
|
||||
<div class="col-md-6 mt-3" >
|
||||
<div style="margin-bottom: 10px;">
|
||||
<b>Costes Asociados a los Servicios de Arquitectura</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>
|
||||
<table class="tablaAlter" style="width:100%">
|
||||
<tr>
|
||||
<td class="tdAlter fw-bold w4" style="background:#ffc107;">COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL</td>
|
||||
<td class="text-end"><span> @objetoCASA.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
<td class="tdAlter TotalesTabla"> COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL: </td>
|
||||
|
||||
<td class="tdAlter TotalesTabla tdAlineadoDerecha" style="width: 30%; font-weight:bold;">
|
||||
@objetoCASA.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorFilasIntro w4"><b>Beneficio</b> (antes de impuestos)</td>
|
||||
<td class="text-end">
|
||||
<td class="TotalesTabla">
|
||||
|
||||
<div class="puntoInfo">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 29).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 29).Descripcion)
|
||||
}
|
||||
<b>Beneficio</b> (antes de impuestos)
|
||||
</div></td>
|
||||
<td class="tdAlineadoDerecha TotalesTabla">
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<InputNumber TValue="double" Locale="es-ES" Min="0" class="inputForm formatoMoneda inputTabla" Value="@objetoCASA.CostesProduccion.Beneficio" ValueExpression="() => objetoCASA.CostesProduccion.Beneficio" ValueChanged="(value) => BeneficioCambiado(value)"></InputNumber> %
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold">
|
||||
Precio del trabajo profesional: <span>@objetoCASA.CostesProduccion.PrecioTrabProf.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold TotalesTabla tablaCACOA">
|
||||
Precio del trabajo profesional: <span>@objetoCASA.CostesProduccion.PrecioTrabProf.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div style="position:relative;margin-bottom: 15px;">
|
||||
@@ -53,7 +53,7 @@
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0" style="width: 100%;">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold TotalesTabla">
|
||||
<td colspan="2" class="text-end fw-bold TotalesTabla" style="font-size:14px;">
|
||||
Precio del encargo: <span>@objetoCASA.CostesProduccion.PrecioDelEncargo.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -53,7 +53,15 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<b>Costes variables</b>
|
||||
<div class="puntoInfo">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 25).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 25).Descripcion)
|
||||
}
|
||||
<b>Costes variables</b>
|
||||
|
||||
</div>
|
||||
<div class="pt-1 col-md-12 d-flex" style="gap: 40px; height:25px;">
|
||||
<div class="d-flex">
|
||||
|
||||
@@ -129,7 +137,14 @@
|
||||
</div>
|
||||
<div class="col-md-4" style="align-items: flex-end;">
|
||||
<div style="height: 49px;">
|
||||
<b>Coste hora Despacho Profesional</b>
|
||||
<div class="puntoInfo">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 26).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 26).Descripcion)
|
||||
}
|
||||
<b>Coste hora de los trabajos realizados por el despacho profesional</b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
@@ -173,8 +188,15 @@
|
||||
<div class="col-md-4">
|
||||
|
||||
<div style="height: 49px;">
|
||||
<div class="puntoInfo">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 27).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 27).Descripcion)
|
||||
}
|
||||
<b>Coste hora Externalización</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<thead>
|
||||
|
||||
@@ -5,14 +5,23 @@
|
||||
<div class="col-md-6 row">
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<tr>
|
||||
<td class="colorFilasIntro fw-bold w4">Plazo de presentación de la documentación:</td>
|
||||
<td class="colorFilasIntro fw-bold w4" style="width:43%;">
|
||||
|
||||
<div class="puntoInfo">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 28).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 28).Descripcion)
|
||||
}
|
||||
Plazo de presentación de la documentación:
|
||||
</div></td>
|
||||
<td class="text-end">
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<InputNumber TValue="double"
|
||||
@bind-Value="objetoCASA.CostesProduccion.PlazoPresentacionDocumentos"
|
||||
step="any"
|
||||
@oninput="e => controlarMeses(e.Value?.ToString())"
|
||||
class="inputForm formatoMoneda inputTabla text-end" />
|
||||
class="inputForm formatoMoneda inputTabla text-end" /> meses
|
||||
|
||||
</div>
|
||||
</td>
|
||||
@@ -83,7 +92,7 @@
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Trabajos</th>
|
||||
<th class="colorB fw-bold" style="width:80%">Trabajos</th>
|
||||
<th class="colorB fw-bold">Horas</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -95,12 +104,25 @@
|
||||
|
||||
<tr>
|
||||
<td class="colorB text-end">Horas de documentación en Despacho Profesional</td>
|
||||
<td class="text-start">@objetoCASA.CostesProduccion.HorasProduccionDespachoElabDocumentacion.MilesYDecimales() h</td>
|
||||
<td class="text-start">
|
||||
<div class="text-end" style="width:70px;">
|
||||
<span>
|
||||
@objetoCASA.CostesProduccion.HorasProduccionDespachoElabDocumentacion.MilesYDecimales()
|
||||
</span>
|
||||
<span>
|
||||
h
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB text-end">Horas de documentación mediante externalización</td>
|
||||
<td class="text-start">@objetoCASA.CostesProduccion.NumHorasMinimoExt.MilesYDecimales() h</td>
|
||||
<td class="text-start">
|
||||
<div style="max-width:70px;" class="text-end">
|
||||
@objetoCASA.CostesProduccion.NumHorasMinimoExt.MilesYDecimales() h
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -108,11 +130,14 @@
|
||||
<td class="text-end">@objetoCASA.TrabajoProfesional.HorasTPEDireccion.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorC fw-bold w4">HORAS TRABAJO PROFESIONAL</td>
|
||||
<td class="text-end">@objetoCASA.TrabajoProfesional.HorasTPE.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="TotalesTabla text-end fw-bold">Horas trabajo profesional @objetoCASA.TrabajoProfesional.TotalHorasTPE.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<TrabajadorGrid objetoCASA="objetoCASA"></TrabajadorGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="row mt-auto">
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<div class="row mt-auto" style="padding-top: 40px;">
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<table class="tablaAlter">
|
||||
<tr>
|
||||
<td class="tdAlter">COSTE/HORA DESPACHO PROFESIONAL: </td>
|
||||
<td class="tdAlineadoDerecha" style="font-weight:bold;">
|
||||
<td class="tdAlter TotalesTabla" style="width:320px">COSTE/HORA DESPACHO PROFESIONAL: </td>
|
||||
<td class="tdAlter TotalesTabla tdAlineadoDerecha" style="font-weight:bold;">
|
||||
@objetoCASA.DespachoProfesional.CosteHoraDespachoProfesional.MilesYDecimales() €/h
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -21,15 +21,23 @@ Height="100"
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="CASA.CosteIndirecto" HeaderText="Concepto" HeaderTextAlignment="Alignment.Center" PropertyName="Concepto" Class="colorFilasIntro">
|
||||
@context.Concepto
|
||||
<GridColumn TItem="CASA.CosteIndirecto" HeaderText="Concepto" HeaderTextAlignment="Alignment.Center" PropertyName="Concepto" Class="colorFilasIntro columna30Ancho">
|
||||
|
||||
<div class="puntoInfo">
|
||||
@if (context.idPuntoInformacion != 0 && !string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion)
|
||||
}
|
||||
@context.Concepto
|
||||
</div>
|
||||
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.CosteIndirecto" HeaderTextAlignment="Alignment.Center" Class="formatoMoneda columna30Ancho" HeaderText="Importe" PropertyName="importe">
|
||||
<div class="d-flex separadorMoneda">
|
||||
<CurrencyInput HideCurrencySymbol="true" TValue="double" Locale="es-ES" Min="0" class="inputForm formatoMoneda inputTabla" Value="@context.importe" ValueExpression="() => context.importe" ValueChanged="(value) => valorCambiado(value,context)"></CurrencyInput> €
|
||||
</div>
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end columna20Ancho" TItem="CASA.CosteIndirecto" HeaderText="Periocidad">
|
||||
<GridColumn Class="text-end columna20Ancho" TItem="CASA.CosteIndirecto" HeaderText="Periodicidad">
|
||||
@* @if (context != itemSeleccionado)
|
||||
{
|
||||
<span>@listadoPeriodos.FirstOrDefault(p => p.idEnumeracion == context.idPeriodicidad)?.ValorAlfabetico1</span>
|
||||
|
||||
@@ -18,7 +18,12 @@
|
||||
<BodyTemplate>
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos">
|
||||
<label class="tituloLbl">Denominación grupo:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 1).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 1).Descripcion)
|
||||
}
|
||||
Denominación grupo:</label>
|
||||
<InputText @bind-Value="itemSeleccionadoTemporal.Nombre" class="inputForm" list="sugerenciasGrupo"></InputText>
|
||||
|
||||
<datalist id="sugerenciasGrupo">
|
||||
@@ -31,14 +36,24 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">Coste anual:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 2).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 2).Descripcion)
|
||||
}
|
||||
Coste anual:</label>
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<NumberInput TValue="double" Min="0" @bind-Value="itemSeleccionadoTemporal.CosteAnual" class="inputForm derecha formatoMoneda"></NumberInput> €
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">Jornada laboral:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 3).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 3).Descripcion)
|
||||
}
|
||||
Jornada laboral:</label>
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<NumberInput TValue="double" Min="0" @bind-Value="itemSeleccionadoTemporal.JornadaLaboral" class="inputForm derecha"></NumberInput> h/sem
|
||||
</div>
|
||||
@@ -48,9 +63,10 @@
|
||||
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">
|
||||
<Tooltip Title=@tituloInfo class="custom-tooltip" role="button">
|
||||
<Icon Name="IconName.InfoCircleFill" Class="text-primary"></Icon>
|
||||
</Tooltip>
|
||||
@if (!string.IsNullOrEmpty( objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 4).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 4).Descripcion)
|
||||
}
|
||||
Porcentaje producción:
|
||||
</label>
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
@@ -60,7 +76,12 @@
|
||||
</div>
|
||||
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">Nº de trabajadores:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 5).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 5).Descripcion)
|
||||
}
|
||||
Nº de trabajadores:</label>
|
||||
<NumberInput TValue="double" Step="1" @oninput="EvitarDecimalesTrabajores" Min="0" @bind-Value="itemSeleccionadoTemporal.NumTrabajadores" class="inputForm derecha"></NumberInput>
|
||||
|
||||
</div>
|
||||
@@ -93,28 +114,33 @@
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Denominación del grupo" PropertyName="Nombre" Class="colorA">
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Denominación del grupo" PropertyName="Nombre" Class="colorA align-content-center">
|
||||
@context.Nombre
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" Class="formatoMoneda text-end" HeaderText="Coste anual" PropertyName="CosteAnual">
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" Class="formatoMoneda text-end align-content-center" HeaderText="Coste anual" PropertyName="CosteAnual">
|
||||
<span>@context.CosteAnual.MilesYDecimales() €</span>
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Jornada laboral" PropertyName="JornadaLaboral">
|
||||
<GridColumn Class="text-end align-content-center" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Jornada laboral" PropertyName="JornadaLaboral">
|
||||
@context.JornadaLaboral.MilesYDecimales() h
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Porcentaje producción" PropertyName="PorcentajeProduccion">
|
||||
<GridColumn Class="text-end align-content-center" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Porcentaje producción" PropertyName="PorcentajeProduccion">
|
||||
@context.PorcentajeProduccion %
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" TItem="CASA.Trabajador"HeaderTextAlignment="Alignment.Center" HeaderText="Nº de trabajadores" PropertyName="NumTrabajadores">
|
||||
<GridColumn Class="text-end align-content-center" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Nº de trabajadores" PropertyName="NumTrabajadores">
|
||||
@context.NumTrabajadores
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Coste Anual" PropertyName="CosteAnualTotal">
|
||||
<GridColumn Class="text-end align-content-center" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Coste Anual" PropertyName="CosteAnualTotal">
|
||||
@context.CosteAnualTotal.MilesYDecimales() €
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Horas Producción" PropertyName="HorasProduccion">
|
||||
@context.HorasProduccion.MilesYDecimales() h
|
||||
<GridColumn Class="text-end align-content-center" TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Horas Producción" PropertyName="HorasProduccion">
|
||||
<div class="d-flex flex-column">
|
||||
@context.HorasProduccion.MilesYDecimales() h
|
||||
|
||||
<span>@UtilidadesCASA.pasarHorasASemana(context.HorasProduccion).MilesYDecimales() semanas</span>
|
||||
</div>
|
||||
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.Trabajador" Class="botonesTabla" HeaderText="">
|
||||
<GridColumn TItem="CASA.Trabajador" Class="botonesTabla align-content-center" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
<span @onclick="@(() => abrirPopupGestionDatos(@context,false))" class="btnBorrarGuardar">
|
||||
<Icon CustomIconName="fas fa-edit"></Icon>
|
||||
@@ -127,7 +153,7 @@
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
<table class="table tablaCACOA mb-0" style="position:absolute;bottom:-50px;">
|
||||
<table class="table tablaCACOA mb-0" style="position:absolute;bottom:-60px;">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
@@ -137,7 +163,8 @@
|
||||
</div>
|
||||
<div>
|
||||
<span>Total Coste Anual: @objetoCASA.DespachoProfesional.CostesDirectosAnuales.MilesYDecimales() €</span><br />
|
||||
<span>Total Horas Producción: @objetoCASA.DespachoProfesional.HorasTotalesProduccion.MilesYDecimales() h</span>
|
||||
<span>Total Horas Producción: @objetoCASA.DespachoProfesional.HorasTotalesProduccion.MilesYDecimales() h</span><br />
|
||||
@* <span>Total semanas Producción: @UtilidadesCASA.pasarHorasASemana(objetoCASA.DespachoProfesional.HorasTotalesProduccion).MilesYDecimales() semanas</span> *@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -16,23 +16,26 @@
|
||||
<UsosTipologiaGrid objetoCASA="objetoCASA"></UsosTipologiaGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<CascadingValue Value="this">
|
||||
<FasesTrabajoProfesionalGrid objetoCASA="objetoCASA"></FasesTrabajoProfesionalGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-8">
|
||||
|
||||
<CascadingValue Value="this">
|
||||
<CoeficientesCorrectoresGrid objetoCASA="objetoCASA"></CoeficientesCorrectoresGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<div>
|
||||
<CascadingValue Value="this">
|
||||
<TablaHorasGrid objetoCASA="objetoCASA"></TablaHorasGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="col-md-4 ">
|
||||
<CascadingValue Value="this">
|
||||
<TablaHorasGrid inputsEditables="false" objetoCASA="objetoCASA"></TablaHorasGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="col-md-4 ">
|
||||
<CascadingValue Value="this">
|
||||
<TablaHorasGrid inputsEditables="true" objetoCASA="objetoCASA"></TablaHorasGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
}
|
||||
@if (modificarHoras)
|
||||
@@ -41,12 +44,12 @@
|
||||
<CascadingValue Value="this">
|
||||
<FasesTrabajoProfesionalGrid objetoCASA="objetoCASA"></FasesTrabajoProfesionalGrid>
|
||||
</CascadingValue>
|
||||
<CascadingValue Value="this">
|
||||
<TablaHorasGrid objetoCASA="objetoCASA"></TablaHorasGrid>
|
||||
</CascadingValue>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<CascadingValue Value="this">
|
||||
<TablaHorasGrid inputsEditables="true" objetoCASA="objetoCASA"></TablaHorasGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -82,11 +85,11 @@
|
||||
|
||||
public async void calcularModificarHora()
|
||||
{
|
||||
ultimaHoraDocumentacion = objetoCASA.TrabajoProfesional.HorasTPEDocumentacion;
|
||||
ultimaHoraObra = objetoCASA.TrabajoProfesional.HorasTPEDireccion;
|
||||
// ultimaHoraDocumentacion = objetoCASA.TrabajoProfesional.HorasTPEDocumentacion;
|
||||
// ultimaHoraObra = objetoCASA.TrabajoProfesional.HorasTPEDireccion;
|
||||
|
||||
objetoCASA.CalcularHorasTPEManual(objetoCASA.TrabajoProfesional.HorasTPEDocumentacion, objetoCASA.TrabajoProfesional.HorasTPEDireccion);
|
||||
horasTPEOriginal = objetoCASA.TrabajoProfesional.HorasTPE;
|
||||
// horasTPEOriginal = objetoCASA.TrabajoProfesional.HorasTPE;
|
||||
RefreshState();
|
||||
}
|
||||
|
||||
@@ -94,7 +97,7 @@
|
||||
public void restablecerHoras()
|
||||
{
|
||||
objetoCASA.TrabajoProfesional.HorasTPEDocumentacion= ultimaHoraDocumentacion;
|
||||
objetoCASA.TrabajoProfesional.HorasTPEDireccion = ultimaHoraObra;
|
||||
objetoCASA.TrabajoProfesional.HorasTPEDireccion = ultimaHoraObra;
|
||||
|
||||
objetoCASA.CalcularHorasTPEManual(objetoCASA.TrabajoProfesional.HorasTPEDocumentacion, objetoCASA.TrabajoProfesional.HorasTPEDireccion);
|
||||
horasTPEOriginal = objetoCASA.TrabajoProfesional.HorasTPE;
|
||||
|
||||
@@ -22,7 +22,15 @@
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="CASA.CoeficientesCorrectores" HeaderTextAlignment="Alignment.Center" HeaderText="Factores de Complejidad" PropertyName="Factores" Class="colorFilasIntro">
|
||||
<div class="puntoInfo">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion)
|
||||
}
|
||||
|
||||
@context.Nombre
|
||||
</div>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.CoeficientesCorrectores" HeaderText="">
|
||||
<InputSelect Value="@context.idCorrecion" class="inputForm selectTabla" ValueExpression="() => context.idCorrecion" TValue="int" ValueChanged="(value) => valorFCCambiado(value,context)">
|
||||
@@ -55,7 +63,14 @@
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="CASA.CoeficientesCorrectores" HeaderTextAlignment="Alignment.Center" HeaderText="Factores de Rendimiento" PropertyName="Factores" Class="colorFilasIntro">
|
||||
@context.Nombre
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion)
|
||||
}
|
||||
@context.Nombre
|
||||
</div>
|
||||
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.CoeficientesCorrectores" HeaderText="" >
|
||||
<InputSelect Value="@context.idCorrecion" class="inputForm selectTabla" ValueExpression="() => context.idCorrecion" TValue="int" ValueChanged="(value) => valorFRCambiado(value,context)">
|
||||
|
||||
@@ -4,7 +4,12 @@
|
||||
<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">
|
||||
<div><b>Fases</b></div>
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 12).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 12).Descripcion)
|
||||
}
|
||||
<b>Fases</b></div>
|
||||
</div>
|
||||
|
||||
<div style="position:relative;margin-bottom: 15px;">
|
||||
@@ -111,6 +116,7 @@
|
||||
else
|
||||
{
|
||||
objetoCASA.ActualizarFaseCalculo(_Parent.horasTPEOriginal);
|
||||
_Parent.calcularModificarHora();
|
||||
}
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
@@ -167,6 +173,7 @@
|
||||
// if (objetoCASA.TrabajoProfesional.HorasTPE != 0 && objetoCASA.TrabajoProfesional.HorasTPEDocumentacion != 0 && objetoCASA.TrabajoProfesional.HorasTPEDireccion != 0)
|
||||
// {
|
||||
// }
|
||||
// _Parent.calcularModificarHora();
|
||||
_Parent.restablecerHoras();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="margin-top:50px; width: 100%; display: flex;">
|
||||
<table class="tablaAlter">
|
||||
<div class="col-md-6" style="margin-top:50px; width:100%;">
|
||||
<div class="d-flex justify-content-between mt-3 mb-2">
|
||||
<div><b>@tituloTabla</b></div>
|
||||
</div>
|
||||
<table class="tablaAlter" style="width:100%">
|
||||
<tr>
|
||||
<td class="tdAlter"> HORAS TRABAJO PROFESIONAL EDIFICACIÓN: </td>
|
||||
<td class="@estiloTabla TotalesTabla"> HORAS TRABAJO PROFESIONAL EDIFICACIÓN: </td>
|
||||
|
||||
<td class="tdAlineadoDerecha" style="width: 30%; font-weight:bold;">
|
||||
@if (!_Parent.modificarHoras)
|
||||
<td class="@estiloTabla TotalesTabla tdAlineadoDerecha" style="width: 30%; font-weight:bold;">
|
||||
@if (!inputsEditables)
|
||||
{
|
||||
<span>
|
||||
@objetoCASA.TrabajoProfesional.TotalHorasTPE.MilesYDecimales() h
|
||||
@objetoCASA.TrabajoProfesional.HorasTPEEstimacion.MilesYDecimales() h
|
||||
</span>
|
||||
}
|
||||
else
|
||||
@@ -20,13 +23,13 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="TotalesTabla">Horas TPE Documentacion </td>
|
||||
<td class="TotalesTabla">Horas TPE Documentacion <span style="margin-left:60px;">@UtilidadesCASA.pasarHorasASemana(!inputsEditables ? objetoCASA.TrabajoProfesional.HorasTPEDocumentacionEstimacion : objetoCASA.TrabajoProfesional.HorasTPEDocumentacion).MilesYDecimales() semanas</span> </td>
|
||||
<td class="tdAlineadoDerecha TotalesTabla">
|
||||
|
||||
@if (!_Parent.modificarHoras)
|
||||
@if (!inputsEditables)
|
||||
{
|
||||
<span>
|
||||
@objetoCASA.TrabajoProfesional.HorasTPEDocumentacion.MilesYDecimales() h
|
||||
@objetoCASA.TrabajoProfesional.HorasTPEDocumentacionEstimacion.MilesYDecimales() h
|
||||
</span>
|
||||
}
|
||||
else
|
||||
@@ -41,10 +44,10 @@
|
||||
<td class="TotalesTabla">Horas TPE Dirección de obra </td>
|
||||
<td class="tdAlineadoDerecha TotalesTabla">
|
||||
|
||||
@if (!_Parent.modificarHoras)
|
||||
@if (!inputsEditables)
|
||||
{
|
||||
<span>
|
||||
@objetoCASA.TrabajoProfesional.HorasTPEDireccion.MilesYDecimales() h
|
||||
@objetoCASA.TrabajoProfesional.HorasTPEDireccionEstimacion.MilesYDecimales() h
|
||||
</span>
|
||||
}
|
||||
else
|
||||
@@ -63,9 +66,13 @@
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
public TrabajoProfesional _Parent { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool inputsEditables { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public CASA objetoCASA { get; set; } = new CASA();
|
||||
|
||||
// private string estiloTabla => _Parent.modificarHoras == true ? "" : "";
|
||||
|
||||
private string estiloTabla => inputsEditables == true ? "tdAlter" : "";
|
||||
private string tituloTabla => inputsEditables == true ? "Horas trabajo profesional Edificación" : "Estimación de horas necesarias";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,13 @@
|
||||
<BodyTemplate>
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Superficie:</label>
|
||||
<label class="tituloLbl">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 10).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 10).Descripcion)
|
||||
}
|
||||
Superficie:</label>
|
||||
<InputNumber TValue="double" @bind-Value="itemSeleccionadoTemporal.superficie"
|
||||
step="any"
|
||||
@oninput="e => ValidarYActualizar(e, nameof(itemSeleccionadoTemporal.superficie))"
|
||||
@@ -51,7 +57,12 @@
|
||||
</div>
|
||||
|
||||
<div class="col-12 formatoCampos pt2">
|
||||
<label class="tituloLbl">Intervención:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 11).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoCASA.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 11).Descripcion)
|
||||
}
|
||||
Intervención:</label>
|
||||
<InputSelect @bind-Value="@itemSeleccionadoTemporal.idTipoIntervencion" class="inputForm">
|
||||
@foreach (var intervencion in intervencionesAux)
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -54,7 +54,14 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<b>Costes variables</b>
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 50).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 50).Descripcion)
|
||||
}
|
||||
<b>Costes variables</b>
|
||||
|
||||
</div>
|
||||
<div class="pt-1 col-md-12 d-flex" style="gap: 40px; height:25px;">
|
||||
<div class="d-flex">
|
||||
|
||||
@@ -132,7 +139,13 @@
|
||||
</div>
|
||||
<div class="col-md-4" style="align-items: flex-end;">
|
||||
<div style="height: 49px;">
|
||||
<b>Coste hora Despacho Profesional</b>
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 51).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 51).Descripcion)
|
||||
}
|
||||
<b>Coste hora de los trabajos realizados por el despacho profesional</b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
@@ -147,16 +160,16 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">Costes directos</td>
|
||||
<td class="colorB w4">Costes directos</td>
|
||||
<td class="text-end">@objetoURBAN.DespachoProfesional.CostesDirectos.MilesYDecimales() €/hora</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold">Costes indirectos</td>
|
||||
<td class="colorB ">Costes indirectos</td>
|
||||
<td class="text-end">@objetoURBAN.DespachoProfesional.TasaCostesIndirectos.MilesYDecimales() €/hora</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colorB fw-bold">Costes variables</td>
|
||||
<td class="colorB ">Costes variables</td>
|
||||
<td class="text-end">@objetoURBAN.CostesProduccion.CostesVariables.MilesYDecimales() €/hora</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -174,8 +187,14 @@
|
||||
<div class="col-md-4">
|
||||
|
||||
<div style="height: 49px;">
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 52).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 52).Descripcion)
|
||||
}
|
||||
<b>Coste hora Externalización</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<thead>
|
||||
@@ -186,7 +205,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorFilasIntro fw-bold w4">Incremento por externalización</td>
|
||||
<td class="colorFilasIntro w4">Incremento por externalización</td>
|
||||
<td class="text-end">
|
||||
<div class="d-flex" style="gap:3px">
|
||||
<InputNumber TValue="double" Locale="es-ES" Min="0" class="inputForm formatoMoneda inputTabla" Value="@objetoURBAN.CostesProduccion.CoeficienteCostesExternalizacion" ValueExpression="() => objetoURBAN.CostesProduccion.CoeficienteCostesExternalizacion" ValueChanged="(value) => CosteExtCambiado(value)"></InputNumber> %
|
||||
|
||||
@@ -5,26 +5,27 @@
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 mt-3">
|
||||
<div style="height: 24px;">
|
||||
<div>
|
||||
<b>Costes Asociados a los Servicios de Arquitectura</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="tdAlter fw-bold w4" style="background:#ffc107;">COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL</td>
|
||||
<td class="text-end"><span> @objetoURBAN.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
<td class="tdAlter TotalesTabla fw-bold ">COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL</td>
|
||||
<td class=" tdAlter TotalesTabla text-end"><span> @objetoURBAN.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorFilasIntro w4"><b>Beneficio</b> (antes de impuestos)</td>
|
||||
<td class="text-end">
|
||||
<td class="TotalesTabla colorFilasIntro ">
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 54).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 54).Descripcion)
|
||||
}
|
||||
<b>Beneficio</b> (antes de impuestos)
|
||||
|
||||
</div></td>
|
||||
<td class="TotalesTabla text-end">
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<InputNumber TValue="double" Locale="es-ES" Min="0" class="inputForm formatoMoneda inputTabla" Value="@objetoURBAN.CostesProduccion.Beneficio" ValueExpression="() => objetoURBAN.CostesProduccion.Beneficio" ValueChanged="(value) => BeneficioCambiado(value)"></InputNumber> %
|
||||
</div>
|
||||
@@ -33,7 +34,7 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold">
|
||||
<td colspan="2" class="TotalesTabla text-end fw-bold">
|
||||
Precio del trabajo profesional: <span>@objetoURBAN.CostesProduccion.PrecioTrabajoProfesional.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -6,7 +6,15 @@
|
||||
<div class="col-md-6 row">
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<tr>
|
||||
<td class="colorFilasIntro fw-bold w4">Plazo de presentación de la documentación:</td>
|
||||
<td class="colorFilasIntro fw-bold w4">
|
||||
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 53).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 53).Descripcion)
|
||||
}
|
||||
Plazo de presentación de la documentación:
|
||||
</div></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="@objetoURBAN.CostesProduccion.PlazoPresentacionDocumentos" ValueExpression="() => objetoURBAN.CostesProduccion.PlazoPresentacionDocumentos" ValueChanged="(value) => PlazoPresentacionDocumentosCambiado(value)"></InputNumber> meses *@
|
||||
@@ -36,12 +44,12 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorB fw-bold">Horas en despacho profesional</td>
|
||||
<td class="colorB ">Horas en despacho profesional</td>
|
||||
<td class="text-end">@objetoURBAN.CostesProduccion.HorasEnPlazo.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold">Horas mediante externalización</td>
|
||||
<td class="colorB ">Horas mediante externalización</td>
|
||||
<td class="text-end">@objetoURBAN.CostesProduccion.NumHorasMinimoExt.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
@@ -53,7 +61,7 @@
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end colorC fw-bold w4 TotalesTabla">
|
||||
Total horas del trabajo profesional: <span>@objetoURBAN.CostesProduccion.HorasTrabajoProfesional.MilesYDecimales() h </span>
|
||||
Total horas del trabajo profesional: <span>@((objetoURBAN.CostesProduccion.HorasEnPlazo + objetoURBAN.CostesProduccion.NumHorasMinimoExt).MilesYDecimales()) h </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
@@ -21,15 +21,21 @@
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="CASA.CosteIndirecto" HeaderTextAlignment="Alignment.Center" HeaderText="Concepto" PropertyName="Concepto" Class="colorFilasIntro">
|
||||
<GridColumn TItem="CASA.CosteIndirecto" HeaderTextAlignment="Alignment.Center" HeaderText="Concepto" PropertyName="Concepto" Class="colorFilasIntro columna30Ancho">
|
||||
<div class="puntoInfo">
|
||||
@if (context.idPuntoInformacion != 0 && !string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == context.idPuntoInformacion).Descripcion)
|
||||
}
|
||||
@context.Concepto
|
||||
</div>
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.CosteIndirecto" HeaderTextAlignment="Alignment.Center" Class="formatoMoneda columna30Ancho" HeaderText="Importe" PropertyName="importe">
|
||||
<div class="d-flex separadorMoneda">
|
||||
<CurrencyInput HideCurrencySymbol="true" TValue="double" Locale="es-ES" Min="0" class="inputForm formatoMoneda inputTabla" Value="@context.importe" ValueExpression="() => context.importe" ValueChanged="(value) => valorCambiado(value,context)"></CurrencyInput> €
|
||||
</div>
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end columna20Ancho" HeaderTextAlignment="Alignment.Center" TItem="CASA.CosteIndirecto" HeaderText="Periocidad">
|
||||
<GridColumn Class="text-end columna20Ancho" HeaderTextAlignment="Alignment.Center" TItem="CASA.CosteIndirecto" HeaderText="Periodicidad">
|
||||
@* @if (context != itemSeleccionado)
|
||||
{
|
||||
<span>@listadoPeriodos.FirstOrDefault(p => p.idEnumeracion == context.idPeriodicidad)?.ValorAlfabetico1</span>
|
||||
|
||||
@@ -19,7 +19,12 @@
|
||||
<BodyTemplate>
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos">
|
||||
<label class="tituloLbl">Denominación grupo:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 37).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 37).Descripcion)
|
||||
}
|
||||
Denominación grupo:</label>
|
||||
<InputText @bind-Value="itemSeleccionadoTemporal.Nombre" class="inputForm" list="sugerenciasGrupo"></InputText>
|
||||
|
||||
<datalist id="sugerenciasGrupo">
|
||||
@@ -32,14 +37,25 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">Coste anual:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 38).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 38).Descripcion)
|
||||
}
|
||||
Coste anual:</label>
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<NumberInput TValue="double" Min="0" @bind-Value="itemSeleccionadoTemporal.CosteAnual" class="inputForm derecha formatoMoneda"></NumberInput> €
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">Jornada laboral:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 39).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 39).Descripcion)
|
||||
}
|
||||
Jornada laboral:
|
||||
</label>
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
<NumberInput TValue="double" Min="0" @bind-Value="itemSeleccionadoTemporal.JornadaLaboral" class="inputForm derecha"></NumberInput> h/sem
|
||||
</div>
|
||||
@@ -49,9 +65,10 @@
|
||||
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">
|
||||
<Tooltip Title=@tituloInfo class="custom-tooltip" role="button">
|
||||
<Icon Name="IconName.InfoCircleFill" Class="text-primary"></Icon>
|
||||
</Tooltip>
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 40).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 40).Descripcion)
|
||||
}
|
||||
Porcentaje producción:
|
||||
</label>
|
||||
<div class="d-flex" style="gap:3px;">
|
||||
@@ -61,7 +78,12 @@
|
||||
</div>
|
||||
|
||||
<div class="col-6 formatoCampos">
|
||||
<label class="tituloLbl">Nº de trabajadores:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 41).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 41).Descripcion)
|
||||
}
|
||||
Nº de trabajadores:</label>
|
||||
<NumberInput TValue="double" Step="1" @oninput="EvitarDecimalesTrabajores" Min="0" @bind-Value="itemSeleccionadoTemporal.NumTrabajadores" class="inputForm derecha"></NumberInput>
|
||||
|
||||
</div>
|
||||
@@ -94,26 +116,31 @@
|
||||
Responsive="true">
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Denominación del grupo" PropertyName="Nombre" Class="colorA">
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" HeaderText="Denominación del grupo" PropertyName="Nombre" Class="colorA align-content-center">
|
||||
@context.Nombre
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" Class="formatoMoneda text-end" HeaderText="Coste anual" PropertyName="CosteAnual">
|
||||
<GridColumn TItem="CASA.Trabajador" HeaderTextAlignment="Alignment.Center" Class="formatoMoneda text-end align-content-center" HeaderText="Coste anual" PropertyName="CosteAnual">
|
||||
<span>@context.CosteAnual.MilesYDecimales() €</span>
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Jornada laboral" PropertyName="JornadaLaboral">
|
||||
<GridColumn Class="text-end align-content-center" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Jornada laboral" PropertyName="JornadaLaboral">
|
||||
@context.JornadaLaboral.MilesYDecimales() h
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Porcentaje producción" PropertyName="PorcentajeProduccion">
|
||||
<GridColumn Class="text-end align-content-center" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Porcentaje producción" PropertyName="PorcentajeProduccion">
|
||||
@context.PorcentajeProduccion %
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Nº de trabajadores" PropertyName="NumTrabajadores">
|
||||
<GridColumn Class="text-end align-content-center" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Nº de trabajadores" PropertyName="NumTrabajadores">
|
||||
@context.NumTrabajadores
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Coste Anual" PropertyName="CosteAnualTotal">
|
||||
<GridColumn Class="text-end align-content-center" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Coste Anual" PropertyName="CosteAnualTotal">
|
||||
@context.CosteAnualTotal.MilesYDecimales() €
|
||||
</GridColumn>
|
||||
<GridColumn Class="text-end" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Horas Producción" PropertyName="HorasProduccion">
|
||||
@context.HorasProduccion.MilesYDecimales() h
|
||||
<GridColumn Class="text-end align-content-center" HeaderTextAlignment="Alignment.Center" TItem="CASA.Trabajador" HeaderText="Horas Producción" PropertyName="HorasProduccion">
|
||||
<div class="d-flex flex-column">
|
||||
@context.HorasProduccion.MilesYDecimales() h
|
||||
|
||||
<span>@UtilidadesCASA.pasarHorasASemana(context.HorasProduccion).MilesYDecimales() semanas</span>
|
||||
</div>
|
||||
|
||||
</GridColumn>
|
||||
<GridColumn TItem="CASA.Trabajador" Class="botonesTabla" HeaderText="">
|
||||
<div class="btnTablasEspaciado">
|
||||
@@ -128,7 +155,7 @@
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
<table class="table tablaCACOA mb-0" style="position:absolute;bottom:-50px;">
|
||||
<table class="table tablaCACOA mb-0" style="position:absolute;bottom:-60px;">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
@@ -139,6 +166,7 @@
|
||||
<div>
|
||||
<span>Total Coste Anual: @objetoURBAN.DespachoProfesional.CostesDirectosAnuales.MilesYDecimales() €</span><br />
|
||||
<span>Total Horas Producción: @objetoURBAN.DespachoProfesional.HorasTotalesProduccion.MilesYDecimales() h</span>
|
||||
@* <span>Total semanas Producción: @UtilidadesCASA.pasarHorasASemana(objetoURBAN.DespachoProfesional.HorasTotalesProduccion).MilesYDecimales() semanas</span> *@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -24,24 +24,24 @@
|
||||
<HerramientaCASA.Components.Pages.HerramientaURBANTabs.DespachoProfURBAN.TrabajadorGridURBAN objetoURBAN="objetoURBAN"></HerramientaCASA.Components.Pages.HerramientaURBANTabs.DespachoProfURBAN.TrabajadorGridURBAN>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="row mt-auto">
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<div class="row mt-auto" style="padding-top: 40px;">
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<table class="tablaAlter">
|
||||
<tr>
|
||||
<td class="tdAlter">COSTE/HORA DESPACHO PROFESIONAL: </td>
|
||||
<td class="tdAlineadoDerecha" style="font-weight:bold;">
|
||||
<td class="tdAlter TotalesTabla" style="width: 320px;">COSTE/HORA DESPACHO PROFESIONAL: </td>
|
||||
<td class="tdAlter TotalesTabla tdAlineadoDerecha" style="font-weight:bold;">
|
||||
@objetoURBAN.DespachoProfesional.CosteHoraDespachoProfesional.MilesYDecimales() €/h
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="TotalesTabla">Costes directos </td>
|
||||
<td class="tdAlineadoDerecha TotalesTabla">
|
||||
<td class="TotalesTabla tdAlineadoDerecha TotalesTabla">
|
||||
@objetoURBAN.DespachoProfesional.CostesDirectos.MilesYDecimales() €/h
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="TotalesTabla">Costes indirectos</td>
|
||||
<td class="tdAlineadoDerecha TotalesTabla">
|
||||
<td class="TotalesTabla tdAlineadoDerecha TotalesTabla">
|
||||
@objetoURBAN.DespachoProfesional.TasaCostesIndirectos.MilesYDecimales() €/h
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -3,33 +3,72 @@
|
||||
@inject NavigationManager Navigation
|
||||
@using HerramientaCASA.Components.Pages.HerramientaURBANTabs.TrabajoProfURBAN
|
||||
@using bdHerramientaCACOA.HerramientaURBAN
|
||||
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-md-12 mt-3 mb-3">
|
||||
<div class="col-md-12 d-flex mt-3" style="gap: 40px;">
|
||||
<RadioInput style="margin-right: 10px;" Label="Cálculo por tipo de documento" Value="modificarTabla" ValueExpression="() => modificarTabla" ValueChanged="(value) => modificarTablaChanged(value)" />
|
||||
<RadioInput style="margin-right: 10px;" Label="Cálculo por tiempo" Value="modificarHoras" ValueExpression="() => modificarHoras" ValueChanged="(value) => modificarHorasChanged(value)" />
|
||||
</div>
|
||||
@if (modificarTabla)
|
||||
{
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-md-12 mt-4 mb-3">
|
||||
<CascadingValue Value="this">
|
||||
<DocumentosURBAN objetoURBAN="objetoURBAN"></DocumentosURBAN>
|
||||
<DocumentosURBAN objetoURBAN="objetoURBAN"></DocumentosURBAN>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-md-4">
|
||||
<CascadingValue Value="this">
|
||||
<FasesURBAN objetoURBAN="objetoURBAN"></FasesURBAN>
|
||||
</CascadingValue>
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-md-4">
|
||||
<CascadingValue Value="this">
|
||||
<FasesURBAN @ref=fasesRef objetoURBAN="objetoURBAN"></FasesURBAN>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<CascadingValue Value="this">
|
||||
<InstrumentosURBAN objetoURBAN="objetoURBAN"></InstrumentosURBAN>
|
||||
</CascadingValue>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<CascadingValue Value="this">
|
||||
<InstrumentosURBAN objetoURBAN="objetoURBAN"></InstrumentosURBAN>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-md-3">
|
||||
<CascadingValue Value="this">
|
||||
<FasesURBAN @ref=fasesRef objetoURBAN="objetoURBAN"></FasesURBAN>
|
||||
</CascadingValue>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 mt-4">
|
||||
<table class="tablaAlter mt-4" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="TotalesTabla tdAlter" style="width:50%;">HORAS TRABAJO PROFESIONAL URBANISMO: </td>
|
||||
<td class="TotalesTabla tdAlineadoDerecha">
|
||||
<div class=" d-flex">
|
||||
<InputNumber TValue="double" @onblur="CalcularWea" @bind-Value="@objetoURBAN.TrabajoProfesional.horasTrabProfesional" Min="0" class="inputForm inputTabla tdAlineadoDerecha" />h
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public URBAN objetoURBAN { get; set; } = new URBAN();
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
public bool modificarTabla = true;
|
||||
public bool modificarHoras = false;
|
||||
|
||||
private FasesURBAN fasesRef;
|
||||
|
||||
|
||||
// List<URBAN.DocumentacionURBAN> listadoAuxiliarDocusOpci = new List<URBAN.DocumentacionURBAN>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -39,4 +78,56 @@
|
||||
{
|
||||
this.StateHasChanged();
|
||||
}
|
||||
|
||||
private async void modificarTablaChanged(bool res)
|
||||
{
|
||||
// objetoCASA.TrabajoProfesional.HorasTPE = 0;
|
||||
// objetoCASA.TrabajoProfesional.HorasTPEDocumentacion = 0;
|
||||
// objetoCASA.TrabajoProfesional.HorasTPEDireccion = 0;
|
||||
|
||||
// if (objetoCASA.TrabajoProfesional.Usos.ToList().Count() != 0)
|
||||
// {
|
||||
// objetoCASA.CalcularHorasTPE();
|
||||
// }
|
||||
|
||||
/////// Se puso para cuando se cambie a esto que no cuente lo de la otra parte.
|
||||
// objetoURBAN.TrabajoProfesional.DocumentacionOpcional = listadoAuxiliarDocusOpci.ToList();
|
||||
|
||||
// fasesRef.restablecerValores();
|
||||
|
||||
modificarTabla = res;
|
||||
modificarHoras = !res;
|
||||
objetoURBAN.TrabajoProfesional.EsPorUsos = true;
|
||||
//objetoLicitaciones.CalcularHorasSuperficie();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
private async void modificarHorasChanged(bool res)
|
||||
{
|
||||
// horasTPEOriginal = objetoCASA.TrabajoProfesional.HorasTPE;
|
||||
// ultimaHoraDocumentacion = objetoCASA.TrabajoProfesional.HorasTPEDocumentacion;
|
||||
// ultimaHoraObra = objetoCASA.TrabajoProfesional.HorasTPEDireccion;
|
||||
|
||||
/////// Se puso para cuando se cambie a esto que no cuente lo de la otra parte.
|
||||
// listadoAuxiliarDocusOpci = new List<URBAN.DocumentacionURBAN>(objetoURBAN.TrabajoProfesional.DocumentacionOpcional);
|
||||
|
||||
// objetoURBAN.TrabajoProfesional.DocumentacionOpcional.Clear();
|
||||
|
||||
// await InvokeAsync(StateHasChanged);
|
||||
|
||||
// if (fasesRef != null)
|
||||
// {
|
||||
// fasesRef.restablecerValores();
|
||||
// }
|
||||
|
||||
modificarHoras = res;
|
||||
modificarTabla = !res;
|
||||
objetoURBAN.TrabajoProfesional.EsPorUsos = false;
|
||||
//objetoLicitaciones.CalcularHorasSuperficie();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
public async void CalcularWea()
|
||||
{
|
||||
objetoURBAN.CalcularCostesProduccion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,15 @@
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Documentación Mínima:</label>
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 46).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 46).Descripcion)
|
||||
}
|
||||
Documentación Mínima:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoURBAN.TrabajoProfesional.DocumentacionMinima"
|
||||
@@ -46,8 +52,13 @@
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Documentación Opcional:</label>
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 63).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 63).Descripcion)
|
||||
}
|
||||
Documentación Opcional:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoURBAN.TrabajoProfesional.DocumentacionOpcional"
|
||||
@@ -71,8 +82,13 @@
|
||||
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Datos Necesarios:</label>
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 47).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 47).Descripcion)
|
||||
}
|
||||
Datos Necesarios:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoURBAN.TrabajoProfesional.DatosNecesarios"
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
<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">
|
||||
<div><b>Fases</b></div>
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 48).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 48).Descripcion)
|
||||
}
|
||||
<b>Fases</b></div>
|
||||
</div>
|
||||
|
||||
<div style="position:relative;margin-bottom: 35px;">
|
||||
@@ -141,7 +146,7 @@
|
||||
return porcentajeTotal;
|
||||
}
|
||||
|
||||
private async void restablecerValores()
|
||||
public async void restablecerValores()
|
||||
{
|
||||
var lista = JsonSerializer.Deserialize<List<URBAN.FasesURBAN>>(JsonSerializer.Serialize(objetoURBAN.Enumerados.FasesTrabajo));
|
||||
objetoURBAN.TrabajoProfesional.FasesTrabajoProfesional = lista;
|
||||
|
||||
@@ -9,8 +9,13 @@
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
<div>
|
||||
<div class="mt-3 mb-3"><b>Innovacion de los instrumentos</b></div>
|
||||
<p class="col-6">
|
||||
<div class="mt-3 mb-3 puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 49).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 49).Descripcion)
|
||||
}
|
||||
<b>Innovacion de los instrumentos</b></div>
|
||||
<p class="mt-2">
|
||||
@* @if (!nuevaRedaccion)
|
||||
{ *@
|
||||
<InputNumber TValue="double" Value="@objetoURBAN.TrabajoProfesional.valorInstrumentos"
|
||||
@@ -36,11 +41,28 @@
|
||||
}
|
||||
<table class="tablaAlter mt-4" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="tdAlter" style="width:50%;">HORAS TRABAJO PROFESIONAL URBANISMO: </td>
|
||||
<td class="tdAlineadoDerecha">@objetoURBAN.TrabajoProfesional.horasTrabProfesional.MilesYDecimales() h</td>
|
||||
<td class=" TotalesTabla" style="width: 70%;">Estimación de horas necesarias: </td>
|
||||
<td class=" TotalesTabla tdAlineadoDerecha">@objetoURBAN.TrabajoProfesional.horasTrabProfesionalEstimacion.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="TotalesTabla tdAlter" style="width:50%;">Horas del trabajo profesional Urbanismo: </td>
|
||||
<td class="TotalesTabla tdAlineadoDerecha">
|
||||
<div class=" d-flex">
|
||||
<InputNumber TValue="double" @onblur="_Parent.CalcularWea" @bind-Value="@objetoURBAN.TrabajoProfesional.horasTrabProfesional" Min="0" class="inputForm inputTabla tdAlineadoDerecha" />h
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="TotalesTabla" style="width:50%;"></td>
|
||||
<td class="TotalesTabla tdAlineadoDerecha">
|
||||
<div class="text-end">
|
||||
<span>@UtilidadesCASA.pasarHorasASemana(objetoURBAN.TrabajoProfesional.horasTrabProfesional).MilesYDecimales() semanas</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="position:relative;margin-bottom: 15px;">
|
||||
|
||||
@@ -1,21 +1,33 @@
|
||||
<div id="DespachoImprimir" class="d-flex flex-column align-items-center">
|
||||
<div id="DespachoImprimir" class="pagePrincipal d-flex flex-column align-items-center">
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
<div class="mb-4 col-8 mx-auto justify-content-center d-flex">
|
||||
<label style="color: #078b98 !important"><b>Despacho Profesional</b></label>
|
||||
@* ENCABEZADO DE LA PAGINA *@
|
||||
<div class="EncabezadoImprimir">
|
||||
<p>
|
||||
@msTextoEncabezado
|
||||
</p>
|
||||
|
||||
<div class="mt-3">
|
||||
<label>Simulación: <span class="NombreSimulacionImprimir">@objetoCASA.NombreSimulacion</span></label>
|
||||
<br />
|
||||
<label>Fecha de creación: <span class="NombreSimulacionImprimir">@DateTime.Now</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 mx-auto" style="align-items: flex-end;">
|
||||
<div style="height: 49px;">
|
||||
<b>Coste hora Despacho Profesional</b>
|
||||
|
||||
@* TABLA COSTE HORA DESPACHO PROFESIONAL *@
|
||||
|
||||
<div class="col-8 mx-auto" style="align-items: flex-end; margin-bottom:30px;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Coste hora de los trabajos realizados por el despacho profesional</b>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Tipo de costes</th>
|
||||
<th class="colorB fw-bold">Coste/hora</th>
|
||||
<th>Tipo de costes</th>
|
||||
<th>Coste/hora</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -37,7 +49,7 @@
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
<div style="height:28px; align-content:center;">
|
||||
Total Coste hora Despacho Profesional: <span> @objetoCASA.CostesProduccion.TotalCostes.MilesYDecimales() €/hora</span>
|
||||
Coste hora Despacho Profesional: <span> @objetoCASA.CostesProduccion.TotalCostes.MilesYDecimales() €/hora</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -46,17 +58,20 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@* TABLA COSTE HORA EXTERNALIZACION *@
|
||||
|
||||
<div class="col-8 mx-auto">
|
||||
|
||||
<div style="height: 49px;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Coste hora Externalización</b>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Externalización</th>
|
||||
<th class="colorB fw-bold">Porcentaje</th>
|
||||
<th width="75%">Externalización</th>
|
||||
<th>Porcentaje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -64,7 +79,7 @@
|
||||
<td class="colorFilasIntro w4">Incremento por externalización</td>
|
||||
<td class="text-end">
|
||||
<span>
|
||||
@objetoCASA.CostesProduccion.CoeficienteCostesExternalizacion
|
||||
@objetoCASA.CostesProduccion.CoeficienteCostesExternalizacion %
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -81,32 +96,31 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
<div class="mb-4 col-11 mx-auto justify-content-center d-flex">
|
||||
<label style="color: #078b98 !important"><b>Trabajo Profesional</b></label>
|
||||
</div>
|
||||
|
||||
@if (objetoCASA.TrabajoProfesional.Usos.Count != 0)
|
||||
{
|
||||
<div class="col-11 mx-auto" style="align-items: flex-end;">
|
||||
<div style="height: 49px;">
|
||||
<b>Usos/Tipologías</b>
|
||||
</div>
|
||||
@* TABLA USOS/TIPOLOGIAS *@
|
||||
|
||||
<div class="table-responsive">
|
||||
<div class="col-11 mx-auto" style="align-items: flex-end;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Usos/Tipologías</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Superficie</th>
|
||||
<th class="colorB fw-bold">Usos</th>
|
||||
<th class="colorB fw-bold">Tipología</th>
|
||||
<th class="colorB fw-bold">Intervención</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach(var uso in objetoCASA.TrabajoProfesional.Usos){
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="15%">Superficie (m²)</th>
|
||||
<th width="20%">Usos</th>
|
||||
<th width="35%">Tipología</th>
|
||||
<th width="30%">Intervención</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (totalUsos != 0)
|
||||
{
|
||||
@foreach (var uso in objetoCASA.TrabajoProfesional.Usos)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-end">@uso.superficie.MilesYDecimales()</td>
|
||||
<td>@objetoCASA.Enumerados.GruposTipologias?.FirstOrDefault(x => x.idEnumeracion == uso.idGrupoTipologia)?.ValorAlfabetico1</td>
|
||||
@@ -114,183 +128,194 @@
|
||||
<td>@objetoCASA.Enumerados.Intervenciones?.FirstOrDefault(x => x.idEnumeracion == uso.idTipoIntervencion)?.ValorAlfabetico1</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<td colspan="4" class="text-end fw-bold colorC TotalesTabla">
|
||||
<div style="height:28px; align-content:center;">
|
||||
Total superficie: <span> @objetoCASA.TrabajoProfesional.Usos.Sum(x=>x.superficie).MilesYDecimales()</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="4" class="text-center">No hay registros</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
<div class="col-10 mx-auto" style="align-items: flex-end;">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="col-md-10">
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="colorFilasIntro fw-bold">Plazo de presentación de la documentación:</td>
|
||||
<td class="text-end">
|
||||
<span class="inputForm formatoMoneda text-end">@objetoCASA.CostesProduccion.PlazoPresentacionDocumentos</span>
|
||||
<td colspan="4" class="fw-bold colorC TotalesTabla">
|
||||
<div style="height:28px;">
|
||||
Total superficie: <span> @objetoCASA.TrabajoProfesional.Usos.Sum(x => x.superficie).MilesYDecimales() m²</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="mb-3" style="height:20px;">
|
||||
@if (objetoCASA.CostesProduccion.IncrementoUrgencia > 0)
|
||||
{
|
||||
<label style="font-size:10px;">Incremento del @objetoCASA.CostesProduccion.IncrementoUrgencia% en los costes de producción de la documentación por plazo de presentación reducido</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-10 mx-auto d-flex justify-content-center" style="align-items: flex-end;">
|
||||
|
||||
<div class="col-10 mx-auto d-flex justify-content-center" style="@estiloTrabajos">
|
||||
<div class="col-md-10 row ">
|
||||
<div style="height: 49px;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Trabajo profesional</b>
|
||||
</div>
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
|
||||
@* PLAZO DE PRESENTACION *@
|
||||
<div style="font-size:9pt;" class="fw-bold">
|
||||
<label>Plazo de presentación de la documentación: <span>@objetoCASA.CostesProduccion.PlazoPresentacionDocumentos meses</span></label>
|
||||
</div>
|
||||
<div class="mb-3" style="height:20px;">
|
||||
@if (objetoCASA.CostesProduccion.IncrementoUrgencia > 0)
|
||||
{
|
||||
<label style="font-size:10px;">Incremento del @objetoCASA.CostesProduccion.IncrementoUrgencia% en los costes de producción de la documentación por plazo de presentación reducido</label>
|
||||
}
|
||||
</div>
|
||||
|
||||
@* TABLA TRABAJO/HORA *@
|
||||
|
||||
<table class="TablaImprimir mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold w-75">Trabajos</th>
|
||||
<th class="colorB fw-bold ">Horas</th>
|
||||
<th>Trabajos</th>
|
||||
<th>Horas</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorB fw-bold">Horas elaboración documentación</td>
|
||||
<td>Horas elaboración documentación</td>
|
||||
<td class="text-end">@objetoCASA.TrabajoProfesional.HorasTPEDocumentacion.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB text-end">Horas de documentación en Despacho Profesional</td>
|
||||
<td class="text-end">Horas de documentación en Despacho Profesional</td>
|
||||
<td class="text-start">@objetoCASA.CostesProduccion.HorasProduccionDespachoElabDocumentacion.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB text-end">Horas de documentación mediante externalización</td>
|
||||
<td class="text-end">Horas de documentación mediante externalización</td>
|
||||
<td class="text-start">@objetoCASA.CostesProduccion.NumHorasMinimoExt.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold">Horas de dirección de obra</td>
|
||||
<td>Horas de dirección de obra</td>
|
||||
<td class="text-end">@objetoCASA.TrabajoProfesional.HorasTPEDireccion.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorC fw-bold w4">HORAS TRABAJO PROFESIONAL</td>
|
||||
<td class="text-end">@objetoCASA.TrabajoProfesional.HorasTPE.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="TotalesTabla text-end fw-bold">Horas trabajo profesional @objetoCASA.TrabajoProfesional.TotalHorasTPE.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
<div class="mb-4 col-8 mx-auto justify-content-center d-flex">
|
||||
<label style="color: #078b98 !important"><b>Costes de Producción</b></label>
|
||||
</div>
|
||||
<div class="col-12 mx-auto" >
|
||||
@* TABLA COSTES ASOCIADOS A LOS SEVICIOS DE ARQUITECTURA *@
|
||||
|
||||
<div class="col-8 mx-auto">
|
||||
|
||||
<div style="height: 49px;">
|
||||
<b>Costes Asociados a los Servicios de Arquitectura</b>
|
||||
<div class="col-8 mx-auto" style=" margin-top:70px;">
|
||||
<div class="TituloTablaImprimir">
|
||||
</div>
|
||||
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<div class="TituloTablaImprimir" style=" margin-top:70px;">
|
||||
<p>
|
||||
<b>Costes Asociados a los Servicios de Arquitectura</b>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<thead>
|
||||
<table class="tablaAlter" style="width:100%;">
|
||||
<tbody style="font-size:9pt;">
|
||||
<tr>
|
||||
<th class="colorB fw-bold w-75">Concepto</th>
|
||||
<th class="colorB fw-bold text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="tdAlter fw-bold " style="background:#ffc107;">COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL</td>
|
||||
<td class="text-end"><span> @objetoCASA.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
</tr>
|
||||
<td class="TotalesTabla" > COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL: </td>
|
||||
|
||||
<td class=" TotalesTabla tdAlineadoDerecha" style="width: 30%;">
|
||||
@objetoCASA.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colorFilasIntro w4"><b>Beneficio</b> (antes de impuestos)</td>
|
||||
<td class="text-end">
|
||||
<span class="inputForm formatoMoneda">@objetoCASA.CostesProduccion.Beneficio </span>
|
||||
<td class="TotalesTabla">Beneficio <span style="font-size:7pt;">(antes de impuestos)</span> </td>
|
||||
<td class="tdAlineadoDerecha TotalesTabla">
|
||||
<div class="justify-content-end" style="gap:3px;">
|
||||
<span>@objetoCASA.CostesProduccion.Beneficio %</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tfoot style=" border-top: 1px solid black;">
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold">
|
||||
<td colspan="2" class="text-end fw-bold TotalesTabla tablaCACOA">
|
||||
Precio del trabajo profesional: <span>@objetoCASA.CostesProduccion.PrecioTrabProf.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@* TABLA OTROS TRABAJOS INCLUIDOS EN EL ENCARGO *@
|
||||
@if (objetoCASA.CostesProduccion.OtrosTrabajos.Count != 0)
|
||||
{
|
||||
<div class="col-8 mx-auto">
|
||||
|
||||
<div style="height: 49px;">
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Otros trabajos incluidos en el Encargo</b>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Encargo</th>
|
||||
<th class="colorB fw-bold">Precio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Encargo</th>
|
||||
<th >Precio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach (var otroTrabajo in objetoCASA.CostesProduccion.OtrosTrabajos)
|
||||
{
|
||||
<tr>
|
||||
{
|
||||
<tr>
|
||||
<td>@otroTrabajo.Denominacion</td>
|
||||
<td class="text-end">@otroTrabajo.Coste.MilesYDecimales()</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<td class="text-end">@otroTrabajo.Coste.MilesYDecimales() €</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot style=" border-top: 1px solid black;">
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
<div class="d-flex justify-content-end">
|
||||
<div style="align-self: center;">
|
||||
Total Otros trabajos:
|
||||
<span> @objetoCASA.CostesProduccion.TotalOtrosTrabajos.MilesYDecimales() €</span>
|
||||
<span> @objetoCASA.CostesProduccion.TotalOtrosTrabajos.MilesYDecimales() €</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold TotalesTabla" style="background: #ffc107;">
|
||||
<tr style=" border-bottom: 1px solid black;">
|
||||
<td colspan="2" style="font-size:10pt;" class="text-end fw-bold TotalesTabla">
|
||||
Precio del encargo: <span>@objetoCASA.CostesProduccion.PrecioDelEncargo.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="FooterImprimir">
|
||||
|
||||
<p>
|
||||
@mspie1
|
||||
</p>
|
||||
<p>
|
||||
@mspie2
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -300,11 +325,32 @@
|
||||
[Parameter]
|
||||
public bdHerramientaCACOA.CASA objetoCASA { get; set; } = new bdHerramientaCACOA.CASA();
|
||||
|
||||
public int totalUsos = 0;
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
public string estiloTrabajos = "";
|
||||
|
||||
|
||||
MarkupString msTextoEncabezado => (MarkupString)textoEncabezado;
|
||||
MarkupString mspie1 => (MarkupString)pie1;
|
||||
MarkupString mspie2 => (MarkupString)pie2;
|
||||
|
||||
string textoEncabezado = "";
|
||||
string pie1 = "";
|
||||
string pie2 = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
totalUsos = objetoCASA.TrabajoProfesional.Usos.Count;
|
||||
|
||||
estiloTrabajos = objetoCASA.TrabajoProfesional.Usos.Count != 0 ? "align-items: flex-end; margin-top:50px;" : "align-items: flex-end; margin-top:150px;";
|
||||
|
||||
textoEncabezado = bd.enumeraciones.First(x => x.Codigo.Contains("PDFCASA")).ValorAlfabeticoLargo;
|
||||
|
||||
pie1 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE1")).ValorAlfabeticoLargo;
|
||||
pie2 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE2")).ValorAlfabeticoLargo;
|
||||
}
|
||||
public void RefreshState()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,519 @@
|
||||
@using System.Globalization
|
||||
@using bdHerramientaCACOA.HerramientaURBAN
|
||||
<div id="DespachoURBANImprimir" class="d-flex flex-column align-items-center pagePrincipal">
|
||||
@* DESPACHO URBAN*@
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
@* ENCABEZADO DE LA PAGINA *@
|
||||
<div class="EncabezadoImprimir">
|
||||
<p>
|
||||
@msTextoEncabezado
|
||||
|
||||
</p>
|
||||
|
||||
<div class="d-flex flex-column mt-3">
|
||||
<label>Simulación: <span class="NombreSimulacionImprimir">@objetoURBAN.NombreSimulacion</span></label>
|
||||
<br />
|
||||
<label>Fecha de creación: <span class="NombreSimulacionImprimir">@DateTime.Now</span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* COSTE HORA DE LOS TRABAJOS *@
|
||||
<div class="col-8 mx-auto" style="align-items: flex-end;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Coste hora de los trabajos realizados por el despacho profesional</b>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tipo de costes</th>
|
||||
<th>Coste/hora</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorB w4">Costes directos</td>
|
||||
<td class="text-end">@objetoURBAN.DespachoProfesional.CostesDirectos.MilesYDecimales() €/hora</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB ">Costes indirectos</td>
|
||||
<td class="text-end">@objetoURBAN.DespachoProfesional.TasaCostesIndirectos.MilesYDecimales() €/hora</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colorB ">Costes variables</td>
|
||||
<td class="text-end">@objetoURBAN.CostesProduccion.CostesVariables.MilesYDecimales() €/hora</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
<div style="height:28px; align-content:center;">
|
||||
Total Coste hora Despacho Profesional: <span> @objetoURBAN.CostesProduccion.TotalCostes.MilesYDecimales() €/hora</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* COSTE HORA EXTERNALIZACION *@
|
||||
<div class="col-8 mx-auto" style="margin-top:50px;">
|
||||
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Coste hora Externalización</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Externalización</th>
|
||||
<th class="colorB fw-bold">Porcentaje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorFilasIntro w4">Incremento por externalización</td>
|
||||
<td class="text-end">
|
||||
<span>
|
||||
@objetoURBAN.CostesProduccion.CoeficienteCostesExternalizacion %
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
Coste hora Externalización: <span> @objetoURBAN.CostesProduccion.CosteHoraExternalizacion.MilesYDecimales() €/hora</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* TRABAJAO PROFESIONAL *@
|
||||
<div class="@separacionTabla">
|
||||
<div class="col-8 mx-auto" style="margin-top:50px;">
|
||||
|
||||
<div class="table-responsive espacioTablas">
|
||||
@* <div class="formatoCampos pt-2" style="font-size:9pt;">
|
||||
<label class="tituloLbl">Tipo de Documento:</label>
|
||||
@if (objetoURBAN.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@CultureInfo.CurrentCulture.TextInfo.ToTitleCase(@objetoURBAN.Enumerados.TiposDeDocumentos.First(x => x.idEnumeracion == objetoURBAN.TrabajoProfesional.idTipoDocumentacion).Descripcion.ToLower())</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</div>
|
||||
<div class="formatoCampos pt-2" style="font-size:9pt;">
|
||||
<label class="tituloLbl">Documento:</label>
|
||||
@if (objetoURBAN.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@objetoURBAN.Enumerados.ProyectosPorTipo(objetoURBAN.TrabajoProfesional.idTipoDocumentacion).First(x => x.idtipoproyectos == objetoURBAN.TrabajoProfesional.idTipoProyecto).Descripcion</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</div> *@
|
||||
|
||||
<table class="mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th >Tipo de Documento:</th>
|
||||
<th>Documento:</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="text-end">
|
||||
@if (objetoURBAN.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@CultureInfo.CurrentCulture.TextInfo.ToTitleCase(@objetoURBAN.Enumerados.TiposDeDocumentos.First(x => x.idEnumeracion == objetoURBAN.TrabajoProfesional.idTipoDocumentacion).Descripcion.ToLower())</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
@if (objetoURBAN.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@objetoURBAN.Enumerados.ProyectosPorTipo(objetoURBAN.TrabajoProfesional.idTipoDocumentacion).First(x => x.idtipoproyectos == objetoURBAN.TrabajoProfesional.idTipoProyecto).Descripcion</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@* TABLAS DE DATOS MINIMOS Y OPCIONALES *@
|
||||
<div class="col-11 mx-auto" style="margin-top:50px;">
|
||||
@* TABLA DE DATOS MINIMOS *@
|
||||
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
<b>Documentación Mínima:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Descripción</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoURBAN.TrabajoProfesional.DocumentacionMinima.Count > 0)
|
||||
{
|
||||
@foreach (var item in objetoURBAN.TrabajoProfesional.DocumentacionMinima)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Descripcion</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4 text-center">No hay registros</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@* TABLA DE DATOS OPCIONALES *@
|
||||
|
||||
<div class="TituloTablaImprimir" style="margin-top:80px;">
|
||||
|
||||
</div>
|
||||
<div class="TituloTablaImprimir" style="margin-top:80px;">
|
||||
<b>Documentación Opcional:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Descripción</th>
|
||||
<th class="colorB fw-bold">Añadida</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoURBAN.TrabajoProfesional.DocumentacionOpcional.Count != 0)
|
||||
{
|
||||
|
||||
@foreach (var item in objetoURBAN.TrabajoProfesional.DocumentacionOpcional)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Descripcion</td>
|
||||
<td class="colorB w4 text-end">
|
||||
|
||||
@if (@item.Checkeada)
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-square" viewBox="0 0 16 16">
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z" />
|
||||
<path d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z" />
|
||||
</svg>
|
||||
}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<td colspan="2" class="colorB text-center">No hay registros</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@* TABLA DE DATOS NECESARIOS *@
|
||||
<div class="col-11 mx-auto">
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
<b>Datos Necesarios:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Descripción</th>
|
||||
<th class="colorB fw-bold">Valor</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoURBAN.TrabajoProfesional.DatosNecesarios.Count != 0)
|
||||
{
|
||||
@foreach (var item in objetoURBAN.TrabajoProfesional.DatosNecesarios)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Descripcion</td>
|
||||
<td class="colorB w4 text-end">@item.ValorNecesario</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<td colspan="2" class="colorB text-center">No hay registros</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* TABLA FASES *@
|
||||
<div class="col-11 mx-auto">
|
||||
<div class="TituloTablaImprimir" style=" margin-top:50px;">
|
||||
<b>Fases:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Descripción</th>
|
||||
<th class="colorB fw-bold"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in objetoURBAN.TrabajoProfesional.FasesTrabajoProfesional)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Denominacion</td>
|
||||
<td class="colorB w4 text-end">@item.Porcentaje %</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<div style="align-self: center;">
|
||||
@if (objetoURBAN.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje) != 100)
|
||||
{
|
||||
<div>
|
||||
Trabajo en misión parcial: <span> @objetoURBAN.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje) %</span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>
|
||||
Total: <span> @objetoURBAN.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje) %</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@* INNOVACIÓN INSTRUMENTOS*@
|
||||
<div class="col-11 mx-auto mb-5">
|
||||
<div>
|
||||
<div class="TituloTablaImprimir" style="margin-top:80px;">
|
||||
</div>
|
||||
|
||||
<div class="mb-3 TituloTablaImprimir" style="margin-top:80px;"><b>Innovacion de los instrumentos</b></div>
|
||||
<p style="font-size:9pt;" class="col-6">
|
||||
<label>@objetoURBAN.TrabajoProfesional.valorInstrumentos %</label>
|
||||
</p>
|
||||
|
||||
@foreach (var enu in objetoURBAN.Enumerados.ListaInstrumentos)
|
||||
{
|
||||
<div class="form-check" style="gap:10px; font-size:9pt;">
|
||||
@if (enu.Seleccionado)
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-circle-fill" viewBox="0 0 16 16">
|
||||
<circle cx="8" cy="8" r="8" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
</svg>
|
||||
|
||||
}
|
||||
<label style="margin-left:10px;" class="form-check-label" for="@enu.idEnumeracion">@enu.Descripcion</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div style="font-size:9pt;" class="fw-bold mt-2">
|
||||
<label>HORAS TRABAJO PROFESIONAL URBANISMO: <span>@objetoURBAN.TrabajoProfesional.horasTrabProfesional.MilesYDecimales() h</span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@* PLAZOS Y HORAS *@
|
||||
<div class="col-11 mx-auto mb-5" >
|
||||
<div class="row justify-content-center align-content-center align-items-center">
|
||||
|
||||
<div class="col-9 mb-5 mb-0" style="width:100%;">
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Trabajo profesional</b>
|
||||
</div>
|
||||
|
||||
<div class="col-9 mb-5 align-items-center">
|
||||
@* PLAZO DE PRESENTACION *@
|
||||
<div style="font-size:9pt;" class="fw-bold">
|
||||
<label>Plazo de presentación de la documentación: <span>@objetoURBAN.CostesProduccion.PlazoPresentacionDocumentos meses</span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* HORAS TRABAJO *@
|
||||
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Trabajos</th>
|
||||
<th class="colorB fw-bold">Horas</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorB ">Horas en despacho profesional</td>
|
||||
<td class="text-end">@objetoURBAN.CostesProduccion.HorasEnPlazo.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB ">Horas mediante externalización</td>
|
||||
<td class="text-end">@objetoURBAN.CostesProduccion.NumHorasMinimoExt.MilesYDecimales() h</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end colorC fw-bold w4 TotalesTabla">
|
||||
Total horas del trabajo profesional: <span>@((objetoURBAN.CostesProduccion.HorasEnPlazo + objetoURBAN.CostesProduccion.NumHorasMinimoExt).MilesYDecimales()) h </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@* COSTE DE PRODUCCIÓN *@
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
<div class="col-8 mx-auto">
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Costes Asociados a los Servicios de Arquitectura</b>
|
||||
</div>
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Concepto</th>
|
||||
<th class="colorB fw-bold text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class=" TotalesTabla ">COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL</td>
|
||||
<td class=" TotalesTabla text-end"><span> @objetoURBAN.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="TotalesTabla colorFilasIntro ">Beneficio <span style="font-size:7pt;" > (antes de impuestos) </span> </td>
|
||||
<td class="TotalesTabla text-end">
|
||||
<div class="text-end align-items-end" style="gap:3px;">
|
||||
<label>@objetoURBAN.CostesProduccion.Beneficio</label> %
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="TotalesTabla text-end fw-bold">
|
||||
Precio del trabajo profesional: <span>@objetoURBAN.CostesProduccion.PrecioTrabajoProfesional.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="FooterImprimir">
|
||||
|
||||
<p>
|
||||
@mspie1
|
||||
</p>
|
||||
<p>
|
||||
@mspie2
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public URBAN objetoURBAN { get; set; } = new URBAN();
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
string separacionTabla = "col-12 mx-auto mb-5";
|
||||
|
||||
MarkupString msTextoEncabezado => (MarkupString)textoEncabezado;
|
||||
MarkupString mspie1 => (MarkupString)pie1;
|
||||
MarkupString mspie2 => (MarkupString)pie2;
|
||||
|
||||
string textoEncabezado = "";
|
||||
string pie1 = "";
|
||||
string pie2 = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
if (objetoURBAN.TrabajoProfesional.DocumentacionMinima.Count == 0)
|
||||
{
|
||||
separacionTabla = "col-12 mx-auto mb-4";
|
||||
}
|
||||
|
||||
textoEncabezado = bd.enumeraciones.First(x => x.Codigo.Contains("PDFURBAN")).ValorAlfabeticoLargo;
|
||||
|
||||
pie1 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE1")).ValorAlfabeticoLargo;
|
||||
pie2 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE2")).ValorAlfabeticoLargo;
|
||||
}
|
||||
public void RefreshState()
|
||||
{
|
||||
this.StateHasChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,61 +1,83 @@
|
||||
<div id="LicitacionesCASAImprimir" class="d-flex flex-column align-items-center">
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
<div class="mb-4 col-11 mx-auto justify-content-center d-flex">
|
||||
<label style="color: #078b98 !important"><b>Licitaciones Edificación</b></label>
|
||||
|
||||
<div id="LicitacionesCASAImprimir" class="d-flex flex-column align-items-center pagePrincipal">
|
||||
<div class="col-12 mx-auto">
|
||||
@* ENCABEZADO DE LA PAGINA *@
|
||||
@* A esta se le pone un margin bottom diferente para que cuando los usos esten vacios que entre en una sola página *@
|
||||
<div class="EncabezadoImprimir" style="margin-bottom: 80px !important;">
|
||||
<p>
|
||||
@msTextoEncabezado
|
||||
</p>
|
||||
|
||||
<div class="d-flex flex-column mt-3">
|
||||
<label>Simulación: <span class="NombreSimulacionImprimir">@objetoLicitaciones.Descripcion</span></label>
|
||||
<br />
|
||||
<label>Fecha de creación: <span class="NombreSimulacionImprimir">@DateTime.Now</span></label>
|
||||
</div>
|
||||
<div class="col-11 mx-auto" style="align-items: flex-end;">
|
||||
<div style="height: 49px;">
|
||||
<b>Usos/Tipologías</b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
@* TABLA USOS TIPOLOGIAS *@
|
||||
<div class="col-11 mx-auto mb-4" style="align-items: flex-end;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Usos/Tipologías</b>
|
||||
</div>
|
||||
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Superficie</th>
|
||||
<th class="colorB fw-bold">Usos</th>
|
||||
<th class="colorB fw-bold">Tipología</th>
|
||||
<th class="colorB fw-bold">Intervención</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="15%">Superficie (m²)</th>
|
||||
<th width="20%">Usos</th>
|
||||
<th width="35%">Tipología</th>
|
||||
<th width="30%">Intervención</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoLicitaciones.Usos.Count != 0)
|
||||
{
|
||||
@foreach (var uso in objetoLicitaciones.Usos)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-end">@uso.superficie.MilesYDecimales()</td>
|
||||
{
|
||||
<tr>
|
||||
<td class="text-end">@uso.superficie.MilesYDecimales()</td>
|
||||
<td>@objetoLicitaciones.Enumerados.GruposTipologias?.FirstOrDefault(x => x.idEnumeracion == uso.idGrupoTipologia)?.ValorAlfabetico1</td>
|
||||
<td>@objetoLicitaciones.Enumerados.Tipologias?.FirstOrDefault(x => x.idTipologia == uso.idTipologia)?.Descripcion</td>
|
||||
<td>@objetoLicitaciones.Enumerados.Intervenciones?.FirstOrDefault(x => x.idEnumeracion == uso.idTipoIntervencion)?.ValorAlfabetico1</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4" class="text-end fw-bold colorC TotalesTabla">
|
||||
<div style="height:28px; align-content:center;">
|
||||
Total superficie: <span> @objetoLicitaciones.Usos.Sum(x => x.superficie).MilesYDecimales()</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<td colspan="4" class="text-center">No hay registros</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4" class="text-start fw-bold colorC TotalesTabla">
|
||||
<div style="height:20px; align-content:center;">
|
||||
Total superficie: <span> @objetoLicitaciones.Usos.Sum(x => x.superficie).MilesYDecimales() m²</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-11 mx-auto" style="align-items: flex-end;">
|
||||
<div style="height: 49px;">
|
||||
</div>
|
||||
@* TABLA FASES *@
|
||||
<div class="col-8 mx-auto" style="align-items: flex-end;">
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Fases</b>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table tablaCACOA tablaCACOA2 mb-0">
|
||||
<table class="TablaImprimir mb-0 espacioTablas" style="width:90%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Fases</th>
|
||||
<th class="colorB fw-bold"></th>
|
||||
<th class="text-start" >Fases</th>
|
||||
<th ></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -63,13 +85,22 @@
|
||||
@foreach (var fase in objetoLicitaciones.FasesTrabajo)
|
||||
{
|
||||
<tr>
|
||||
<td >@fase.Denominacion</td>
|
||||
<td class="text-end">
|
||||
<div style="gap:3px;">
|
||||
<span>@fase.Porcentaje</span>
|
||||
<td>@fase.Denominacion</td>
|
||||
<td >
|
||||
<div class="centrarChecksImprimir text-end">
|
||||
<span style="margin-right:5px;">@fase.Porcentaje</span>
|
||||
@if (fase.Seleccionado)
|
||||
{
|
||||
<span> poner tick </span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-square" viewBox="0 0 16 16">
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z" />
|
||||
<path d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z" />
|
||||
</svg>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
@@ -82,8 +113,8 @@
|
||||
<div class="d-flex justify-content-end">
|
||||
<div style="align-self: center;">
|
||||
@if (objetoLicitaciones.FasesTrabajo
|
||||
.Where(f => f.Seleccionado)
|
||||
.Sum(f => f.Porcentaje) != 100)
|
||||
.Where(f => f.Seleccionado)
|
||||
.Sum(f => f.Porcentaje) != 100)
|
||||
{
|
||||
<div>
|
||||
Trabajo en misión parcial: <span>
|
||||
@@ -108,7 +139,74 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* TABLA COSTES DE PRODUCCION *@
|
||||
<div class="col-8 mx-auto" style="align-items: flex-end; margin-top:35px;">
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Costes de producción</b>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="TablaImprimir mb-0 espacioTablas">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold" style="width:60%">Concepto</th>
|
||||
<th class="colorB fw-bold"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Plazo de presentación de la documentación</td>
|
||||
<td class="text-end">@objetoLicitaciones.PlazoPresentacionDocumentos meses</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Coste hora de producción</td>
|
||||
<td class="text-end"><span>@objetoLicitaciones.costeHoraProduccion.MilesYDecimales() €/h</span> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Horas trabajo profesional</td>
|
||||
<td class="text-end"><span>@objetoLicitaciones.horasProduccion.MilesYDecimales() h</span> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>COSTE DE PRODUCCIÓN DEL TRABAJO PROFESIONAL</td>
|
||||
<td class="text-end"><span> @objetoLicitaciones.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="TotalesTabla colorB w4">
|
||||
G.G. + B.I.
|
||||
<span class="fw-normal" style="font-size:7pt;">(40/19 Junta Consultiva de Contratación Pública del Estado)</span>
|
||||
</td>
|
||||
<td class="TotalesTabla 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 TotalesTabla tablaCACOA">
|
||||
Precio del trabajo profesional: <span>@objetoLicitaciones.PrecioTrabProf.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@* A esta se le pone un margin top diferente para que cuando los usos esten vacios que entre en una sola página *@
|
||||
<div class="FooterImprimir" style="margin-top: 55px !important;">
|
||||
<p>
|
||||
@mspie1
|
||||
</p>
|
||||
<p>
|
||||
@mspie2
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -121,9 +219,22 @@
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
MarkupString msTextoEncabezado => (MarkupString)textoEncabezado;
|
||||
MarkupString mspie1 => (MarkupString)pie1;
|
||||
MarkupString mspie2 => (MarkupString)pie2;
|
||||
|
||||
string textoEncabezado = "";
|
||||
string pie1 = "";
|
||||
string pie2 = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
textoEncabezado = bd.enumeraciones.First(x => x.Codigo.Contains("PDFCASALIC")).ValorAlfabeticoLargo;
|
||||
|
||||
pie1 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE1")).ValorAlfabeticoLargo;
|
||||
pie2 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE2")).ValorAlfabeticoLargo;
|
||||
}
|
||||
public void RefreshState()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,464 @@
|
||||
@using System.Globalization
|
||||
<div id="LiciURBANImprimir" class="d-flex flex-column align-items-center pagePrincipal">
|
||||
@* TRABAJAO PROFESIONAL *@
|
||||
<div class="col-12 mx-auto">
|
||||
|
||||
@* ENCABEZADO DE LA PAGINA *@
|
||||
<div class="EncabezadoImprimir">
|
||||
<p>
|
||||
@msTextoEncabezado
|
||||
</p>
|
||||
|
||||
<div class="d-flex flex-column mt-3">
|
||||
<label>Simulación: <span class="NombreSimulacionImprimir">@objetoLicitacionUrban.NombreSimulacion</span></label>
|
||||
<br />
|
||||
<label>Fecha de creación: <span class="NombreSimulacionImprimir">@DateTime.Now</span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-8 mx-auto" style="margin-top:50px;">
|
||||
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
@* <div class="formatoCampos pt-2" style="font-size:9pt;">
|
||||
<label class="tituloLbl">Tipo de Documento:</label>
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@CultureInfo.CurrentCulture.TextInfo.ToTitleCase(@objetoLicitacionUrban.Enumerados.TiposDeDocumentos.First(x => x.idEnumeracion == objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion).Descripcion.ToLower())</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</div>
|
||||
<div class="formatoCampos pt-2" style="font-size:9pt;">
|
||||
<label class="tituloLbl">Documento:</label>
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@objetoLicitacionUrban.Enumerados.ProyectosPorTipo(objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion).First(x => x.idtipoproyectos == objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto).Descripcion</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</div> *@
|
||||
|
||||
<table class="mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tipo de Documento:</th>
|
||||
<th>Documento:</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="text-end">
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@CultureInfo.CurrentCulture.TextInfo.ToTitleCase(@objetoLicitacionUrban.Enumerados.TiposDeDocumentos.First(x => x.idEnumeracion == objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion).Descripcion.ToLower())</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
<label>@objetoLicitacionUrban.Enumerados.ProyectosPorTipo(objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion).First(x => x.idtipoproyectos == objetoLicitacionUrban.TrabajoProfesional.idTipoProyecto).Descripcion</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label>No Seleccionado</label>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@* TABLAS DE DATOS MINIMOS Y OPCIONALES *@
|
||||
<div class="col-11 mx-auto">
|
||||
@* TABLA DE DATOS MINIMOS *@
|
||||
|
||||
<div class="TituloTablaImprimir" style=" margin-top:50px;">
|
||||
<b>Documentación Mínima:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas" style="@espacioTabla">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Descripción</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.DocumentacionMinima.Count > 0)
|
||||
{
|
||||
@foreach (var item in objetoLicitacionUrban.TrabajoProfesional.DocumentacionMinima)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Descripcion</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr><td class="text-center">No hay registros</td></tr>
|
||||
}
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@* TABLA DE DATOS OPCIONALES *@
|
||||
|
||||
<div class="TituloTablaImprimir" style="margin-top:10px;">
|
||||
</div>
|
||||
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Documentación Opcional:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Descripción</th>
|
||||
<th class="colorB fw-bold">Añadida</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.DocumentacionOpcional.Count != 0)
|
||||
{
|
||||
@foreach (var item in objetoLicitacionUrban.TrabajoProfesional.DocumentacionOpcional)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Descripcion</td>
|
||||
<td class="colorB w4 text-end">
|
||||
|
||||
@if (@item.Checkeada)
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-square" viewBox="0 0 16 16">
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z" />
|
||||
<path d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z" />
|
||||
</svg>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr><td class="text-center" colspan="2">No hay registros</td></tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* DATOS NECESARIOS *@
|
||||
<div class="col-12 mx-auto">
|
||||
<div class="col-11 mx-auto">
|
||||
<div class="TituloTablaImprimir" style=" margin-top:50px;">
|
||||
<b>Datos Necesarios:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:70%;" class="colorB fw-bold">Descripción</th>
|
||||
<th class="colorB fw-bold">Valor</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.DatosNecesarios.Count != 0)
|
||||
{
|
||||
@foreach (var item in objetoLicitacionUrban.TrabajoProfesional.DatosNecesarios)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Descripcion</td>
|
||||
<td class="colorB w4 text-end">@item.ValorNecesario</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr><td class="text-center" colspan="2">No hay registros</td></tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* FASES *@
|
||||
<div class="col-8 mx-auto" style="margin-top:150px;">
|
||||
|
||||
<div class="TituloTablaImprimir" style=" margin-top:50px;">
|
||||
<b>Fases:</b>
|
||||
</div>
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:70%;" class="colorB fw-bold">Fases</th>
|
||||
<th class="colorB fw-bold"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">@item.Denominacion</td>
|
||||
<td class="colorB w4 text-end">@item.Porcentaje %</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold colorC TotalesTabla">
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<div style="align-self: center;">
|
||||
@if (objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje) != 100)
|
||||
{
|
||||
<div>
|
||||
Trabajo en misión parcial: <span> @objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje) %</span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>
|
||||
Total: <span> @objetoLicitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje) %</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@* INNOVACIÓN INSTRUMENTOS*@
|
||||
<div class="col-11 mx-auto" style="margin-top:150px;">
|
||||
<div>
|
||||
<div class="mt-3 mb-3 TituloTablaImprimir"><b>Innovacion de los instrumentos</b></div>
|
||||
<p style="font-size:9pt;" class="col-6">
|
||||
<label>@objetoLicitacionUrban.TrabajoProfesional.valorInstrumentos %</label>
|
||||
</p>
|
||||
|
||||
@foreach (var enu in objetoLicitacionUrban.Enumerados.ListaInstrumentos)
|
||||
{
|
||||
<div class="form-check" style="gap:10px; font-size:9pt;">
|
||||
@if (enu.Seleccionado)
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-circle-fill" viewBox="0 0 16 16">
|
||||
<circle cx="8" cy="8" r="8" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
</svg>
|
||||
|
||||
}
|
||||
<label style="margin-left:10px;" class="form-check-label" for="@enu.idEnumeracion">@enu.Descripcion</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div style="font-size:9pt;" class="fw-bold">
|
||||
<label>HORAS TRABAJO PROFESIONAL URBANISMO: <span>@objetoLicitacionUrban.TrabajoProfesional.horasTrabProfesional.MilesYDecimales() h</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-8 mx-auto mt-4">
|
||||
@* Solvencia tecnica *@
|
||||
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
</div>
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
<b>Solvencia técnica:</b>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Trabajadores</th>
|
||||
<th class="colorB fw-bold">Nº Trabajadores</th>
|
||||
<th class="colorB fw-bold">Categoría Profesional</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (objetoLicitacionUrban.ListaSolvenciaTecnica.Count > 0)
|
||||
{
|
||||
@foreach (var otroTrabajo in objetoLicitacionUrban.ListaSolvenciaTecnica)
|
||||
{
|
||||
<tr>
|
||||
<td>@otroTrabajo.Descripcion</td>
|
||||
<td class="text-end">@otroTrabajo.Cantidad</td>
|
||||
<td>@otroTrabajo.TipoConvenio</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">No hay registros</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3" class="text-end fw-bold colorC TotalesTabla">
|
||||
Total trabajadores:
|
||||
<span> @objetoLicitacionUrban.ListaSolvenciaTecnica.Sum(x => x.Cantidad)</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
@* costes asociados *@
|
||||
<div class="TituloTablaImprimir" style=" margin-top:50px;">
|
||||
<b>Costes Asociados a los Servicios de Arquitectura:</b>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Concepto</th>
|
||||
<th class="colorB fw-bold text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colorFilasIntro w4">Plazo de presentación de la documentación:</td>
|
||||
<td class="text-end columna40Ancho">
|
||||
<div class="text-end" style="gap:3px;">
|
||||
<label>@objetoLicitacionUrban.PlazoPresentacionDocumentos</label> meses
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colorB w4">Coste hora de producción</td>
|
||||
<td class="text-end columna40Ancho"><span> @objetoLicitacionUrban.CosteHP.MilesYDecimales() €/hora</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:50%;">Horas Trabajo Profesional </td>
|
||||
<td class="tdAlineadoDerecha">
|
||||
<span>
|
||||
@objetoLicitacionUrban.TrabajoProfesional.horasTrabProfesional.MilesYDecimales() h
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colorB w4">Coste de producción del Trabajo Profesional</td>
|
||||
<td class="text-end columna40Ancho"><span> @objetoLicitacionUrban.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">
|
||||
G.G. + B.I. <br />
|
||||
<span class="fw-normal" style="font-size:7pt;">(40/19 Junta Consultiva de Contratación Pública del Estado)</span>
|
||||
</td>
|
||||
<td class="text-end columna40Ancho" style="align-content:center;">
|
||||
<div class="d-flex" style="justify-content: end; gap:3px;">
|
||||
@objetoLicitacionUrban.Beneficio %
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="TotalesTabla text-end fw-bold">
|
||||
Precio del trabajo profesional: <span>@objetoLicitacionUrban.PrecioDelTrabajo.MilesYDecimales() €</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@* Costes de producción *@
|
||||
|
||||
|
||||
<div class="FooterImprimir">
|
||||
|
||||
<p>
|
||||
@mspie1
|
||||
</p>
|
||||
<p>
|
||||
@mspie2
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public bdHerramientaCACOA.LicitacionesURBAN objetoLicitacionUrban { get; set; } = new bdHerramientaCACOA.LicitacionesURBAN();
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
string espacioTabla = "margin-bottom:400px;";
|
||||
string espacioDocumentos = "";
|
||||
|
||||
|
||||
MarkupString msTextoEncabezado => (MarkupString)textoEncabezado;
|
||||
MarkupString mspie1 => (MarkupString)pie1;
|
||||
MarkupString mspie2 => (MarkupString)pie2;
|
||||
|
||||
string textoEncabezado = "";
|
||||
string pie1 = "";
|
||||
string pie2 = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
|
||||
if (objetoLicitacionUrban.TrabajoProfesional.DocumentacionMinima.Count == 0)
|
||||
{
|
||||
espacioTabla = "";
|
||||
}
|
||||
|
||||
if (objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion != 0)
|
||||
{
|
||||
espacioDocumentos = "margin-top:50px;";
|
||||
}
|
||||
else
|
||||
{
|
||||
espacioDocumentos = "margin-top:50px;";
|
||||
}
|
||||
|
||||
textoEncabezado = bd.enumeraciones.First(x => x.Codigo.Contains("PDFURBANLIC")).ValorAlfabeticoLargo;
|
||||
|
||||
pie1 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE1")).ValorAlfabeticoLargo;
|
||||
pie2 = bd.enumeraciones.First(x => x.Codigo.Contains(".PDFPIE2")).ValorAlfabeticoLargo;
|
||||
}
|
||||
public void RefreshState()
|
||||
{
|
||||
this.StateHasChanged();
|
||||
}
|
||||
}
|
||||
@@ -27,16 +27,16 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">Coste de producción del Trabajo Profesional</td>
|
||||
<td class="tdAlter 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">
|
||||
<td class="TotalesTabla colorB 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;">
|
||||
<td class="TotalesTabla text-end" style="align-content:center;">
|
||||
<div class="d-flex" style="justify-content: end; gap:3px;">
|
||||
@objetoLicitaciones.Beneficio %
|
||||
</div>
|
||||
|
||||
@@ -26,8 +26,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Documentación Mínima:</label>
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 55).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 55).Descripcion)
|
||||
}
|
||||
|
||||
Documentación Mínima:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoLicitacionUrban.TrabajoProfesional.DocumentacionMinima"
|
||||
@@ -45,8 +51,13 @@
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Documentación Opcional:</label>
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 56).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 56).Descripcion)
|
||||
}
|
||||
Documentación Opcional:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoLicitacionUrban.TrabajoProfesional.DocumentacionOpcional"
|
||||
@@ -70,8 +81,13 @@
|
||||
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="tituloLbl">Datos Necesarios:</label>
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 57).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 57).Descripcion)
|
||||
}
|
||||
Datos Necesarios:</label>
|
||||
<Grid TItem="URBAN.DocumentacionURBAN"
|
||||
Class="tablaCACOA table"
|
||||
Data="objetoLicitacionUrban.TrabajoProfesional.DatosNecesarios"
|
||||
@@ -105,7 +121,6 @@
|
||||
<CascadingValue Value="this" IsFixed="false">
|
||||
@* <InstrumentosLicitacionesUrban objetoLicitacionUrban="objetoLicitacionUrban"></InstrumentosLicitacionesUrban> *@
|
||||
<InstrumentosLicitacionesUrban @ref="componenteInstrumentos" objetoLicitacionUrban="objetoLicitacionUrban" />
|
||||
|
||||
</CascadingValue>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
<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 class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 59).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 59).Descripcion)
|
||||
}
|
||||
<b>Fases</b></div>
|
||||
</div>
|
||||
|
||||
<div style="position:relative;margin-bottom: 35px;">
|
||||
|
||||
@@ -10,8 +10,15 @@
|
||||
|
||||
<div style="height:100%">
|
||||
<div>
|
||||
<div class="mt-3 mb-3"><b>Innovacion de los instrumentos</b></div>
|
||||
<p class="col-6">
|
||||
<div class="mt-3 mb-3 puntoInfo">
|
||||
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 58).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 58).Descripcion)
|
||||
}
|
||||
<b>Innovacion de los instrumentos</b>
|
||||
</div>
|
||||
<p>
|
||||
@* @if (!nuevaRedaccion)
|
||||
{ *@
|
||||
<InputNumber TValue="double" Value="@objetoLicitacionUrban.TrabajoProfesional.valorInstrumentos"
|
||||
|
||||
@@ -65,7 +65,12 @@
|
||||
<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 class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 60).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitacionUrban.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 60).Descripcion)
|
||||
}
|
||||
<b>Solvencia técnica</b></div>
|
||||
</div>
|
||||
<Grid TItem="LicitacionesURBAN.SolvenciaTecnica"
|
||||
Class="tablaCACOA table"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -9,14 +9,21 @@
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="colorB fw-bold">Concepto</th>
|
||||
<th class="colorB fw-bold" style="width:60%;">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 class="colorFilasIntro w4">
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 34).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 34).Descripcion)
|
||||
}
|
||||
Plazo de presentación de la documentación:
|
||||
|
||||
</div>
|
||||
@if (objetoLicitaciones.IncrementoUrgencia > 0)
|
||||
{
|
||||
<br />
|
||||
@@ -34,27 +41,55 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if (objetoLicitaciones.EsPorUsos == true)
|
||||
{
|
||||
<tr>
|
||||
<td class="colorB w4">Estimación de horas necesarias</td>
|
||||
<td class="text-end">
|
||||
<span>
|
||||
@objetoLicitaciones.horasProduccionEstimacion.MilesYDecimales() h
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">Coste hora de producción</td>
|
||||
<td class="text-end"><span> @objetoLicitaciones.costeHoraProduccion.MilesYDecimales() €</span></td>
|
||||
<td class="colorB w4">Horas del trabajo profesional Edificación <span style="margin-left:60px;">@UtilidadesCASA.pasarHorasASemana(objetoLicitaciones.horasProduccion).MilesYDecimales() semanas</span></td>
|
||||
<td class="text-end">
|
||||
<div class="d-flex" style="gap: 3px;">
|
||||
<InputNumber TValue="double" @onblur="calcularHoras" @bind-Value="@objetoLicitaciones.horasProduccion" Min="0" class="inputForm inputTabla tdAlineadoDerecha" />h
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="colorB w4">Coste hora de producción</td>
|
||||
<td class="text-end"><span>@objetoLicitaciones.costeHoraProduccion.MilesYDecimales() €/h</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">Horas Trabajo profesional</td>
|
||||
<td class="text-end"><span> @objetoLicitaciones.horasProduccion.MilesYDecimales() €</span></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>
|
||||
<td class="tdAlter fw-bold w4 TotalesTabla">COSTE DE PRODUCCIÓN DEL TRABAJO PROFESIONAL</td>
|
||||
<td class="text-end tdAlter TotalesTabla"><span> @objetoLicitaciones.CostesProduccionTrabProf.MilesYDecimales() €</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="colorB fw-bold w4">
|
||||
G.G. + B.I. <br />
|
||||
<td class="TotalesTabla colorB w4">
|
||||
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 35).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 35).Descripcion)
|
||||
}
|
||||
G.G. + B.I.
|
||||
<span class="fw-normal" style="font-size:10px;">(40/19 Junta Consultiva de Contratación Pública del Estado)</span>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end" style="align-content:center;">
|
||||
<td class="TotalesTabla text-end" style="align-content:center;">
|
||||
<div class="d-flex" style="justify-content: end; gap:3px;">
|
||||
@objetoLicitaciones.Beneficio %
|
||||
</div>
|
||||
@@ -69,8 +104,8 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-end fw-bold" style="background: #ffc107;">
|
||||
COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL: <span>@objetoLicitaciones.PrecioTrabProf.MilesYDecimales() €</span>
|
||||
<td colspan="2" class="text-end fw-bold TotalesTabla tablaCACOA">
|
||||
Precio del trabajo profesional: <span>@objetoLicitaciones.PrecioTrabProf.MilesYDecimales() € </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@@ -116,4 +151,18 @@
|
||||
|
||||
PlazoPresentacionDocumentosCambiado(objetoLicitaciones.PlazoPresentacionDocumentos);
|
||||
}
|
||||
|
||||
private async void calcularHoras()
|
||||
{
|
||||
bool guardarSeleccion = objetoLicitaciones.EsPorUsos;
|
||||
|
||||
objetoLicitaciones.EsPorUsos = false;
|
||||
|
||||
objetoLicitaciones.CalcularHorasSuperficie();
|
||||
|
||||
objetoLicitaciones.EsPorUsos = guardarSeleccion;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
_Parent.RefreshState();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
|
||||
|
||||
<div class="d-flex justify-content-between mt-3">
|
||||
<div><b>Fases</b></div>
|
||||
<div class="puntoInfo">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 33).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 33).Descripcion)
|
||||
}
|
||||
<b>Fases</b></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -22,7 +22,13 @@
|
||||
<BodyTemplate>
|
||||
<div class="row">
|
||||
<div class="col-12 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Superficie:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 31).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 31).Descripcion)
|
||||
}
|
||||
Superficie:
|
||||
</label>
|
||||
<InputNumber TValue="double" @bind-Value="itemSeleccionadoTemporal.superficie"
|
||||
step="any"
|
||||
@oninput="e => ValidarYActualizar(e, nameof(itemSeleccionadoTemporal.superficie))"
|
||||
@@ -53,7 +59,12 @@
|
||||
</div>
|
||||
|
||||
<div class="col-12 formatoCampos pt2">
|
||||
<label class="tituloLbl">Intervención:</label>
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 32).Descripcion))
|
||||
{
|
||||
@UtilidadesCASA.CreateTooltip(objetoLicitaciones.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 32).Descripcion)
|
||||
}
|
||||
Intervención:</label>
|
||||
<InputSelect @bind-Value="@itemSeleccionadoTemporal.idTipoIntervencion" class="inputForm">
|
||||
@foreach (var intervencion in intervencionesAux)
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
33
HerramientaCASA/Components/Pages/Login/Denegado.razor
Normal file
33
HerramientaCASA/Components/Pages/Login/Denegado.razor
Normal file
@@ -0,0 +1,33 @@
|
||||
@page "/Denegado"
|
||||
@using HerramientaCASA.Model
|
||||
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
||||
@inject ProtectedLocalStorage ProtectedLocalStore
|
||||
@rendermode InteractiveServer
|
||||
@layout LoginLayout
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject NavigationManager Navigation
|
||||
@inject UserState UserState
|
||||
|
||||
|
||||
<div class="fondo">
|
||||
<div class="back">
|
||||
<div class="div-center">
|
||||
<div class="d-block mt-4">
|
||||
<img src="Content/Imagenes/CACOA-6.png" height="49" />
|
||||
<h4 class="mt-2">Acceso Denegado</h4>
|
||||
<hr />
|
||||
<div class="form-group">
|
||||
<p class="form-text">
|
||||
Se ha agotado la sesión o se ha accedido a la aplicación desde fuera de la Web del CACOA.<br />
|
||||
Por favor vuelva a acceder desde la web
|
||||
</p>
|
||||
</div>
|
||||
<a href="https://www.cacoa.es" class="enlaceCACOA">Ir a la web del CACOA</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -7,76 +7,99 @@
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject NavigationManager Navigation
|
||||
@inject UserState UserState
|
||||
@inject IJSRuntime JS
|
||||
|
||||
|
||||
<div class="fondo">
|
||||
<div class="back">
|
||||
<div class="div-center">
|
||||
<div class="content">
|
||||
<img src="Content/Imagenes/CACOA-6.png" height="49" />
|
||||
<h4 class="mt-2">Acceso a la Herramienta</h4>
|
||||
<hr />
|
||||
<EditForm Model="login" FormName="loginForm" OnValidSubmit="Acceder" >
|
||||
<DataAnnotationsValidator></DataAnnotationsValidator>
|
||||
<div class="back">
|
||||
<div class="div-center arealogin">
|
||||
<div class="content">
|
||||
<img src="Content/Imagenes/CACOA-6.png" height="49" />
|
||||
<h4 class="mt-2">Acceso a la Herramienta</h4>
|
||||
<hr />
|
||||
<EditForm Model="login" FormName="loginForm" OnValidSubmit="Acceder">
|
||||
<DataAnnotationsValidator></DataAnnotationsValidator>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Clave de acceso</label>
|
||||
<input type="number" class="form-control" @bind-value="@login.codigo" placeholder="0000000000000" />
|
||||
<ValidationMessage For="() => login.codigo" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Password</label>
|
||||
<div class="input-group">
|
||||
<PasswordInput Class="form-control" @bind-Value="@login.password" />
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Clave de acceso</label>
|
||||
<input type="number" class="form-control" @bind-value="@login.codigo" placeholder="0000000000000" id="clave" />
|
||||
<ValidationMessage For="() => login.codigo" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Password</label>
|
||||
<div class="input-group">
|
||||
<PasswordInput Class="form-control" @bind-Value="@login.password" Id="pass" />
|
||||
</div>
|
||||
<ValidationMessage For="() => login.password" />
|
||||
</div>
|
||||
<div class="form-group d-flex">
|
||||
@* <input type="checkbox" class="form-check-input" id="chkRecuerda" /> *@
|
||||
<CheckboxInput Class="form-check-input" Id="chkRecuerda" Value=@recuerda ValueExpression="() => recuerda" ValueChanged="(value) => checkCambiado(value)" />
|
||||
<label class="form-check-label" for="Recuerdame">Recordarme</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<small class="form-text text-muted">Si es la primera vez que utiliza la herramienta, <a href="NuevoAcceso" class="mt-2">cree una nueva clave de acceso</a></small>
|
||||
</div>
|
||||
<ValidationMessage For="() => login.password" />
|
||||
</div>
|
||||
<div class="form-check" style="gap:10px;">
|
||||
<input type="checkbox" class="form-check-input" id="Recuerdame" />
|
||||
<label class="form-check-label" for="Recuerdame">Recordarme</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<small class="form-text text-muted">Si es la primera vez que utiliza la herramienta, <a href="NuevoAcceso" class="mt-2">cree una nueva clave de acceso</a></small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<p class="form-text text-muted" style="color:red !important">@mensajeError</p>
|
||||
</div>
|
||||
<button type="submit" class="btnBlue"> Acceder </button>
|
||||
</EditForm>
|
||||
<div class="form-group">
|
||||
<p class="form-text text-muted" style="color:red !important">@mensajeError</p>
|
||||
</div>
|
||||
<button type="submit" class="btnBlue"> Acceder </button>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
private LoginVM login = new LoginVM();
|
||||
private string mensajeError = "";
|
||||
private bool recuerda = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
|
||||
await ProtectedLocalStore.SetAsync("idUsuario", 0);
|
||||
await ProtectedLocalStore.SetAsync("EsAdmin", false);
|
||||
|
||||
// Limpiar almacenamiento local o sesión si se está utilizando
|
||||
// if (HttpContextAccessor?.HttpContext?.Session != null)
|
||||
// {
|
||||
// HttpContextAccessor.HttpContext.Session.Clear();
|
||||
// }
|
||||
}
|
||||
if (HttpContextAccessor?.HttpContext?.Session != null)
|
||||
{
|
||||
HttpContextAccessor.HttpContext.Session.Clear();
|
||||
}
|
||||
|
||||
var rec = await ProtectedLocalStore.GetAsync<bool>("rec");
|
||||
if(rec.Value==true){
|
||||
var usuario = await ProtectedLocalStore.GetAsync<int>("US");
|
||||
var clave = await ProtectedLocalStore.GetAsync<string>("PS");
|
||||
login.codigo = usuario.Value;
|
||||
login.password = clave.Value;
|
||||
recuerda = true;
|
||||
}
|
||||
|
||||
}
|
||||
private async void checkCambiado(bool e)
|
||||
{
|
||||
recuerda = e;
|
||||
}
|
||||
private async Task Acceder()
|
||||
{
|
||||
//if (login.codigo == -534610 && login.password == "sRg1406.")
|
||||
if (login.codigo == -1 && login.password == "-1")
|
||||
if (login.codigo == -534610 && login.password == "sRg1406.")
|
||||
// if (login.codigo == -1 && login.password == "-1")
|
||||
{
|
||||
await ProtectedLocalStore.SetAsync("idUsuario", -1);
|
||||
await ProtectedLocalStore.SetAsync("EsAdmin", true);
|
||||
|
||||
UserState.idUser = -1;
|
||||
UserState.PuedeAcceder =true;
|
||||
|
||||
Navigation.NavigateTo("/PanelControlConf", forceLoad: true);
|
||||
}
|
||||
else
|
||||
@@ -93,6 +116,21 @@
|
||||
await ProtectedLocalStore.SetAsync("idUsuario", usuario.idUsuario);
|
||||
await ProtectedLocalStore.SetAsync("EsAdmin", false);
|
||||
|
||||
UserState.idUser = usuario.idUsuario;
|
||||
UserState.PuedeAcceder =true;
|
||||
|
||||
|
||||
if (recuerda)
|
||||
{
|
||||
await ProtectedLocalStore.SetAsync("US", login.codigo);
|
||||
await ProtectedLocalStore.SetAsync("PS", login.password);
|
||||
await ProtectedLocalStore.SetAsync("rec", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
await ProtectedLocalStore.SetAsync("rec", false);
|
||||
}
|
||||
|
||||
|
||||
Navigation.NavigateTo("/PanelControl", forceLoad: true);
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
<Tab Title="Licitaciones Bajas" Name="tabBajas">
|
||||
@* <Tab Title="Licitaciones Bajas" Name="tabBajas">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.Simulaciones.SimulacionesTabs TipoSimulacion="BAJAS"></HerramientaCASA.Components.Pages.Simulaciones.SimulacionesTabs>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
</Tab> *@
|
||||
<Tab Title="CASA – Urbanismo" Name="tbURBAND">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
Servicios de Arquitectura
|
||||
Edificación
|
||||
</h4>
|
||||
<p style="text-align: center;">Cree una simulación completa</p>
|
||||
@* <p style="text-align: center;">Cree una simulación completa</p> *@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@@ -18,7 +18,7 @@
|
||||
<a href="LicitacionCASASimulaciones">
|
||||
<div>
|
||||
<h4 class="text-center">Licitaciones - Edificación</h4>
|
||||
<p style="text-align: center;">Cree una simulación simplificada</p>
|
||||
@* <p style="text-align: center;">Cree una simulación simplificada</p> *@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@@ -29,7 +29,7 @@
|
||||
Servicios de Arquitectura
|
||||
Urbanismo
|
||||
</h4>
|
||||
<p style="text-align: center;">Servicios de Arquitectura – Urbanismo</p>
|
||||
@* <p style="text-align: center;">Servicios de Arquitectura – Urbanismo</p> *@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@
|
||||
<a href="LicitacionUrbanSimulaciones">
|
||||
<div>
|
||||
<h4 class="text-center">Licitaciones - Urbanismo</h4>
|
||||
<p style="text-align: center;">Licitaciones Urbanismo</p>
|
||||
@* <p style="text-align: center;">Licitaciones Urbanismo</p> *@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@@ -46,7 +46,7 @@
|
||||
<a href="MisSimulaciones">
|
||||
<div>
|
||||
<h4 class="text-center">Mis simulaciones</h4>
|
||||
<p style="text-align: center;">Revise sus simulaciones creadas anteriormente</p>
|
||||
@* <p style="text-align: center;">Revise sus simulaciones creadas anteriormente</p> *@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div>
|
||||
<div class="container-fluid align-items-center">
|
||||
<div class="mb-5">
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"><i class="fas fa-plus pe-1"></i>Crear Nueva simulación URBAN</button>
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"><i class="fas fa-plus pe-1"></i>Crear nueva CASA Urbanismo</button>
|
||||
</div>
|
||||
<b>CASA Urbanismo almacenadas</b>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div>
|
||||
<div class="container-fluid align-items-center">
|
||||
<div class="mb-5">
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"><i class="fas fa-plus pe-1"></i>Crear Nueva simulación CASA</button>
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"><i class="fas fa-plus pe-1"></i>Crear nueva CASA Edificación</button>
|
||||
</div>
|
||||
|
||||
<b>CASA Edificación almacenadas</b>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div>
|
||||
<div class="container-fluid align-items-center">
|
||||
<div class="mb-5">
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"> <i class="fas fa-plus pe-1"></i> Crear Nueva licitación CASA</button>
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"> <i class="fas fa-plus pe-1"></i> Crear nueva Licitación Edificación</button>
|
||||
</div>
|
||||
<b>Licitaciones Edificación almacenadas</b>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div>
|
||||
<div class="container-fluid align-items-center">
|
||||
<div class="mb-5">
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"><i class="fas fa-plus pe-1"></i> Crear Nueva licitación URBAN</button>
|
||||
<button @onclick="@(() => irNuevaSimulacion())" class="btnBlue ms-auto"><i class="fas fa-plus pe-1"></i> Crear nueva Licitación Urbanismo</button>
|
||||
</div>
|
||||
<b>Licitaciones Urbanismo almacenadas</b>
|
||||
</div>
|
||||
|
||||
BIN
HerramientaCASA/DinkToPdf/libs/win-x64/libwkhtmltox.dll
Normal file
BIN
HerramientaCASA/DinkToPdf/libs/win-x64/libwkhtmltox.dll
Normal file
Binary file not shown.
@@ -13,9 +13,25 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="wwwroot\chrome-win\**" />
|
||||
<Content Remove="wwwroot\chrome-win\**" />
|
||||
<EmbeddedResource Remove="wwwroot\chrome-win\**" />
|
||||
<None Remove="wwwroot\chrome-win\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="DinkToPdf\libs\win-x64\libwkhtmltox.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazor.Bootstrap" Version="3.3.1" />
|
||||
<PackageReference Include="PuppeteerSharp" Version="20.2.2" />
|
||||
<PackageReference Include="ClosedXML" Version="0.105.0" />
|
||||
<PackageReference Include="DinkToPdf" Version="1.0.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -27,4 +43,10 @@
|
||||
<ProjectReference Include="..\bdHerramientaCACOA\bdHerramientaCACOA.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="wwwroot\Content\Site.css">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
private readonly object _lock = new object();
|
||||
private int _idUser;
|
||||
private bool _esAdmin;
|
||||
private bool _puedeAcceder;
|
||||
public int idUser
|
||||
{
|
||||
get
|
||||
@@ -41,5 +42,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool PuedeAcceder
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
return _puedeAcceder;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_puedeAcceder = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,27 @@
|
||||
using bdHerramientaCACOA.dbcontext;
|
||||
using DinkToPdf;
|
||||
using DinkToPdf.Contracts;
|
||||
using HerramientaCASA;
|
||||
using HerramientaCASA.Components;
|
||||
using HerramientaCASA.Model;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
|
||||
|
||||
var context = new AssemnlyLoadwkhtmltox();
|
||||
// ruta a la dll nativa
|
||||
context.LoadUnmanagedLibrary(
|
||||
Path.Combine(Directory.GetCurrentDirectory(), "DinkToPdf", "libs", "win-x64", "libwkhtmltox.dll")
|
||||
);
|
||||
|
||||
builder.Services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
|
||||
builder.Services.AddScoped<ServicioPDF>();
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
|
||||
132
HerramientaCASA/ServicioPDF.cs
Normal file
132
HerramientaCASA/ServicioPDF.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
using DinkToPdf;
|
||||
using DinkToPdf.Contracts;
|
||||
using System.Text;
|
||||
namespace HerramientaCASA
|
||||
{
|
||||
public class ServicioPDF
|
||||
{
|
||||
private readonly IConverter _converter;
|
||||
|
||||
public ServicioPDF(IConverter converter)
|
||||
{
|
||||
_converter = converter;
|
||||
}
|
||||
|
||||
public byte[] GenerarPdf(string html)
|
||||
{
|
||||
var doc = new HtmlToPdfDocument()
|
||||
{
|
||||
GlobalSettings = {
|
||||
PaperSize = PaperKind.A4,
|
||||
Orientation = Orientation.Portrait,
|
||||
Margins= new MarginSettings
|
||||
{
|
||||
Top = 11.8,
|
||||
Left = 0,
|
||||
Right = 0,
|
||||
Bottom = 10
|
||||
},
|
||||
},
|
||||
Objects = {
|
||||
new ObjectSettings() {
|
||||
HtmlContent = html,
|
||||
HeaderSettings = new HeaderSettings
|
||||
{
|
||||
HtmUrl = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Imprimir", "HeaderImprimir.html")
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return _converter.Convert(doc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// Convierte HTML a PDF (bytes) usando HtmlRenderer.PdfSharpCore, inyectando site.css.
|
||||
|
||||
// /// </summary>
|
||||
// /// <param name="htmlBody">
|
||||
// /// Contenido HTML del body (o el documento completo). Si pasas solo el body, se envolverá automáticamente.
|
||||
// /// </param>
|
||||
// /// <param name="siteCssPath">Ruta al archivo site.css en el servidor (p. ej. "wwwroot/css/site.css").</param>
|
||||
// /// <param name="baseUri">
|
||||
// /// (Opcional) Base para resolver rutas relativas.
|
||||
// /// Se inserta como <base href="..."> en <head>.
|
||||
// /// </param>
|
||||
// /// <param name="pageSize">Tamaño de página (A4 por defecto).</param>
|
||||
// /// <param name="margin">Margen en puntos (40 por defecto).</param>
|
||||
// public byte[] HtmlToPdfWithSiteCss(
|
||||
// string htmlBody,
|
||||
// string siteCssPath,
|
||||
// string? baseUri = null,
|
||||
// PdfSharpCore.PageSize pageSize = PdfSharpCore.PageSize.A4,
|
||||
// int margin = 40
|
||||
// )
|
||||
// {
|
||||
// if (string.IsNullOrWhiteSpace(htmlBody))
|
||||
// throw new ArgumentException("El HTML no puede estar vacío.", nameof(htmlBody));
|
||||
|
||||
// if (string.IsNullOrWhiteSpace(siteCssPath) || !File.Exists(siteCssPath))
|
||||
// throw new FileNotFoundException("No se encontró el archivo CSS indicado.", siteCssPath);
|
||||
|
||||
// // Evitar problemas de codificación (tildes, ñ)
|
||||
// Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
// // Lee el CSS local
|
||||
// var css = File.ReadAllText(siteCssPath);
|
||||
|
||||
// // HTML mínimo
|
||||
// bool isFullHtml = htmlBody.Contains("<html", StringComparison.OrdinalIgnoreCase);
|
||||
// string headExtras = $"<meta charset='utf-8'><style>{css}</style>";
|
||||
// if (!string.IsNullOrWhiteSpace(baseUri))
|
||||
// headExtras = $"<base href=\"{baseUri}\">{headExtras}";
|
||||
|
||||
// string fullHtml = isFullHtml
|
||||
// ? InjectIntoHead(htmlBody, headExtras)
|
||||
// : $"<!doctype html><html><head>{headExtras}</head><body>{htmlBody}</body></html>";
|
||||
|
||||
// var cfg = new PdfGenerateConfig
|
||||
// {
|
||||
// PageSize = (PdfSharp.PageSize)pageSize,
|
||||
// MarginLeft = margin,
|
||||
// MarginRight = margin,
|
||||
// MarginTop = margin,
|
||||
// MarginBottom = margin
|
||||
// };
|
||||
|
||||
// using var doc = PdfGenerator.GeneratePdf(fullHtml, cfg);
|
||||
// using var ms = new MemoryStream();
|
||||
// doc.Save(ms);
|
||||
// return ms.ToArray();
|
||||
|
||||
// // Inserta contenido en <head> (si existe); si no, lo crea.
|
||||
// static string InjectIntoHead(string html, string toInject)
|
||||
// {
|
||||
// int headOpen = html.IndexOf("<head", StringComparison.OrdinalIgnoreCase);
|
||||
// if (headOpen >= 0)
|
||||
// {
|
||||
// int headClose = html.IndexOf('>', headOpen);
|
||||
// if (headClose > headOpen)
|
||||
// {
|
||||
// return html.Insert(headClose + 1, toInject);
|
||||
// }
|
||||
// }
|
||||
// // No hay <head>, lo creamos
|
||||
// int htmlOpen = html.IndexOf("<html", StringComparison.OrdinalIgnoreCase);
|
||||
// if (htmlOpen >= 0)
|
||||
// {
|
||||
// int htmlTagEnd = html.IndexOf('>', htmlOpen);
|
||||
// if (htmlTagEnd > htmlOpen)
|
||||
// {
|
||||
// return html.Insert(htmlTagEnd + 1, $"<head>{toInject}</head>");
|
||||
// }
|
||||
// }
|
||||
// // Documento raro: envolvemos completo
|
||||
// return $"<!doctype html><html><head>{toInject}</head><body>{html}</body></html>";
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
19
HerramientaCASA/Utilidades.razor
Normal file
19
HerramientaCASA/Utilidades.razor
Normal file
@@ -0,0 +1,19 @@
|
||||
@using BlazorBootstrap
|
||||
|
||||
@code {
|
||||
RenderFragment RenderInfoTooltip(string tituloInfo) => __builder =>
|
||||
{
|
||||
__builder.OpenComponent(0, typeof(Tooltip));
|
||||
__builder.AddAttribute(1, "Title", tituloInfo);
|
||||
__builder.AddAttribute(2, "class", "custom-tooltip");
|
||||
__builder.AddAttribute(3, "role", "button");
|
||||
__builder.AddAttribute(4, "ChildContent", (RenderFragment)(__builder2 =>
|
||||
{
|
||||
__builder2.OpenComponent(5, typeof(Icon));
|
||||
__builder2.AddAttribute(6, "Name", IconName.InfoCircleFill);
|
||||
__builder2.AddAttribute(7, "Class", "text-primary");
|
||||
__builder2.CloseComponent();
|
||||
}));
|
||||
__builder.CloseComponent();
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,18 @@
|
||||
using bdHerramientaCACOA;
|
||||
using bdHerramientaCACOA.db;
|
||||
using bdHerramientaCACOA.dbcontext;
|
||||
using bdHerramientaCACOA.HerramientaURBAN;
|
||||
using BlazorBootstrap;
|
||||
using ClosedXML.Excel;
|
||||
using DocumentFormat.OpenXml.Office2013.Drawing.ChartStyle;
|
||||
using HerramientaCASA.Components.Pages;
|
||||
using HerramientaCASA.Components.Pages.HerramientaCASATabs;
|
||||
using HerramientaCASA.Model;
|
||||
using HerramientaCASA.ViewModel;
|
||||
using IbanNet;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Text;
|
||||
using static bdHerramientaCACOA.CASA;
|
||||
using static HerramientaCASA.Components.Pages.ConfiguracionPages.ConvenioColectivo;
|
||||
|
||||
namespace HerramientaCASA
|
||||
@@ -101,6 +109,7 @@ namespace HerramientaCASA
|
||||
enumeracionObtenida.ValorAlfabetico1 = nuevaEnumeracion.ValorAlfabetico1;
|
||||
enumeracionObtenida.ValorNumerico1 = nuevaEnumeracion.ValorNumerico1;
|
||||
enumeracionObtenida.ValorNumerico2 = nuevaEnumeracion.ValorNumerico2;
|
||||
enumeracionObtenida.ValorAlfabeticoLargo = nuevaEnumeracion.ValorAlfabeticoLargo;
|
||||
enumeracionObtenida.Descripcion = nuevaEnumeracion.ValorAlfabetico1.ToUpper();
|
||||
//enumeracionObtenida.Codigo = codigo + "." + nuevaEnumeracion.ValorAlfabetico1.ToUpper();
|
||||
//enumeracionObtenida.Codigo = nuevaEnumeracion.Codigo.Trim().Replace(" ", "");
|
||||
@@ -153,6 +162,7 @@ namespace HerramientaCASA
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void crearFactorCorrecion(tsHerramientasCACOA bd, factorescorreccion factorCorrecc)
|
||||
{
|
||||
try
|
||||
@@ -196,6 +206,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)
|
||||
//{
|
||||
@@ -333,6 +361,64 @@ namespace HerramientaCASA
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void crearConvenioColectivo(tsHerramientasCACOA bd, ConvenioProvincia concolEdit)
|
||||
{
|
||||
try
|
||||
{
|
||||
bdHerramientaCACOA.db.conveniocolectivo nuevoConvenio;
|
||||
|
||||
var gradoSup = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.TECGRADSUP");
|
||||
var gradoMed = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.GESTPROY");
|
||||
var delin = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.DELINPROY");
|
||||
var admin = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.ADMIN");
|
||||
|
||||
|
||||
agregarConvenio(bd, concolEdit.valorGradoSup, concolEdit.idProvincia, gradoSup.idEnumeracion);
|
||||
agregarConvenio(bd, concolEdit.valorGradoMed, concolEdit.idProvincia, gradoMed.idEnumeracion);
|
||||
agregarConvenio(bd, concolEdit.valorDelinPro, concolEdit.idProvincia, delin.idEnumeracion);
|
||||
agregarConvenio(bd, concolEdit.valorAdmin, concolEdit.idProvincia, admin.idEnumeracion);
|
||||
|
||||
|
||||
var cambiarFecha = bd.enumeraciones.First(x => x.Codigo == "CW.FECHAULTMOD");
|
||||
cambiarFecha.Fecha1 = DateTime.Now;
|
||||
bd.enumeraciones.Update(cambiarFecha);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void eliminarConvenioColectivo(tsHerramientasCACOA bd, ConvenioProvincia convenioColectivo)
|
||||
{
|
||||
try
|
||||
{
|
||||
var listaConveniosBorrar = bd.conveniocolectivo.Where(x => x.idProvincia == convenioColectivo.idProvincia).ToList();
|
||||
|
||||
bd.conveniocolectivo.RemoveRange(listaConveniosBorrar);
|
||||
|
||||
var cambiarFecha = bd.enumeraciones.First(x => x.Codigo == "CW.FECHAULTMOD");
|
||||
cambiarFecha.Fecha1 = DateTime.Now;
|
||||
bd.enumeraciones.Update(cambiarFecha);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void agregarConvenio(tsHerramientasCACOA bd, double valor, string idProvincia, int idGrupo)
|
||||
{
|
||||
bd.conveniocolectivo.Add(new conveniocolectivo
|
||||
{
|
||||
idEnumeracion = idGrupo,
|
||||
idProvincia = idProvincia,
|
||||
CosteAnualTrabajador = valor
|
||||
});
|
||||
}
|
||||
|
||||
public static void eliminarTipologia(tsHerramientasCACOA bd, tipologias tipologiaObtenida)
|
||||
{
|
||||
try
|
||||
@@ -544,5 +630,862 @@ namespace HerramientaCASA
|
||||
URBAN,
|
||||
URBANDSIMP
|
||||
}
|
||||
|
||||
public static RenderFragment CreateTooltip(string titulo) => __builder =>
|
||||
{
|
||||
if (titulo != "") {
|
||||
__builder.OpenComponent(0, typeof(Tooltip));
|
||||
__builder.AddAttribute(1, "Title", titulo);
|
||||
__builder.AddAttribute(2, "class", "custom-tooltip");
|
||||
__builder.AddAttribute(3, "role", "button");
|
||||
__builder.AddAttribute(4, "ChildContent", (RenderFragment)(__builder2 =>
|
||||
{
|
||||
__builder2.OpenComponent(5, typeof(Icon));
|
||||
__builder2.AddAttribute(6, "Name", IconName.InfoCircleFill);
|
||||
__builder2.AddAttribute(7, "Class", "text-primary ");
|
||||
__builder2.CloseComponent();
|
||||
}));
|
||||
__builder.CloseComponent();
|
||||
}
|
||||
};
|
||||
|
||||
public static void guardarEstadisticas(tsHerramientasCACOA bd, HerramientaCASA.UtilidadesCASA.TiposSimulaciones tipoSimulacion, string jsonObjeto, int idSimulador)
|
||||
{
|
||||
estadisticas estadisticas = new estadisticas();
|
||||
|
||||
try
|
||||
{
|
||||
switch (tipoSimulacion)
|
||||
{
|
||||
case TiposSimulaciones.CASA:
|
||||
var casa = System.Text.Json.JsonSerializer.Deserialize<CASA>(jsonObjeto);
|
||||
casa.CalcularFinales();
|
||||
|
||||
if (!comprobarExisteEstadistica(bd, idSimulador))
|
||||
{
|
||||
mapearEstadisticasCASA(bd,estadisticas,casa,idSimulador);
|
||||
bd.estadisticas.Add(estadisticas);
|
||||
}
|
||||
else
|
||||
{
|
||||
var estadisticaExistente = bd.estadisticas.First(x => x.idSimulacion == idSimulador);
|
||||
mapearEstadisticasCASA(bd,estadisticaExistente, casa, idSimulador);
|
||||
}
|
||||
break;
|
||||
case TiposSimulaciones.BAJA:
|
||||
break;
|
||||
case TiposSimulaciones.LICITACIONCASA:
|
||||
var licitacionCASA = System.Text.Json.JsonSerializer.Deserialize<LICITACIONES>(jsonObjeto);
|
||||
|
||||
if (!comprobarExisteEstadistica(bd, idSimulador))
|
||||
{
|
||||
mapearEstadisticasLicitacionCASA(bd,estadisticas, licitacionCASA, idSimulador);
|
||||
bd.estadisticas.Add(estadisticas);
|
||||
}
|
||||
else
|
||||
{
|
||||
var estadisticaExistente = bd.estadisticas.First(x => x.idSimulacion == idSimulador);
|
||||
mapearEstadisticasLicitacionCASA(bd, estadisticaExistente, licitacionCASA, idSimulador);
|
||||
}
|
||||
|
||||
break;
|
||||
case TiposSimulaciones.URBAN:
|
||||
var urban = System.Text.Json.JsonSerializer.Deserialize<URBAN>(jsonObjeto);
|
||||
urban.CalcularFinales();
|
||||
|
||||
if (!comprobarExisteEstadistica(bd, idSimulador))
|
||||
{
|
||||
mapearEstadisticasURBAN(estadisticas, urban, idSimulador);
|
||||
bd.estadisticas.Add(estadisticas);
|
||||
}
|
||||
else
|
||||
{
|
||||
var estadisticaExistente = bd.estadisticas.First(x => x.idSimulacion == idSimulador);
|
||||
mapearEstadisticasURBAN(estadisticaExistente, urban, idSimulador);
|
||||
}
|
||||
break;
|
||||
case TiposSimulaciones.URBANDSIMP:
|
||||
|
||||
var licitacionUrban = System.Text.Json.JsonSerializer.Deserialize<bdHerramientaCACOA.LicitacionesURBAN>(jsonObjeto);
|
||||
|
||||
if (!comprobarExisteEstadistica(bd, idSimulador))
|
||||
{
|
||||
mapearEstadisticasLicitacionURBAN(estadisticas, licitacionUrban, idSimulador);
|
||||
bd.estadisticas.Add(estadisticas);
|
||||
}
|
||||
else
|
||||
{
|
||||
var estadisticaExistente = bd.estadisticas.First(x => x.idSimulacion == idSimulador);
|
||||
mapearEstadisticasLicitacionURBAN(estadisticaExistente, licitacionUrban, idSimulador);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
bd.SaveChanges();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new Exception(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool comprobarExisteEstadistica(tsHerramientasCACOA bd, int idSimulacion)
|
||||
{
|
||||
bool existeEstadistica = false;
|
||||
|
||||
if (bd.estadisticas.Any(x=> x.idSimulacion == idSimulacion))
|
||||
{
|
||||
existeEstadistica = true;
|
||||
}
|
||||
return existeEstadistica;
|
||||
}
|
||||
|
||||
private static void mapearEstadisticasCASA(tsHerramientasCACOA bd,estadisticas estadistica, CASA casa, int idSimulador)
|
||||
{
|
||||
estadistica.idSimulacion = idSimulador;
|
||||
estadistica.numeroTrabajadores = casa.DespachoProfesional.Trabajadores.Sum(x => x.NumTrabajadores);
|
||||
estadistica.totalCosteAnual = casa.DespachoProfesional.CostesDirectosAnuales;
|
||||
estadistica.horasProduccion = casa.DespachoProfesional.HorasTotalesProduccion;
|
||||
estadistica.costeDirecto = casa.DespachoProfesional.CostesDirectos;
|
||||
estadistica.costeIndirecto = casa.DespachoProfesional.TasaCostesIndirectos;
|
||||
estadistica.costeVariable = casa.CostesProduccion.CostesVariables;
|
||||
estadistica.costeHoraDespachoProf = casa.DespachoProfesional.CosteHoraDespachoProfesional;
|
||||
estadistica.totalSupeficie = casa.TrabajoProfesional.Usos.Sum(x=> x.superficie);
|
||||
estadistica.totalFases = casa.TrabajoProfesional.FasesTrabajo.Sum(x => x.Porcentaje);
|
||||
|
||||
estadistica.horasTPEDocumentacion = casa.TrabajoProfesional.HorasTPEDocumentacion;
|
||||
estadistica.horasTPEDireccionObra = casa.TrabajoProfesional.HorasTPEDireccion;
|
||||
estadistica.horasTPE = casa.TrabajoProfesional.TotalHorasTPE;
|
||||
estadistica.porcentajeExternalizacion = casa.CostesProduccion.CoeficienteCostesExternalizacion;
|
||||
estadistica.costeHoraExternalizacion = casa.CostesProduccion.CosteHoraExternalizacion;
|
||||
estadistica.plazoPresentacion = casa.CostesProduccion.PlazoPresentacionDocumentos;
|
||||
estadistica.costeProduccion = casa.CostesProduccion.CostesProduccionTrabProf;
|
||||
estadistica.porcentajeBeneficio = casa.CostesProduccion.Beneficio;
|
||||
estadistica.precioTrabajo = casa.CostesProduccion.PrecioTrabProf;
|
||||
estadistica.totalOtrosTrabajos = casa.CostesProduccion.TotalOtrosTrabajos;
|
||||
estadistica.precioEncargo = casa.CostesProduccion.PrecioDelEncargo;
|
||||
|
||||
|
||||
|
||||
// Rellenar listado usos
|
||||
if (casa.TrabajoProfesional.Usos.Count != 0)
|
||||
{
|
||||
|
||||
var listadoBorrar = bd.estadisticasusos.Where(x=> x.idSimulacion == idSimulador).ToList();
|
||||
bd.estadisticasusos.RemoveRange(listadoBorrar);
|
||||
|
||||
foreach (var uso in casa.TrabajoProfesional.Usos)
|
||||
{
|
||||
|
||||
bd.estadisticasusos.Add(new estadisticasusos
|
||||
{
|
||||
idSimulacion = idSimulador,
|
||||
superficie = uso.superficie,
|
||||
idUso = uso.idGrupoTipologia,
|
||||
idTipologia = uso.idTipologia,
|
||||
idIntervencion = uso.idTipoIntervencion
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Rellenar listado factores complejidad
|
||||
if (casa.TrabajoProfesional.FactoresComplejidad.Count != 0)
|
||||
{
|
||||
var listadoBorrar = bd.estadisticasfactores.Where(x => x.idsimulacion == idSimulador).ToList();
|
||||
bd.estadisticasfactores.RemoveRange(listadoBorrar);
|
||||
|
||||
foreach (var factor in casa.TrabajoProfesional.FactoresComplejidad)
|
||||
{
|
||||
|
||||
bd.estadisticasfactores.Add(new estadisticasfactores
|
||||
{
|
||||
idsimulacion = idSimulador,
|
||||
nombre = factor.Nombre,
|
||||
coeficiente = factor.coeficiente,
|
||||
tipo = "Complejidad"
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Rellenar listado factores rendimiento
|
||||
if (casa.TrabajoProfesional.FactoresRendimiento.Count != 0)
|
||||
{
|
||||
var listadoBorrar = bd.estadisticasfactores.Where(x => x.idsimulacion == idSimulador).ToList();
|
||||
bd.estadisticasfactores.RemoveRange(listadoBorrar);
|
||||
|
||||
foreach (var factor in casa.TrabajoProfesional.FactoresRendimiento)
|
||||
{
|
||||
|
||||
bd.estadisticasfactores.Add(new estadisticasfactores
|
||||
{
|
||||
idsimulacion = idSimulador,
|
||||
nombre = factor.Nombre,
|
||||
coeficiente = factor.coeficiente,
|
||||
tipo = "Rendimiento"
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void mapearEstadisticasLicitacionCASA(tsHerramientasCACOA bd, estadisticas estadistica, LICITACIONES licitacion, int idSimulador)
|
||||
{
|
||||
estadistica.idSimulacion = idSimulador;
|
||||
estadistica.costeHoraDespachoProf = licitacion.costeHoraProduccion;
|
||||
estadistica.totalSupeficie = licitacion.Usos.Sum(x => x.superficie);
|
||||
estadistica.totalFases = licitacion.FasesTrabajo.Sum(x=> x.Porcentaje);
|
||||
|
||||
estadistica.horasTPE = licitacion.horasProduccion;
|
||||
estadistica.plazoPresentacion = licitacion.PlazoPresentacionDocumentos;
|
||||
estadistica.costeProduccion = licitacion.CostesProduccionTrabProf;
|
||||
estadistica.precioTrabajo = licitacion.PrecioTrabProf;
|
||||
estadistica.totalOtrosTrabajos = licitacion.TotalOtrosTrabajos;
|
||||
estadistica.precioEncargo = licitacion.PrecioDelEncargo;
|
||||
|
||||
// Rellenar listado usos
|
||||
if (licitacion.Usos.Count != 0)
|
||||
{
|
||||
|
||||
var listadoBorrar = bd.estadisticasusos.Where(x => x.idSimulacion == idSimulador).ToList();
|
||||
bd.estadisticasusos.RemoveRange(listadoBorrar);
|
||||
|
||||
foreach (var uso in licitacion.Usos)
|
||||
{
|
||||
|
||||
bd.estadisticasusos.Add(new estadisticasusos
|
||||
{
|
||||
idSimulacion = idSimulador,
|
||||
superficie = uso.superficie,
|
||||
idUso = uso.idGrupoTipologia,
|
||||
idTipologia = uso.idTipologia,
|
||||
idIntervencion = uso.idTipoIntervencion
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void mapearEstadisticasURBAN(estadisticas estadistica, URBAN urban, int idSimulador)
|
||||
{
|
||||
estadistica.idSimulacion = idSimulador;
|
||||
estadistica.numeroTrabajadores = urban.DespachoProfesional.Trabajadores.Sum(x => x.NumTrabajadores);
|
||||
estadistica.totalCosteAnual = urban.DespachoProfesional.CostesDirectosAnuales;
|
||||
estadistica.costeDirecto = urban.DespachoProfesional.CostesDirectos;
|
||||
estadistica.costeIndirecto = urban.DespachoProfesional.TasaCostesIndirectos;
|
||||
estadistica.costeVariable = urban.CostesProduccion.CostesVariables;
|
||||
estadistica.costeHoraDespachoProf = urban.DespachoProfesional.CosteHoraDespachoProfesional;
|
||||
|
||||
//obtener tipodocumento
|
||||
estadistica.tipoDocumento = urban.Enumerados.TiposDeDocumentos.First(x=> x.idEnumeracion == urban.TrabajoProfesional.idTipoDocumentacion).ValorAlfabetico1;
|
||||
|
||||
//obtener documento
|
||||
var listadoDocumentos = urban.Enumerados.ProyectosPorTipo(urban.TrabajoProfesional.idTipoDocumentacion);
|
||||
estadistica.documento = listadoDocumentos.First(x=> x.idtipoproyectos == urban.TrabajoProfesional.idTipoProyecto).Descripcion;
|
||||
|
||||
//obtener datos necesarios
|
||||
var listadoDocumentacionNecesaria = urban.TrabajoProfesional.DatosNecesarios;
|
||||
estadistica.dato1 = listadoDocumentacionNecesaria[0].ValorNecesario.ToString();
|
||||
estadistica.dato2 = listadoDocumentacionNecesaria[1].ValorNecesario.ToString();
|
||||
|
||||
var valorDato3 = listadoDocumentacionNecesaria[2].esCheckbox ? listadoDocumentacionNecesaria[2].esCheckbox.ToString() : listadoDocumentacionNecesaria[2].ValorNecesario.ToString();
|
||||
|
||||
if (valorDato3.ToLower().Contains("false"))
|
||||
{
|
||||
estadistica.dato3 = "FALSO";
|
||||
}else if (valorDato3.ToLower().Contains("true"))
|
||||
{
|
||||
estadistica.dato3 = "VERDADERO";
|
||||
}
|
||||
else
|
||||
{
|
||||
estadistica.dato3 = valorDato3.ToString();
|
||||
}
|
||||
|
||||
estadistica.totalFases = urban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
estadistica.innovacion = urban.TrabajoProfesional.valorInstrumentos;
|
||||
estadistica.horasTPE = urban.TrabajoProfesional.horasTrabProfesional;
|
||||
estadistica.porcentajeExternalizacion = urban.CostesProduccion.CoeficienteCostesExternalizacion;
|
||||
estadistica.costeHoraExternalizacion = urban.CostesProduccion.CosteHoraExternalizacion;
|
||||
estadistica.plazoPresentacion = urban.CostesProduccion.PlazoPresentacionDocumentos;
|
||||
estadistica.costeProduccion = urban.CostesProduccion.CostesProduccionTrabProf;
|
||||
estadistica.porcentajeBeneficio = urban.CostesProduccion.Beneficio;
|
||||
estadistica.precioTrabajo = urban.CostesProduccion.PrecioTrabajoProfesional;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static void mapearEstadisticasLicitacionURBAN(estadisticas estadistica, bdHerramientaCACOA.LicitacionesURBAN licitacionUrban, int idSimulador)
|
||||
{
|
||||
estadistica.idSimulacion = idSimulador;
|
||||
estadistica.costeHoraDespachoProf = licitacionUrban.CosteHP;
|
||||
|
||||
//obtener tipodocumento
|
||||
estadistica.tipoDocumento = licitacionUrban.Enumerados.TiposDeDocumentos.First(x => x.idEnumeracion == licitacionUrban.TrabajoProfesional.idTipoDocumentacion).ValorAlfabetico1;
|
||||
|
||||
//obtener documento
|
||||
var listadoDocumentos = licitacionUrban.Enumerados.ProyectosPorTipo(licitacionUrban.TrabajoProfesional.idTipoDocumentacion);
|
||||
estadistica.documento = listadoDocumentos.First(x => x.idtipoproyectos == licitacionUrban.TrabajoProfesional.idTipoProyecto).Descripcion;
|
||||
|
||||
//obtener datos necesarios
|
||||
var listadoDocumentacionNecesaria = licitacionUrban.TrabajoProfesional.DatosNecesarios;
|
||||
estadistica.dato1 = listadoDocumentacionNecesaria[0].ValorNecesario.ToString();
|
||||
estadistica.dato2 = listadoDocumentacionNecesaria[1].ValorNecesario.ToString();
|
||||
|
||||
var valorDato3 = listadoDocumentacionNecesaria[2].esCheckbox ? listadoDocumentacionNecesaria[2].esCheckbox.ToString() : listadoDocumentacionNecesaria[2].ValorNecesario.ToString();
|
||||
|
||||
if (valorDato3.ToLower().Contains("false"))
|
||||
{
|
||||
estadistica.dato3 = "FALSO";
|
||||
}
|
||||
else if (valorDato3.ToLower().Contains("true"))
|
||||
{
|
||||
estadistica.dato3 = "VERDADERO";
|
||||
}
|
||||
else
|
||||
{
|
||||
estadistica.dato3 = valorDato3.ToString();
|
||||
}
|
||||
|
||||
estadistica.totalFases = licitacionUrban.TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
estadistica.innovacion = licitacionUrban.TrabajoProfesional.valorInstrumentos;
|
||||
estadistica.horasTPE = licitacionUrban.TrabajoProfesional.horasTrabProfesional;
|
||||
estadistica.plazoPresentacion = licitacionUrban.PlazoPresentacionDocumentos;
|
||||
estadistica.costeProduccion = licitacionUrban.CostesProduccionTrabProf;
|
||||
estadistica.precioTrabajo = licitacionUrban.PrecioDelTrabajo;
|
||||
}
|
||||
|
||||
|
||||
public static double? comprobarNull(double? dato, int cantidadProyecto)
|
||||
{
|
||||
double? datoFinal = null;
|
||||
|
||||
if (dato != null)
|
||||
{
|
||||
datoFinal = dato / cantidadProyecto;
|
||||
}
|
||||
|
||||
return datoFinal;
|
||||
}
|
||||
|
||||
|
||||
public static bool comprobarFechas(DateTime fechaInicio, DateTime fechaFinal)
|
||||
{
|
||||
bool fechaValida = false;
|
||||
|
||||
if (fechaFinal.Date >= fechaInicio.Date)
|
||||
{
|
||||
fechaValida = true;
|
||||
}
|
||||
|
||||
return fechaValida;
|
||||
}
|
||||
|
||||
|
||||
public static bool comprobarFechasNulas(DateTime? fechaInicio, DateTime? fechaFinal)
|
||||
{
|
||||
bool fechaValida = false;
|
||||
|
||||
if (fechaFinal != null && fechaInicio != null)
|
||||
{
|
||||
fechaValida = true;
|
||||
}
|
||||
|
||||
return fechaValida;
|
||||
}
|
||||
|
||||
|
||||
public static List<EstadistiaHerraCasaVM> rellenarListadoCASA(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
List<EstadistiaHerraCasaVM> listadoEstadisticasExcel = new List<EstadistiaHerraCasaVM> ();
|
||||
|
||||
foreach (estadisticas estadistica in listadoEstadistica)
|
||||
{
|
||||
listadoEstadisticasExcel.Add(new EstadistiaHerraCasaVM
|
||||
{
|
||||
idSimulacion = estadistica.idSimulacionNavigation?.Descripcion,
|
||||
numeroTrabajadores = estadistica.numeroTrabajadores,
|
||||
costeAnualTotal = estadistica.totalCosteAnual,
|
||||
horasProduccion = estadistica.horasProduccion,
|
||||
costesDirectos = estadistica.costeDirecto,
|
||||
costesIndirectos = estadistica.costeIndirecto,
|
||||
costesVariables = estadistica.costeVariable,
|
||||
costeDespacho = estadistica.costeHoraDespachoProf,
|
||||
totalSuperficie = estadistica.totalSupeficie,
|
||||
porcentajeFases = estadistica.totalFases,
|
||||
horasDocumentacion = estadistica.horasTPEDocumentacion,
|
||||
horasDireccionObra = estadistica.horasTPEDireccionObra,
|
||||
horasTrabajo = estadistica.horasTPE,
|
||||
porcentajeExternalizacion = estadistica.porcentajeExternalizacion,
|
||||
costeExternalizacion = estadistica.costeHoraExternalizacion,
|
||||
plazoPresentacion = estadistica.plazoPresentacion,
|
||||
costeProduccion = estadistica.costeProduccion,
|
||||
beneficio = estadistica.porcentajeBeneficio,
|
||||
precioTrabajo = estadistica.precioTrabajo,
|
||||
totalOtrosTrabajos = estadistica.totalOtrosTrabajos,
|
||||
precioEncargo = estadistica.precioEncargo
|
||||
});
|
||||
}
|
||||
|
||||
return listadoEstadisticasExcel;
|
||||
}
|
||||
|
||||
public static List<EstadisticaUsosVM> rellenarListadoUsos(tsHerramientasCACOA bd, List<bdHerramientaCACOA.db.estadisticasusos> listadoEstadisticaUsos)
|
||||
{
|
||||
List<EstadisticaUsosVM> listadoEstadisticasUsosExcel = new List<EstadisticaUsosVM>();
|
||||
|
||||
foreach (estadisticasusos estadistica in listadoEstadisticaUsos)
|
||||
{
|
||||
listadoEstadisticasUsosExcel.Add(new EstadisticaUsosVM
|
||||
{
|
||||
idSimulacion = estadistica.idSimulacionNavigation?.Descripcion,
|
||||
superficie = estadistica.superficie,
|
||||
uso = bd.enumeraciones.First(x=> x.idEnumeracion == estadistica.idUso).ValorAlfabetico1,
|
||||
tipologia = bd.tipologias.First(x=> x.idtipologia == estadistica.idTipologia).Descripcion,
|
||||
intervencion = bd.enumeraciones.First(x=> x.idEnumeracion == estadistica.idIntervencion).ValorAlfabetico1,
|
||||
});
|
||||
}
|
||||
|
||||
return listadoEstadisticasUsosExcel;
|
||||
}
|
||||
public static List<EstadisticasFactoresVM> rellenarListadoFactores(tsHerramientasCACOA bd, List<bdHerramientaCACOA.db.estadisticasfactores> listadoEstadisticaFactores)
|
||||
{
|
||||
List<EstadisticasFactoresVM> listadoEstadisticaFactoresExcel = new List<EstadisticasFactoresVM>();
|
||||
|
||||
foreach (estadisticasfactores estadistica in listadoEstadisticaFactores)
|
||||
{
|
||||
listadoEstadisticaFactoresExcel.Add(new EstadisticasFactoresVM
|
||||
{
|
||||
idSimulacion = estadistica.idsimulacionNavigation?.Descripcion,
|
||||
nombre = estadistica.nombre,
|
||||
coeficiente =estadistica.coeficiente,
|
||||
tipo = estadistica.tipo
|
||||
});
|
||||
}
|
||||
|
||||
return listadoEstadisticaFactoresExcel;
|
||||
}
|
||||
|
||||
public static List<EstadisticasUrbanVM> rellenarListadoURBAN(List<bdHerramientaCACOA.db.estadisticas> listadoEstadisticaUrban)
|
||||
{
|
||||
List<EstadisticasUrbanVM> listadoEstadisticasUrbanExcel = new List<EstadisticasUrbanVM>();
|
||||
|
||||
foreach (estadisticas estadistica in listadoEstadisticaUrban)
|
||||
{
|
||||
listadoEstadisticasUrbanExcel.Add(new EstadisticasUrbanVM
|
||||
{
|
||||
idSimulacion = estadistica.idSimulacionNavigation?.Descripcion,
|
||||
numeroTrabajadores = estadistica.numeroTrabajadores,
|
||||
costeAnualTotal = estadistica.totalCosteAnual,
|
||||
horasProduccion = estadistica.horasProduccion,
|
||||
costesDirectos = estadistica.costeDirecto,
|
||||
costesIndirectos = estadistica.costeIndirecto,
|
||||
costesVariables = estadistica.costeVariable,
|
||||
costeDespacho = estadistica.costeHoraDespachoProf,
|
||||
tipoDocumento = estadistica.tipoDocumento,
|
||||
documento = estadistica.documento,
|
||||
dato1 = estadistica.dato1,
|
||||
dato2 = estadistica.dato2,
|
||||
dato3 = estadistica.dato3,
|
||||
porcentajeFases = estadistica.totalFases,
|
||||
innovacion = estadistica.innovacion,
|
||||
horasTrabajo = estadistica.horasTPE,
|
||||
porcentajeExternalizacion = estadistica.porcentajeExternalizacion,
|
||||
costeExternalizacion = estadistica.costeHoraExternalizacion,
|
||||
plazoPresentacion = estadistica.plazoPresentacion,
|
||||
costeProduccion = estadistica.costeProduccion,
|
||||
beneficio = estadistica.porcentajeBeneficio,
|
||||
precioTrabajo = estadistica.precioTrabajo,
|
||||
});
|
||||
}
|
||||
|
||||
return listadoEstadisticasUrbanExcel;
|
||||
}
|
||||
|
||||
|
||||
public static double pasarHorasASemana(double horas)
|
||||
{
|
||||
double semanas = 0;
|
||||
double horasSemanales = 7 * 24;
|
||||
|
||||
semanas = horas / horasSemanales;
|
||||
|
||||
return semanas;
|
||||
}
|
||||
|
||||
|
||||
public static byte[] GenerarExcelCasa(
|
||||
tsHerramientasCACOA bd,
|
||||
List<estadisticas> listadoHerramientaEstadistica,
|
||||
List<estadisticasusos> listadoHerramientaEstadisticaUsos,
|
||||
List<estadisticasfactores> listadoHerramientaEstadisticaFactores)
|
||||
{
|
||||
using var wb = new XLWorkbook();
|
||||
IXLWorksheet ws ;
|
||||
string tituloExcel = "Herramienta CASA";
|
||||
|
||||
if (listadoHerramientaEstadisticaFactores == null)
|
||||
{
|
||||
tituloExcel = "Licitación CASA";
|
||||
ws = wb.Worksheets.Add("Licitación CASA");
|
||||
}
|
||||
else
|
||||
{
|
||||
ws = wb.Worksheets.Add("Herramienta CASA");
|
||||
}
|
||||
|
||||
var tablaPrincipal = generarTablaPrincipal(ws, listadoHerramientaEstadistica, tituloExcel);
|
||||
|
||||
int filaSiguiente = tablaPrincipal.RangeAddress.LastAddress.RowNumber + 5;
|
||||
|
||||
int ultimaFilaUso = generarTablaUsos(bd,ws, filaSiguiente, listadoHerramientaEstadisticaUsos);
|
||||
ultimaFilaUso += 5;
|
||||
|
||||
if (listadoHerramientaEstadisticaFactores != null)
|
||||
{
|
||||
generarTablaFactores(bd, ws, ultimaFilaUso, listadoHerramientaEstadisticaFactores);
|
||||
}
|
||||
|
||||
using var ms = new MemoryStream();
|
||||
wb.SaveAs(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
private static IXLTable? generarTablaPrincipal(IXLWorksheet? ws, List<estadisticas> listadoHerramientaEstadistica, string tituloExcel)
|
||||
{
|
||||
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 = tituloExcel;
|
||||
|
||||
// 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 static int generarTablaUsos(tsHerramientasCACOA bd, IXLWorksheet ws, int filaValida, List<estadisticasusos> listadoHerramientaEstadisticaUsos)
|
||||
{
|
||||
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 static int generarTablaFactores(tsHerramientasCACOA bd, IXLWorksheet ws, int filaValida, List<estadisticasfactores> listadoHerramientaEstadisticaFactores)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static byte[] GenerarExcelURBAN(tsHerramientasCACOA bd, List<estadisticas> listadoUrbanEstadistica, string tipoHerramienta)
|
||||
{
|
||||
using var wb = new XLWorkbook();
|
||||
IXLWorksheet ws;
|
||||
string tituloExcel = tipoHerramienta;
|
||||
ws = wb.Worksheets.Add(tipoHerramienta);
|
||||
|
||||
crearTablaURBAN( ws,listadoUrbanEstadistica, tipoHerramienta);
|
||||
|
||||
using var ms = new MemoryStream();
|
||||
wb.SaveAs(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static IXLTable? crearTablaURBAN(IXLWorksheet? ws, List<estadisticas> listadoHerramientaEstadisticaUrban, string tituloExcel)
|
||||
{
|
||||
var datos = UtilidadesCASA.rellenarListadoURBAN(listadoHerramientaEstadisticaUrban);
|
||||
|
||||
// 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 = tituloExcel;
|
||||
|
||||
// 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 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
28
HerramientaCASA/ViewModel/EstadistiaHerraCasaVM.cs
Normal file
28
HerramientaCASA/ViewModel/EstadistiaHerraCasaVM.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace HerramientaCASA.ViewModel
|
||||
{
|
||||
public class EstadistiaHerraCasaVM
|
||||
{
|
||||
|
||||
public string? idSimulacion { get; set; }
|
||||
public double? numeroTrabajadores { get; set; }
|
||||
public double? costeAnualTotal { get; set; }
|
||||
public double? horasProduccion { get; set; }
|
||||
public double? costesDirectos { get; set; }
|
||||
public double? costesIndirectos { get; set; }
|
||||
public double? costesVariables { get; set; }
|
||||
public double? costeDespacho { get; set; }
|
||||
public double? totalSuperficie { get; set; }
|
||||
public double? porcentajeFases { get; set; }
|
||||
public double? horasDocumentacion { get; set; }
|
||||
public double? horasDireccionObra { get; set; }
|
||||
public double? horasTrabajo { get; set; }
|
||||
public double? porcentajeExternalizacion { get; set; }
|
||||
public double? costeExternalizacion { get; set; }
|
||||
public double? plazoPresentacion { get; set; }
|
||||
public double? costeProduccion { get; set; }
|
||||
public double? beneficio { get; set; }
|
||||
public double? precioTrabajo { get; set; }
|
||||
public double? totalOtrosTrabajos { get; set; }
|
||||
public double? precioEncargo { get; set; }
|
||||
}
|
||||
}
|
||||
11
HerramientaCASA/ViewModel/EstadisticaUsosVM.cs
Normal file
11
HerramientaCASA/ViewModel/EstadisticaUsosVM.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace HerramientaCASA.ViewModel
|
||||
{
|
||||
public class EstadisticaUsosVM
|
||||
{
|
||||
public string? idSimulacion { get; set; }
|
||||
public double? superficie { get;set; }
|
||||
public string? uso { get; set; }
|
||||
public string? tipologia { get; set; }
|
||||
public string? intervencion { get; set; }
|
||||
}
|
||||
}
|
||||
10
HerramientaCASA/ViewModel/EstadisticasFactoresVM.cs
Normal file
10
HerramientaCASA/ViewModel/EstadisticasFactoresVM.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace HerramientaCASA.ViewModel
|
||||
{
|
||||
public class EstadisticasFactoresVM
|
||||
{
|
||||
public string? idSimulacion { get; set; }
|
||||
public string? nombre { get; set; }
|
||||
public double? coeficiente { get; set; }
|
||||
public string? tipo { get; set; }
|
||||
}
|
||||
}
|
||||
29
HerramientaCASA/ViewModel/EstadisticasUrbanVM.cs
Normal file
29
HerramientaCASA/ViewModel/EstadisticasUrbanVM.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace HerramientaCASA.ViewModel
|
||||
{
|
||||
public class EstadisticasUrbanVM
|
||||
{
|
||||
public string? idSimulacion { get; set; }
|
||||
public double? numeroTrabajadores { get; set; }
|
||||
public double? costeAnualTotal { get; set; }
|
||||
public double? horasProduccion { get; set; }
|
||||
public double? costesDirectos { get; set; }
|
||||
public double? costesIndirectos { get; set; }
|
||||
public double? costesVariables { get; set; }
|
||||
public double? costeDespacho { get; set; }
|
||||
|
||||
public string? tipoDocumento { get; set; }
|
||||
public string? documento { get; set; }
|
||||
public string? dato1 { get; set; }
|
||||
public string? dato2 { get; set; }
|
||||
public string? dato3 { get; set; }
|
||||
public double? porcentajeFases { get; set; }
|
||||
public double? innovacion { get; set; }
|
||||
public double? horasTrabajo { get; set; }
|
||||
public double? porcentajeExternalizacion { get; set; }
|
||||
public double? costeExternalizacion { get; set; }
|
||||
public double? plazoPresentacion { get; set; }
|
||||
public double? costeProduccion { get; set; }
|
||||
public double? beneficio { get; set; }
|
||||
public double? precioTrabajo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
//"WriteConnection": "Server=localhost;Port=22222;Database=herramientascacoa;User Id=cacoa;Password=cacoa2018-;",
|
||||
//"ReadOnlyConnection": "Server=localhost;Port=22222;Database=herramientascacoa;User Id=cacoa;Password=cacoa2018-;"
|
||||
"WriteConnection": "Server=77.229.174.85;Port=22222;Database=herramientascacoa;User Id=cacoa;Password=cacoa2018-;",
|
||||
"ReadOnlyConnection": "Server=77.229.174.85;Port=22222;Database=herramientascacoa;User Id=cacoa;Password=cacoa2018-;"
|
||||
},
|
||||
|
||||
@@ -4,6 +4,15 @@ body {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logoCacoa {
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
@@ -56,14 +65,14 @@ body {
|
||||
|
||||
.tdAlter {
|
||||
font-weight: bold;
|
||||
background: #ffc107;
|
||||
background: #ffc107 !important;
|
||||
/*color: white;*/
|
||||
}
|
||||
|
||||
.tdAlterSub {
|
||||
background: #ffc107;
|
||||
font-size:15px;
|
||||
text-align:end;
|
||||
background: #ffc107 !important;
|
||||
font-size: 15px;
|
||||
text-align: end;
|
||||
/*color: white;*/
|
||||
}
|
||||
.hrCasa {
|
||||
@@ -484,7 +493,30 @@ li.nav-item.active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.guardarNombre {
|
||||
width:100%;
|
||||
display:flex;
|
||||
}
|
||||
.impriManual {
|
||||
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.arealogin {
|
||||
margin-left: 20px !important;
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
.guardarNombre {
|
||||
display:block;
|
||||
}
|
||||
.impriManual {
|
||||
height: 36px;
|
||||
position:absolute;
|
||||
right:0px;
|
||||
}
|
||||
.tituloSim {
|
||||
margin-top:8px;
|
||||
}
|
||||
.top-menu {
|
||||
top: 6px;
|
||||
right: 52px;
|
||||
@@ -597,8 +629,10 @@ button.btn.btn-link.dxbs-button {
|
||||
}
|
||||
|
||||
.div-center {
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
max-width: 400px;
|
||||
max-height: 400px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -606,8 +640,6 @@ button.btn.btn-link.dxbs-button {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
overflow: auto;
|
||||
padding: 1em 2em;
|
||||
border-bottom: 2px solid #ccc;
|
||||
@@ -794,3 +826,78 @@ div.content {
|
||||
.TotalesTabla{
|
||||
border:0px !important;
|
||||
}
|
||||
|
||||
.TablaImprimir table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 984pt;
|
||||
}
|
||||
|
||||
.TablaImprimir thead tr th {
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
.TablaImprimir tbody {
|
||||
border-top: 1px solid black;
|
||||
border-bottom: 1px solid black;
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
.TablaImprimir tbody tr {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.TablaImprimir td, th {
|
||||
padding: 8px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.TablaImprimir tfoot {
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
|
||||
.TituloTablaImprimir {
|
||||
color: #078b98 !important;
|
||||
font-size: 11pt;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.NombreSimulacionImprimir{
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
.EncabezadoImprimir{
|
||||
padding-left:20px;
|
||||
padding-right:20px;
|
||||
margin-bottom:100px;
|
||||
font-size:11pt;
|
||||
}
|
||||
|
||||
.FooterImprimir {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
margin-top: 100px;
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
|
||||
.puntoInfo{
|
||||
display:flex;
|
||||
gap:5px;
|
||||
}
|
||||
|
||||
.pagePrincipal{
|
||||
margin:30px;
|
||||
}
|
||||
.espacioTablas {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.centrarChecksImprimir {
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
display: flex;
|
||||
}
|
||||
21
HerramientaCASA/wwwroot/Imprimir/HeaderImprimir.html
Normal file
21
HerramientaCASA/wwwroot/Imprimir/HeaderImprimir.html
Normal file
File diff suppressed because one or more lines are too long
@@ -1,34 +1,44 @@
|
||||
function pestanaActiva(pestana) {
|
||||
var links = document.getElementsByClassName("navBarLink")
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
if (links[i].classList.contains("linkNavActivo") == true)
|
||||
links[i].classList.remove("linkNavActivo")
|
||||
}
|
||||
window.abrirManual = function (url) {
|
||||
window.open(url, '_blank');
|
||||
};
|
||||
|
||||
if (document.getElementById(pestana).classList.contains("linkNavActivo") == false) {
|
||||
document.getElementById(pestana).classList.add("linkNavActivo")
|
||||
}
|
||||
}
|
||||
|
||||
function eliminarCookies(id, cut) {
|
||||
var theCookies = document.cookie.split(';');
|
||||
for (var i = 0; i < theCookies.length; i++) {
|
||||
if (theCookies[i].trim().indexOf(id) >= 0 && theCookies[i].trim().indexOf(cut) == -1) {
|
||||
ASPxClientUtils.DeleteCookie(theCookies[i].trim().split("=")[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
function getUrlParameter(sParam) {
|
||||
var sPageURL = window.location.search.substring(1),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
window.mostrarPdf = function (base64Data) {
|
||||
let byteArray = Uint8Array.from(atob(base64Data), c => c.charCodeAt(0));
|
||||
let blob = new Blob([byteArray], { type: "application/pdf" });
|
||||
let url = URL.createObjectURL(blob);
|
||||
window.open(url, "_blank");
|
||||
};
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
|
||||
}
|
||||
window.obtenerPDFImprimir = function (paginaImprimir) {
|
||||
let DespachoImprimir = document.getElementById(paginaImprimir);
|
||||
|
||||
let html = DespachoImprimir.outerHTML;
|
||||
return html;
|
||||
};
|
||||
|
||||
|
||||
window.descargarExcel = function (fileName, base64Data) {
|
||||
const link = document.createElement('a');
|
||||
link.href = 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,' + base64Data;
|
||||
link.download = fileName;
|
||||
link.click();
|
||||
};
|
||||
|
||||
|
||||
window.descargarPdf = function (fileName, base64Data) {
|
||||
const link = document.createElement('a');
|
||||
link.href = 'data:application/pdf;base64,' + base64Data;
|
||||
link.download = fileName;
|
||||
link.click();
|
||||
};
|
||||
|
||||
|
||||
window.verRutaReferrer = function () {
|
||||
try {
|
||||
return window.parent.location.href;
|
||||
} catch (e) {
|
||||
return document.referrer;
|
||||
}
|
||||
};
|
||||
Binary file not shown.
@@ -34,6 +34,7 @@ namespace bdHerramientaCACOA
|
||||
public double OtrosCostes { get; set; } = 0.03;
|
||||
}
|
||||
public class EnumeradosCASA {
|
||||
public List<puntosinformacion> PuntosInformacion { get; set; } = new List<puntosinformacion>();
|
||||
public List<enumeracionesCASA> Periodos { get; set; } = new List<enumeracionesCASA>();
|
||||
public List<enumeracionesCASA> GruposTipologias { get; set; } = new List<enumeracionesCASA>();
|
||||
public List<enumeracionesCASA> Intervenciones { get; set; } = new List<enumeracionesCASA>();
|
||||
@@ -53,7 +54,7 @@ namespace bdHerramientaCACOA
|
||||
|
||||
}
|
||||
|
||||
public string NombreSimulacion { get; set; } = "Simulacion CASA " + DateTime.Now;
|
||||
public string NombreSimulacion { get; set; } = "CASA Edificación " + DateTime.Now;
|
||||
|
||||
private CASADespachoProfesional _DespachoProfesional = new CASADespachoProfesional();
|
||||
public CASADespachoProfesional DespachoProfesional {
|
||||
@@ -98,6 +99,7 @@ namespace bdHerramientaCACOA
|
||||
ci.Concepto = enu.ValorAlfabetico1;
|
||||
ci.idPeriodicidad = perMensual.idEnumeracion;
|
||||
ci.valorPeriodo = (double)perMensual.ValorNumerico1;
|
||||
ci.idPuntoInformacion = string.IsNullOrEmpty(enu.ValorAlfabetico4) ? 0 : int.Parse(enu.ValorAlfabetico4);
|
||||
DespachoProfesional.CostesIndirectos.Add(ci);
|
||||
}
|
||||
}
|
||||
@@ -105,6 +107,9 @@ namespace bdHerramientaCACOA
|
||||
checkListCostIndirectos(listaCosteIndirectos);
|
||||
|
||||
|
||||
Enumerados.PuntosInformacion = bd.puntosinformacion.Where(x=>x.idTipoHerramienta == 31).ToList();
|
||||
|
||||
|
||||
Enumerados.ListaFactoresCorrecion = ListaFactoresCorreccionCASA(bd.factorescorreccion.ToList());
|
||||
//Cargamos los coeficientes correctores
|
||||
//Complejidad
|
||||
@@ -118,6 +123,7 @@ namespace bdHerramientaCACOA
|
||||
fc.idTipoFactor = enu.idEnumeracion;
|
||||
fc.Nombre = enu.ValorAlfabetico1;
|
||||
fc.idCorrecion = Enumerados.FactoresCorreccionPorGrupo(fc.idTipoFactor).First(x => x.Coeficiente == 0).idFactorCorreccion;
|
||||
fc.idPuntoInformacion = string.IsNullOrEmpty(enu.ValorAlfabetico4) ? 0 : int.Parse(enu.ValorAlfabetico4);
|
||||
|
||||
TrabajoProfesional.FactoresComplejidad.Add(fc);
|
||||
}
|
||||
@@ -134,7 +140,7 @@ namespace bdHerramientaCACOA
|
||||
fc.idTipoFactor = enu.idEnumeracion;
|
||||
fc.Nombre = enu.ValorAlfabetico1;
|
||||
fc.idCorrecion = Enumerados.FactoresCorreccionPorGrupo(fc.idTipoFactor).First(x => x.Coeficiente == 0).idFactorCorreccion;
|
||||
|
||||
fc.idPuntoInformacion = string.IsNullOrEmpty(enu.ValorAlfabetico4) ? 0 : int.Parse(enu.ValorAlfabetico4);
|
||||
TrabajoProfesional.FactoresRendimiento.Add(fc);
|
||||
}
|
||||
}
|
||||
@@ -450,6 +456,11 @@ namespace bdHerramientaCACOA
|
||||
double totalHorasTPEDireccion = CalcularHorasTPEDireccion();
|
||||
TrabajoProfesional.HorasTPEDireccion = double.IsNaN(totalHorasTPEDireccion) ? 0 : totalHorasTPEDireccion;
|
||||
TrabajoProfesional.TotalHorasTPE = totalHorasTPEDocu + totalHorasTPEDireccion;
|
||||
|
||||
TrabajoProfesional.HorasTPEEstimacion = TrabajoProfesional.HorasTPE;
|
||||
TrabajoProfesional.HorasTPEDocumentacionEstimacion = TrabajoProfesional.HorasTPEDocumentacion;
|
||||
TrabajoProfesional.HorasTPEDireccionEstimacion = TrabajoProfesional.HorasTPEDireccion;
|
||||
|
||||
CalcularCostesProduccion();
|
||||
}
|
||||
public void CalcularHorasTPEManual(double horasDocu, double horasDireccion)
|
||||
@@ -457,6 +468,7 @@ namespace bdHerramientaCACOA
|
||||
TrabajoProfesional.HorasTPEDocumentacion = horasDocu;
|
||||
TrabajoProfesional.HorasTPEDireccion = horasDireccion;
|
||||
TrabajoProfesional.HorasTPE = horasDocu + horasDireccion;
|
||||
TrabajoProfesional.TotalHorasTPE = horasDocu + horasDireccion;
|
||||
CalcularCostesProduccion();
|
||||
}
|
||||
public double CalcularHorasTrabajoProfesionalEdificacion()
|
||||
@@ -525,10 +537,12 @@ namespace bdHerramientaCACOA
|
||||
|
||||
public void ActualizarFaseCalculo(double horasOriginal)
|
||||
{
|
||||
TrabajoProfesional.TotalHorasTPE = horasOriginal;
|
||||
TrabajoProfesional.HorasTPE = horasOriginal;
|
||||
TrabajoProfesional.HorasTPEDocumentacion = CalcularHorasTPEDocumentacion();
|
||||
TrabajoProfesional.HorasTPEDireccion = CalcularHorasTPEDireccion();
|
||||
TrabajoProfesional.HorasTPE = TrabajoProfesional.HorasTPEDocumentacion + TrabajoProfesional.HorasTPEDireccion;
|
||||
TrabajoProfesional.TotalHorasTPE = TrabajoProfesional.HorasTPEDocumentacion + TrabajoProfesional.HorasTPEDireccion;
|
||||
}
|
||||
|
||||
public double CalcularSuperficieTotal()
|
||||
@@ -754,6 +768,7 @@ namespace bdHerramientaCACOA
|
||||
public double importe { get; set; } = 0;
|
||||
public int idPeriodicidad { get; set; } = 0;
|
||||
public double valorPeriodo { get; set; } = 0;
|
||||
public int idPuntoInformacion { get; set; } = 0;
|
||||
public double coste { get; set; } = 0;
|
||||
}
|
||||
public class CostesPersonal
|
||||
@@ -809,7 +824,9 @@ namespace bdHerramientaCACOA
|
||||
public double HorasTPEDireccion { get; set; } = 0;
|
||||
|
||||
|
||||
|
||||
public double HorasTPEEstimacion { get; set; } = 0;
|
||||
public double HorasTPEDocumentacionEstimacion { get; set; } = 0;
|
||||
public double HorasTPEDireccionEstimacion { get; set; } = 0;
|
||||
}
|
||||
public class UsosTipologia
|
||||
{
|
||||
@@ -828,6 +845,7 @@ namespace bdHerramientaCACOA
|
||||
public string Nombre { get; set; } = "";
|
||||
public int idCorrecion { get; set; } = 0;
|
||||
public double coeficiente { get; set; } = 0;
|
||||
public int idPuntoInformacion { get; set; } = 0;
|
||||
}
|
||||
public class FasesTrabajo
|
||||
{
|
||||
@@ -904,6 +922,7 @@ namespace bdHerramientaCACOA
|
||||
Descripcion = enu.Descripcion,
|
||||
ValorAlfabetico1 = enu.ValorAlfabetico1,
|
||||
ValorAlfabetico2 = enu.ValorAlfabetico2,
|
||||
idPuntoInformacion = string.IsNullOrEmpty( enu.ValorAlfabetico4) ? null : int.Parse(enu.ValorAlfabetico4),
|
||||
ValorNumerico1 = enu.ValorNumerico1
|
||||
};
|
||||
}
|
||||
@@ -920,7 +939,7 @@ namespace bdHerramientaCACOA
|
||||
public string? ValorAlfabetico1 { get; set; }
|
||||
|
||||
public string? ValorAlfabetico2 { get; set; }
|
||||
|
||||
public int? idPuntoInformacion { get; set; }
|
||||
public double? ValorNumerico1 { get; set; }
|
||||
|
||||
public bool Seleccionado { get; set; } = false!;
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace bdHerramientaCACOA.HerramientaURBAN
|
||||
public partial class URBAN {
|
||||
public class EnumeradosURBAN
|
||||
{
|
||||
public List<puntosinformacion> PuntosInformacion { get; set; } = new List<puntosinformacion>();
|
||||
|
||||
public List<FasesURBAN> FasesTrabajo { get; set; } = new List<FasesURBAN>();
|
||||
public List<enumeracionesCASA> ListaInstrumentos { get; set; } = new List<enumeracionesCASA>();
|
||||
public List<enumeracionesCASA> Periodos { get; set; } = new List<enumeracionesCASA>();
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace bdHerramientaCACOA.HerramientaURBAN
|
||||
{
|
||||
public partial class URBAN
|
||||
{
|
||||
public string NombreSimulacion { get; set; } = "Simulación Urbanismo "+ DateTime.Now;
|
||||
public string NombreSimulacion { get; set; } = "CASA Urbanismo " + DateTime.Now;
|
||||
|
||||
private CASADespachoProfesional _DespachoProfesional = new CASADespachoProfesional();
|
||||
public CASADespachoProfesional DespachoProfesional
|
||||
@@ -75,12 +75,14 @@ namespace bdHerramientaCACOA.HerramientaURBAN
|
||||
ci.Concepto = enu.ValorAlfabetico1;
|
||||
ci.idPeriodicidad = perMensual.idEnumeracion;
|
||||
ci.valorPeriodo = (double)perMensual.ValorNumerico1;
|
||||
|
||||
ci.idPuntoInformacion = string.IsNullOrEmpty(enu.ValorAlfabetico4) ? 0 : int.Parse(enu.ValorAlfabetico4);
|
||||
DespachoProfesional.CostesIndirectos.Add(ci);
|
||||
}
|
||||
}
|
||||
checkListCostIndirectos(listaCosteIndirectos);
|
||||
|
||||
Enumerados.PuntosInformacion = bd.puntosinformacion.Where(x => x.idTipoHerramienta == 34 || x.idTipoHerramienta == 31).ToList();
|
||||
|
||||
//Cargamos las Fases
|
||||
var grupoFases = bd.gruposenumeraciones.FirstOrDefault(x => x.Grupo == "FASURB");
|
||||
var listaFases = bd.enumeraciones.Where(x => x.idGrupoEnumeracion == grupoFases.idGrupoEnumeracion).ToList();
|
||||
|
||||
@@ -88,9 +88,8 @@ namespace bdHerramientaCACOA.HerramientaURBAN
|
||||
double totalEncargo = TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
CostesProduccion.HorasTrabajoProfesional = (TrabajoProfesional.horasTrabProfesional * (totalEncargo / 100)).DosDecimales();
|
||||
}
|
||||
|
||||
/*
|
||||
CostesProduccion.HorasEnPlazo = (DespachoProfesional.HorasTotalesProduccion * CostesProduccion.PlazoPresentacionDocumentos / 12).DosDecimales();
|
||||
|
||||
if (CostesProduccion.HorasEnPlazo >= CostesProduccion.HorasTrabajoProfesional)
|
||||
{
|
||||
CostesProduccion.NumHorasMinimoExt = 0;
|
||||
@@ -98,8 +97,15 @@ namespace bdHerramientaCACOA.HerramientaURBAN
|
||||
else
|
||||
{
|
||||
CostesProduccion.NumHorasMinimoExt = (CostesProduccion.HorasTrabajoProfesional - CostesProduccion.HorasEnPlazo).DosDecimales();
|
||||
}
|
||||
}*/
|
||||
|
||||
CostesProduccion.HorasEnPlazo = (DespachoProfesional.HorasTotalesProduccion * CostesProduccion.PlazoPresentacionDocumentos / 12).DosDecimales();
|
||||
if (CostesProduccion.HorasEnPlazo > TrabajoProfesional.horasTrabProfesional) {
|
||||
CostesProduccion.HorasEnPlazo = TrabajoProfesional.horasTrabProfesional;
|
||||
}
|
||||
CostesProduccion.NumHorasMinimoExt = (CostesProduccion.HorasEnPlazo >= TrabajoProfesional.horasTrabProfesional) ?
|
||||
0 :
|
||||
Math.Round(TrabajoProfesional.horasTrabProfesional - CostesProduccion.HorasEnPlazo, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
//€
|
||||
if (CostesProduccion.NumHorasMinimoExt == 0)
|
||||
|
||||
@@ -21,6 +21,9 @@ namespace bdHerramientaCACOA.HerramientaURBAN
|
||||
public double valorInstrumentos { get; set; } = 0;
|
||||
|
||||
public double horasTrabProfesional { get; set; } = 0;
|
||||
public double horasTrabProfesionalEstimacion { get; set; } = 0;
|
||||
|
||||
public bool EsPorUsos { get; set; } = true;
|
||||
|
||||
public List<DocumentacionURBAN> DocumentacionMinima { get; set; } = new List<DocumentacionURBAN>();
|
||||
|
||||
@@ -54,6 +57,8 @@ namespace bdHerramientaCACOA.HerramientaURBAN
|
||||
double porcentajeInnovacion = TrabajoProfesional.valorInstrumentos;
|
||||
|
||||
TrabajoProfesional.horasTrabProfesional = (valorhoras * (totalEncargo / 100) * (porcentajeInnovacion / 100)).DosDecimales();
|
||||
TrabajoProfesional.horasTrabProfesionalEstimacion = TrabajoProfesional.horasTrabProfesional;
|
||||
CalcularCostesProduccion();
|
||||
}
|
||||
|
||||
public double ObtenerHoraTipoDocumento()
|
||||
|
||||
@@ -22,9 +22,11 @@ namespace bdHerramientaCACOA
|
||||
}
|
||||
public VariablesLICITACIONES Variables { get; set; } = new VariablesLICITACIONES();
|
||||
|
||||
public string Descripcion { get; set; } = "Licitación Edificación "+ DateTime.Now;
|
||||
public string Descripcion { get; set; } = "Licitación Edificación " + DateTime.Now;
|
||||
public class EnumeradosLICITACIONES
|
||||
{
|
||||
public List<puntosinformacion> PuntosInformacion { get; set; } = new List<puntosinformacion>();
|
||||
|
||||
public List<enumeracionesCASA> GruposTipologias { get; set; } = new List<enumeracionesCASA>();
|
||||
public List<enumeracionesCASA> Intervenciones { get; set; } = new List<enumeracionesCASA>();
|
||||
public List<enumeracionesCASA> ListaOtrosTrabajos { get; set; } = new List<enumeracionesCASA>();
|
||||
@@ -52,22 +54,10 @@ namespace bdHerramientaCACOA
|
||||
|
||||
public double IncrementoUrgencia { get; set; } = 0;
|
||||
public double PlazoPresentacionDocumentos { get; set; } = 0;
|
||||
|
||||
public bool EsPorUsos { get; set; } = true;
|
||||
public double CostesProduccionTrabProf { get; set; } = 0;
|
||||
|
||||
double _beneficio = 19;
|
||||
public double Beneficio
|
||||
{
|
||||
get
|
||||
{
|
||||
return _beneficio;
|
||||
}
|
||||
//set
|
||||
//{
|
||||
// _beneficio = value;
|
||||
// CalcularHorasSuperficie();
|
||||
//}
|
||||
}
|
||||
public double Beneficio { get; set; } = 19;
|
||||
|
||||
public double PrecioTrabProf { get; set; } = 0;
|
||||
|
||||
@@ -84,6 +74,8 @@ namespace bdHerramientaCACOA
|
||||
Variables.HorasProduccionMedia = (int)bd.enumeraciones.First(x => x.Codigo == "VARCASA.HORPRODMEDIA").ValorNumerico1;
|
||||
Variables.IPCCosteIndirecto = (double) bd.enumeraciones.First(x => x.Codigo == "VARCASA.IPCCD").ValorNumerico1;
|
||||
|
||||
Beneficio = (double)bd.enumeraciones.First(x => x.Codigo == "VARCASA.GG+BI").ValorNumerico1;
|
||||
|
||||
|
||||
idGradSup = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.TECGRADSUP").idEnumeracion;
|
||||
idGradMed = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.GESTPROY").idEnumeracion;
|
||||
@@ -109,6 +101,10 @@ namespace bdHerramientaCACOA
|
||||
|
||||
checkListCostIndirectos(listaFases);
|
||||
|
||||
|
||||
Enumerados.PuntosInformacion = bd.puntosinformacion.Where(x => x.idTipoHerramienta == 32).ToList();
|
||||
|
||||
|
||||
//Cargamos la lista de otros costes de trabajo
|
||||
var grupoOtrosTrab = bd.gruposenumeraciones.FirstOrDefault(x => x.Grupo == "OTROSTRAB");
|
||||
Enumerados.ListaOtrosTrabajos = ListaEnumeracionCASA(Utilidades.devolverListadoOrdenadoEnumeracion(bd, grupoOtrosTrab.idGrupoEnumeracion).ToList());
|
||||
@@ -195,6 +191,7 @@ namespace bdHerramientaCACOA
|
||||
public double coefIntervencionTotal { get; set; } = 0;
|
||||
public double fasesEncargadas { get; set; } = 0;
|
||||
public double horasProduccion { get; set; } = 0;
|
||||
public double horasProduccionEstimacion { get; set; } = 0;
|
||||
public double horasPorcentaje { get; set; } = 0;
|
||||
public double horasDocumentacion { get; set; } = 0;
|
||||
public double plazoMedio { get; set; } = 0;
|
||||
@@ -207,8 +204,8 @@ namespace bdHerramientaCACOA
|
||||
public double costeHoraProduccion { get; set; } = 0;
|
||||
public void CalcularHorasSuperficie() {
|
||||
// calcular superficie total
|
||||
superficie = Usos.Sum(x => x.superficie);
|
||||
if (superficie > 0) {
|
||||
superficie = Usos.Sum(x => x.superficie);
|
||||
if (superficie > 0 || !EsPorUsos) {
|
||||
// calcular coef superficie total
|
||||
coefsinredondeo = -0.1375 * Math.Log(superficie) + 2.4;
|
||||
coefSupTotal = Math.Round( coefsinredondeo,2, MidpointRounding.AwayFromZero);
|
||||
@@ -231,12 +228,25 @@ namespace bdHerramientaCACOA
|
||||
// calcular fases encargadas
|
||||
fasesEncargadas = FasesTrabajo.Where(x=>x.Seleccionado).Sum(x=> x.Porcentaje);
|
||||
|
||||
// calcular horas produccion trabajo profesional
|
||||
horasProduccion = Math.Round((superficie*coefSupTotal*coefTipoTotal*coefIntervencionTotal*(fasesEncargadas/100)), 2, MidpointRounding.AwayFromZero); ;
|
||||
// calcular horas produccion trabajo profesional
|
||||
if (EsPorUsos)
|
||||
{
|
||||
horasProduccion = Math.Round((superficie * coefSupTotal * coefTipoTotal * coefIntervencionTotal * (fasesEncargadas / 100)), 2, MidpointRounding.AwayFromZero);
|
||||
// calcular horas elaboracion documentacion
|
||||
//horasPorcentaje = FasesTrabajo.Where(x => (x.Codigo.Contains("ESTPREVIO") || x.Codigo.Contains("ANTEPROYECTO") || x.Codigo.Contains("PROYBASICO") || x.Codigo.Contains("PROYEJEC"))).Sum(x => x.Porcentaje);
|
||||
|
||||
// COMPROBAR SI ESTO ESTÁ BIEN, SINO EL COSTE HORA DE PRODUCCIÓN NO CAMBIA
|
||||
horasPorcentaje = FasesTrabajo.Where(x=>x.Seleccionado).Sum(x => x.Porcentaje);
|
||||
horasDocumentacion = Math.Round(superficie * coefSupTotal * coefTipoTotal * coefIntervencionTotal * (horasPorcentaje / 100), 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
horasProduccionEstimacion = horasProduccion;
|
||||
}
|
||||
else {
|
||||
|
||||
// COMPROBAR SI ESTO ESTÁ BIEN, SINO EL COSTE HORA DE PRODUCCIÓN NO CAMBIA Y TAMBIÉN VER SI DEBE CAMBIAR HORAS TRABAJO PROFESIONAL
|
||||
horasDocumentacion = Math.Round(horasProduccion * (fasesEncargadas / 100), 2, MidpointRounding.AwayFromZero); ;
|
||||
}
|
||||
|
||||
// calcular horas elaboracion documentacion
|
||||
horasPorcentaje = FasesTrabajo.Where(x=> x.Codigo.Contains("ESTPREVIO") || x.Codigo.Contains("ANTEPROYECTO") || x.Codigo.Contains("PROYBASICO") || x.Codigo.Contains("PROYEJEC")).Sum(x=>x.Porcentaje) ;
|
||||
horasDocumentacion = Math.Round(superficie * coefSupTotal * coefTipoTotal * coefIntervencionTotal*(horasPorcentaje/100), 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
// calcular plazo medio(meses) esto hay que preguntarlo
|
||||
plazoMedio = 3;
|
||||
@@ -247,7 +257,7 @@ namespace bdHerramientaCACOA
|
||||
|
||||
// calcular coef plazos menores de 6 meses
|
||||
coefPlazos =0;
|
||||
double restaPlazos = plazoElegido -plazoMedio ;
|
||||
double restaPlazos = plazoElegido - PlazoPresentacionDocumentos;
|
||||
if (restaPlazos > 0)
|
||||
{
|
||||
coefPlazos= 1+ restaPlazos*2* 0.01666;
|
||||
@@ -322,7 +332,7 @@ namespace bdHerramientaCACOA
|
||||
CostesProduccionTrabProf = Math.Round(CostesProduccionTrabProf, 2, MidpointRounding.AwayFromZero);
|
||||
PrecioTrabProf = Math.Round(PrecioTrabProf, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
PrecioDelEncargo = PrecioTrabProf;
|
||||
PrecioDelEncargo = PrecioTrabProf + TotalOtrosTrabajos;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace bdHerramientaCACOA
|
||||
public double Beneficio { get; set; } = 19;
|
||||
public double PrecioDelTrabajo { get; set; } = 0;
|
||||
|
||||
public bool EsPorUsos { get; set; } = true;
|
||||
|
||||
private URBANTrabajoProfesional _TrabajoProfesional = new URBANTrabajoProfesional();
|
||||
public URBANTrabajoProfesional TrabajoProfesional
|
||||
{
|
||||
@@ -44,6 +46,8 @@ namespace bdHerramientaCACOA
|
||||
|
||||
public class EnumeradosLicitacionesURBAN
|
||||
{
|
||||
public List<puntosinformacion> PuntosInformacion { get; set; } = new List<puntosinformacion>();
|
||||
|
||||
public List<ConvenioColectivoConcurso> ListaConvenioColectivo { get; set; } = new List<ConvenioColectivoConcurso>();
|
||||
public List<CosteDirectoIndirecto> ListaCDCI { get; set; } = new List<CosteDirectoIndirecto>();
|
||||
|
||||
@@ -78,6 +82,7 @@ namespace bdHerramientaCACOA
|
||||
Variables.JornadaLaboral = (int)bd.enumeraciones.First(x => x.Codigo == "VARCASA.JORLABANUAL").ValorNumerico1;
|
||||
Variables.HorasProduccionMedia = (int) bd.enumeraciones.First(x => x.Codigo == "VARCASA.HORPRODMEDIA").ValorNumerico1;
|
||||
Variables.IPCCosteIndirecto = (double)bd.enumeraciones.First(x => x.Codigo == "VARCASA.IPCCD").ValorNumerico1;
|
||||
Beneficio = (double)bd.enumeraciones.First(x => x.Codigo == "VARCASA.GG+BI").ValorNumerico1;
|
||||
|
||||
idGradSup = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.TECGRADSUP").idEnumeracion;
|
||||
idGradMed = bd.enumeraciones.First(x => x.Codigo == "PUESTOTRABAJO.GESTPROY").idEnumeracion;
|
||||
@@ -143,17 +148,38 @@ namespace bdHerramientaCACOA
|
||||
var listaFases = bd.enumeraciones.Where(x => x.idGrupoEnumeracion == grupoFases.idGrupoEnumeracion).ToList();
|
||||
foreach (enumeraciones enu in listaFases)
|
||||
{
|
||||
FasesURBAN ft = new FasesURBAN();
|
||||
ft.idFase = enu.idEnumeracion;
|
||||
ft.Codigo = enu.Codigo;
|
||||
ft.Denominacion = enu.ValorAlfabetico1;
|
||||
ft.Porcentaje = (double)enu.ValorNumerico1;
|
||||
if (!TrabajoProfesional.FasesTrabajoProfesional.Any(x => x.idFase == enu.idEnumeracion))
|
||||
{
|
||||
FasesURBAN ft = new FasesURBAN();
|
||||
ft.idFase = enu.idEnumeracion;
|
||||
ft.Codigo = enu.Codigo;
|
||||
ft.Denominacion = enu.ValorAlfabetico1;
|
||||
ft.Porcentaje = (double)enu.ValorNumerico1;
|
||||
|
||||
TrabajoProfesional.FasesTrabajoProfesional.Add(ft);
|
||||
TrabajoProfesional.FasesTrabajoProfesional.Add(ft);
|
||||
}
|
||||
}
|
||||
|
||||
checkListFasesURBAN(listaFases);
|
||||
|
||||
Enumerados.PuntosInformacion = bd.puntosinformacion.Where(x => x.idTipoHerramienta == 35).ToList();
|
||||
|
||||
|
||||
Enumerados.FasesTrabajo = JsonSerializer.Deserialize<List<FasesURBAN>>(JsonSerializer.Serialize(TrabajoProfesional.FasesTrabajoProfesional));
|
||||
}
|
||||
|
||||
private void checkListFasesURBAN(List<enumeraciones> listaFases)
|
||||
{
|
||||
var itemsAEliminar = TrabajoProfesional.FasesTrabajoProfesional
|
||||
.Where(item => !listaFases.Any(x => x.idEnumeracion == item.idFase))
|
||||
.ToList();
|
||||
|
||||
foreach (var item in itemsAEliminar)
|
||||
{
|
||||
TrabajoProfesional.FasesTrabajoProfesional.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
public void CalcularLicitacion() {
|
||||
var horasAnualesDes = Math.Round(TrabajoProfesional.horasTrabProfesional * 12 / PlazoPresentacionDocumentos,2,MidpointRounding.AwayFromZero);
|
||||
var CD = ObtenerCDTabla(horasAnualesDes);
|
||||
@@ -162,8 +188,8 @@ namespace bdHerramientaCACOA
|
||||
|
||||
CosteHP = ((CD+CI)*(1+CV)).DosDecimales();
|
||||
CostesProduccionTrabProf = (TrabajoProfesional.horasTrabProfesional*CosteHP).DosDecimales();
|
||||
Beneficio = 0.19;
|
||||
PrecioDelTrabajo = (CostesProduccionTrabProf*(1+Beneficio)).DosDecimales();
|
||||
//Beneficio = 0.19;
|
||||
PrecioDelTrabajo = (CostesProduccionTrabProf*(1+(Beneficio/100))).DosDecimales();
|
||||
}
|
||||
|
||||
private double ObtenerCDTabla(double horas)
|
||||
@@ -220,11 +246,18 @@ namespace bdHerramientaCACOA
|
||||
}
|
||||
public void CalcularHorasTrabajoProfesional()
|
||||
{
|
||||
double valorhoras = ObtenerHoraTipoDocumento();
|
||||
double totalEncargo = TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
double porcentajeInnovacion = TrabajoProfesional.valorInstrumentos;
|
||||
if (EsPorUsos)
|
||||
{
|
||||
double valorhoras = ObtenerHoraTipoDocumento();
|
||||
double totalEncargo = TrabajoProfesional.FasesTrabajoProfesional.Sum(x => x.Porcentaje);
|
||||
double porcentajeInnovacion = TrabajoProfesional.valorInstrumentos;
|
||||
|
||||
TrabajoProfesional.horasTrabProfesional = (valorhoras * (totalEncargo / 100) * (porcentajeInnovacion / 100)).DosDecimales();
|
||||
TrabajoProfesional.horasTrabProfesional = (valorhoras * (totalEncargo / 100) * (porcentajeInnovacion / 100)).DosDecimales();
|
||||
TrabajoProfesional.horasTrabProfesionalEstimacion = TrabajoProfesional.horasTrabProfesional;
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
CalcularLicitacion();
|
||||
}
|
||||
public double ObtenerHoraTipoDocumento()
|
||||
|
||||
65
bdHerramientaCACOA/db/estadisticas.cs
Normal file
65
bdHerramientaCACOA/db/estadisticas.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
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 double? totalFases { get; set; }
|
||||
|
||||
public double? horasTPEDocumentacion { get; set; }
|
||||
|
||||
public double? horasTPEDireccionObra { get; set; }
|
||||
|
||||
public double? horasTPE { get; set; }
|
||||
|
||||
public double? porcentajeExternalizacion { get; set; }
|
||||
|
||||
public double? plazoPresentacion { get; set; }
|
||||
|
||||
public double? costeProduccion { get; set; }
|
||||
|
||||
public double? totalOtrosTrabajos { get; set; }
|
||||
|
||||
public double? porcentajeBeneficio { get; set; }
|
||||
|
||||
public double? numeroTrabajadores { get; set; }
|
||||
|
||||
public double? totalCosteAnual { get; set; }
|
||||
|
||||
public double? horasProduccion { get; set; }
|
||||
|
||||
public double? totalSupeficie { get; set; }
|
||||
|
||||
public double? costeHoraExternalizacion { get; set; }
|
||||
|
||||
public double? precioEncargo { get; set; }
|
||||
|
||||
public double? precioTrabajo { get; set; }
|
||||
|
||||
public string? tipoDocumento { get; set; }
|
||||
|
||||
public string? documento { get; set; }
|
||||
|
||||
public string? dato1 { get; set; }
|
||||
|
||||
public string? dato2 { get; set; }
|
||||
|
||||
public string? dato3 { get; set; }
|
||||
|
||||
public double? innovacion { get; set; }
|
||||
|
||||
public virtual simulaciones? idSimulacionNavigation { get; set; }
|
||||
}
|
||||
19
bdHerramientaCACOA/db/estadisticasfactores.cs
Normal file
19
bdHerramientaCACOA/db/estadisticasfactores.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace bdHerramientaCACOA.db;
|
||||
|
||||
public partial class estadisticasfactores
|
||||
{
|
||||
public int idestadisticasFactores { get; set; }
|
||||
|
||||
public int? idsimulacion { get; set; }
|
||||
|
||||
public string? nombre { get; set; }
|
||||
|
||||
public double? coeficiente { get; set; }
|
||||
|
||||
public string? tipo { get; set; }
|
||||
|
||||
public virtual simulaciones? idsimulacionNavigation { get; set; }
|
||||
}
|
||||
21
bdHerramientaCACOA/db/estadisticasusos.cs
Normal file
21
bdHerramientaCACOA/db/estadisticasusos.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace bdHerramientaCACOA.db;
|
||||
|
||||
public partial class estadisticasusos
|
||||
{
|
||||
public int idestadisticaUsos { get; set; }
|
||||
|
||||
public int? idSimulacion { get; set; }
|
||||
|
||||
public double? superficie { get; set; }
|
||||
|
||||
public int? idUso { get; set; }
|
||||
|
||||
public int? idTipologia { get; set; }
|
||||
|
||||
public int? idIntervencion { get; set; }
|
||||
|
||||
public virtual simulaciones? idSimulacionNavigation { get; set; }
|
||||
}
|
||||
15
bdHerramientaCACOA/db/puntosinformacion.cs
Normal file
15
bdHerramientaCACOA/db/puntosinformacion.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace bdHerramientaCACOA.db;
|
||||
|
||||
public partial class puntosinformacion
|
||||
{
|
||||
public int idPuntosInformacion { get; set; }
|
||||
|
||||
public string? Titulo { get; set; }
|
||||
|
||||
public string? Descripcion { get; set; }
|
||||
|
||||
public int? idTipoHerramienta { get; set; }
|
||||
}
|
||||
@@ -27,6 +27,12 @@ public partial class simulaciones
|
||||
|
||||
public double? CostesVariables { get; set; }
|
||||
|
||||
public virtual ICollection<estadisticas> estadisticas { get; set; } = new List<estadisticas>();
|
||||
|
||||
public virtual ICollection<estadisticasfactores> estadisticasfactores { get; set; } = new List<estadisticasfactores>();
|
||||
|
||||
public virtual ICollection<estadisticasusos> estadisticasusos { get; set; } = new List<estadisticasusos>();
|
||||
|
||||
public virtual usuarios idCodigoNavigation { get; set; } = null!;
|
||||
|
||||
public virtual ficheros idFicheroJSONNavigation { get; set; } = null!;
|
||||
|
||||
@@ -26,6 +26,12 @@ public partial class herramientascacoaContext : DbContext
|
||||
|
||||
public virtual DbSet<enumeraciones> enumeraciones { get; set; }
|
||||
|
||||
public virtual DbSet<estadisticas> estadisticas { get; set; }
|
||||
|
||||
public virtual DbSet<estadisticasfactores> estadisticasfactores { get; set; }
|
||||
|
||||
public virtual DbSet<estadisticasusos> estadisticasusos { get; set; }
|
||||
|
||||
public virtual DbSet<factorescorreccion> factorescorreccion { get; set; }
|
||||
|
||||
public virtual DbSet<ficheros> ficheros { get; set; }
|
||||
@@ -36,6 +42,8 @@ public partial class herramientascacoaContext : DbContext
|
||||
|
||||
public virtual DbSet<provincias> provincias { get; set; }
|
||||
|
||||
public virtual DbSet<puntosinformacion> puntosinformacion { get; set; }
|
||||
|
||||
public virtual DbSet<simulaciones> simulaciones { get; set; }
|
||||
|
||||
public virtual DbSet<tipologias> tipologias { get; set; }
|
||||
@@ -146,7 +154,7 @@ public partial class herramientascacoaContext : DbContext
|
||||
entity.Property(e => e.ValorAlfabetico2).HasMaxLength(40);
|
||||
entity.Property(e => e.ValorAlfabetico3).HasMaxLength(40);
|
||||
entity.Property(e => e.ValorAlfabetico4).HasMaxLength(40);
|
||||
entity.Property(e => e.ValorAlfabeticoLargo).HasMaxLength(255);
|
||||
entity.Property(e => e.ValorAlfabeticoLargo).HasMaxLength(2000);
|
||||
entity.Property(e => e.idGrupoEnumeracion).HasColumnType("int(11)");
|
||||
|
||||
entity.HasOne(d => d.idGrupoEnumeracionNavigation).WithMany(p => p.enumeraciones)
|
||||
@@ -154,6 +162,61 @@ public partial class herramientascacoaContext : DbContext
|
||||
.HasConstraintName("FK_enumeraciones_gruposenumeracion");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<estadisticas>(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.dato1).HasMaxLength(45);
|
||||
entity.Property(e => e.dato2).HasMaxLength(45);
|
||||
entity.Property(e => e.dato3).HasMaxLength(45);
|
||||
entity.Property(e => e.documento).HasMaxLength(50);
|
||||
entity.Property(e => e.idSimulacion).HasColumnType("int(11)");
|
||||
entity.Property(e => e.tipoDocumento).HasMaxLength(50);
|
||||
|
||||
entity.HasOne(d => d.idSimulacionNavigation).WithMany(p => p.estadisticas)
|
||||
.HasForeignKey(d => d.idSimulacion)
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.HasConstraintName("FK_estadisticas_simulaciones");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<estadisticasfactores>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idestadisticasFactores).HasName("PRIMARY");
|
||||
|
||||
entity.HasIndex(e => e.idsimulacion, "FK_estadisticasfactores_simulaciones_idx");
|
||||
|
||||
entity.Property(e => e.idestadisticasFactores).HasColumnType("int(11)");
|
||||
entity.Property(e => e.idsimulacion).HasColumnType("int(11)");
|
||||
entity.Property(e => e.nombre).HasMaxLength(45);
|
||||
entity.Property(e => e.tipo).HasMaxLength(45);
|
||||
|
||||
entity.HasOne(d => d.idsimulacionNavigation).WithMany(p => p.estadisticasfactores)
|
||||
.HasForeignKey(d => d.idsimulacion)
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.HasConstraintName("FK_estadisticasfactores_simulaciones");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<estadisticasusos>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idestadisticaUsos).HasName("PRIMARY");
|
||||
|
||||
entity.HasIndex(e => e.idSimulacion, "FK_estadisticasusos_simulaciones_idx");
|
||||
|
||||
entity.Property(e => e.idestadisticaUsos).HasColumnType("int(11)");
|
||||
entity.Property(e => e.idIntervencion).HasColumnType("int(11)");
|
||||
entity.Property(e => e.idSimulacion).HasColumnType("int(11)");
|
||||
entity.Property(e => e.idTipologia).HasColumnType("int(11)");
|
||||
entity.Property(e => e.idUso).HasColumnType("int(11)");
|
||||
|
||||
entity.HasOne(d => d.idSimulacionNavigation).WithMany(p => p.estadisticasusos)
|
||||
.HasForeignKey(d => d.idSimulacion)
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.HasConstraintName("FK_estadisticasusos_simulaciones");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<factorescorreccion>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idFactorCorreccion).HasName("PRIMARY");
|
||||
@@ -232,6 +295,16 @@ public partial class herramientascacoaContext : DbContext
|
||||
entity.Property(e => e.Nombre).HasMaxLength(80);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<puntosinformacion>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idPuntosInformacion).HasName("PRIMARY");
|
||||
|
||||
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)");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<simulaciones>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idSimulacion).HasName("PRIMARY");
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"ContextNamespace": null,
|
||||
"FilterSchemas": false,
|
||||
"IncludeConnectionString": false,
|
||||
"MinimumProductVersion": "2.6.1080",
|
||||
"ModelNamespace": null,
|
||||
"OutputContextPath": "dbcontext",
|
||||
"OutputPath": "db",
|
||||
@@ -42,6 +43,18 @@
|
||||
"Name": "enumeraciones",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "estadisticas",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "estadisticasfactores",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "estadisticasusos",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "factorescorreccion",
|
||||
"ObjectType": 0
|
||||
@@ -62,6 +75,10 @@
|
||||
"Name": "provincias",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "puntosinformacion",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "simulaciones",
|
||||
"ObjectType": 0
|
||||
|
||||
Reference in New Issue
Block a user