Compare commits
28 Commits
46257d0de4
...
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 |
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,8 +18,8 @@
|
||||
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="_content/Blazor.Bootstrap/blazor.bootstrap.js"></script>
|
||||
<script src="_framework/blazor.web.js"></script>
|
||||
<script src="Scripts/Util.js"></script>
|
||||
<script src="_framework/blazor.web.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -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>
|
||||
@@ -105,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)
|
||||
{
|
||||
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,6 +3,9 @@
|
||||
@using HerramientaCASA.Model
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@inject UserState UserState
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject NavigationManager Navigation
|
||||
@inject IJSRuntime JS
|
||||
|
||||
|
||||
<head>
|
||||
@@ -10,7 +13,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.5" 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>
|
||||
@@ -28,7 +31,7 @@
|
||||
</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.50" 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,19 +51,19 @@
|
||||
@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">
|
||||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<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">
|
||||
@@ -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,68 @@
|
||||
</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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
// Redirigir al home si no hay token y la ruta no es pública
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -121,4 +173,22 @@
|
||||
? "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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,8 +3,9 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mt-3" style="width:47%;">
|
||||
<div style="height: 24px;margin-bottom: 10px;">
|
||||
<!--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="tablaAlter" style="width:100%">
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<TrabajadorGrid objetoCASA="objetoCASA"></TrabajadorGrid>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="row mt-auto">
|
||||
<div class="row mt-auto" style="padding-top: 40px;">
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<table class="tablaAlter">
|
||||
<tr>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
|
||||
<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">
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<HerramientaCASA.Components.Pages.HerramientaURBANTabs.DespachoProfURBAN.TrabajadorGridURBAN objetoURBAN="objetoURBAN"></HerramientaCASA.Components.Pages.HerramientaURBANTabs.DespachoProfURBAN.TrabajadorGridURBAN>
|
||||
</CascadingValue>
|
||||
</div>
|
||||
<div class="row mt-auto">
|
||||
<div class="row mt-auto" style="padding-top: 40px;">
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<table class="tablaAlter">
|
||||
<tr>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
@if (modificarTabla)
|
||||
{
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-md-12 mt-3 mb-3">
|
||||
<div class="col-md-12 mt-4 mb-3">
|
||||
<CascadingValue Value="this">
|
||||
<DocumentosURBAN objetoURBAN="objetoURBAN"></DocumentosURBAN>
|
||||
</CascadingValue>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-4">
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 46).Descripcion))
|
||||
{
|
||||
@@ -52,7 +52,7 @@
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 63).Descripcion))
|
||||
{
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoURBAN.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 47).Descripcion))
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
@UtilidadesCASA.CreateTooltip(objetoURBAN.Enumerados.PuntosInformacion.First(x => x.idPuntosInformacion == 49).Descripcion)
|
||||
}
|
||||
<b>Innovacion de los instrumentos</b></div>
|
||||
<p class="col-6">
|
||||
<p class="mt-2">
|
||||
@* @if (!nuevaRedaccion)
|
||||
{ *@
|
||||
<InputNumber TValue="double" Value="@objetoURBAN.TrabajoProfesional.valorInstrumentos"
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
@msTextoEncabezado
|
||||
</p>
|
||||
|
||||
<div class="d-flex flex-column mt-3">
|
||||
<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>
|
||||
@@ -148,7 +149,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-10 mx-auto d-flex justify-content-center" style="align-items: flex-end; margin-top:150px;">
|
||||
<div class="col-10 mx-auto d-flex justify-content-center" style="@estiloTrabajos">
|
||||
<div class="col-md-10 row ">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Trabajo profesional</b>
|
||||
@@ -207,15 +208,20 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
<div class="col-12 mx-auto" >
|
||||
@* TABLA COSTES ASOCIADOS A LOS SEVICIOS DE ARQUITECTURA *@
|
||||
|
||||
<div class="col-8 mx-auto mb-4">
|
||||
<div class="col-8 mx-auto" style=" margin-top:70px;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Costes Asociados a los Servicios de Arquitectura</b>
|
||||
</div>
|
||||
|
||||
<table class="tablaAlter" style="width:100%">
|
||||
<div class="TituloTablaImprimir" style=" margin-top:70px;">
|
||||
<p>
|
||||
<b>Costes Asociados a los Servicios de Arquitectura</b>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<table class="tablaAlter" style="width:100%;">
|
||||
<tbody style="font-size:9pt;">
|
||||
<tr>
|
||||
<td class="TotalesTabla" > COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL: </td>
|
||||
@@ -323,6 +329,7 @@
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
public string estiloTrabajos = "";
|
||||
|
||||
|
||||
MarkupString msTextoEncabezado => (MarkupString)textoEncabezado;
|
||||
@@ -338,6 +345,7 @@
|
||||
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;
|
||||
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
|
||||
<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>
|
||||
@@ -59,6 +61,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* COSTE HORA EXTERNALIZACION *@
|
||||
<div class="col-8 mx-auto" style="margin-top:50px;">
|
||||
|
||||
<div class="TituloTablaImprimir" >
|
||||
@@ -97,8 +100,10 @@
|
||||
|
||||
@* TRABAJAO PROFESIONAL *@
|
||||
<div class="@separacionTabla">
|
||||
<div class="col-12 d-flex justify-content-center" style="gap:20px;">
|
||||
<div class="formatoCampos pt-2" style="font-size:9pt;">
|
||||
<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)
|
||||
{
|
||||
@@ -119,10 +124,47 @@
|
||||
{
|
||||
<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:200px;">
|
||||
<div class="col-11 mx-auto" style="margin-top:50px;">
|
||||
@* TABLA DE DATOS MINIMOS *@
|
||||
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
@@ -158,7 +200,10 @@
|
||||
|
||||
@* TABLA DE DATOS OPCIONALES *@
|
||||
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
<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">
|
||||
@@ -299,7 +344,10 @@
|
||||
@* INNOVACIÓN INSTRUMENTOS*@
|
||||
<div class="col-11 mx-auto mb-5">
|
||||
<div>
|
||||
<div class="mt-3 mb-3 TituloTablaImprimir"><b>Innovacion de los instrumentos</b></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>
|
||||
@@ -324,7 +372,7 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<div style="font-size:9pt;" class="fw-bold">
|
||||
<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>
|
||||
@@ -336,7 +384,7 @@
|
||||
<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 ">
|
||||
<div class="col-9 mb-5 mb-0" style="width:100%;">
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Trabajo profesional</b>
|
||||
</div>
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
|
||||
<div id="LicitacionesCASAImprimir" class="d-flex flex-column align-items-center pagePrincipal">
|
||||
<div class="col-12 mx-auto mb-5">
|
||||
<div class="col-12 mx-auto">
|
||||
@* ENCABEZADO DE LA PAGINA *@
|
||||
<div class="EncabezadoImprimir">
|
||||
@* 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>
|
||||
|
||||
@* TABLA USOS TIPOLOGIAS *@
|
||||
<div class="col-11 mx-auto mb-5" style="align-items: flex-end;">
|
||||
<div class="col-11 mx-auto mb-4" style="align-items: flex-end;">
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Usos/Tipologías</b>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive espacioTablas">
|
||||
|
||||
<table class="TablaImprimir mb-0 espacioTablas" style="width:100%;">
|
||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="15%">Superficie (m²)</th>
|
||||
@@ -53,7 +55,7 @@
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4" class="text-start fw-bold colorC TotalesTabla">
|
||||
<div style="height:28px; align-content:center;">
|
||||
<div style="height:20px; align-content:center;">
|
||||
Total superficie: <span> @objetoLicitaciones.Usos.Sum(x => x.superficie).MilesYDecimales() m²</span>
|
||||
</div>
|
||||
</td>
|
||||
@@ -84,8 +86,8 @@
|
||||
{
|
||||
<tr>
|
||||
<td>@fase.Denominacion</td>
|
||||
<td class="text-end">
|
||||
<div>
|
||||
<td >
|
||||
<div class="centrarChecksImprimir text-end">
|
||||
<span style="margin-right:5px;">@fase.Porcentaje</span>
|
||||
@if (fase.Seleccionado)
|
||||
{
|
||||
@@ -138,7 +140,7 @@
|
||||
|
||||
</div>
|
||||
@* TABLA COSTES DE PRODUCCION *@
|
||||
<div class="col-8 mx-auto" style="align-items: flex-end; margin-top:800px;">
|
||||
<div class="col-8 mx-auto" style="align-items: flex-end; margin-top:35px;">
|
||||
<div class="TituloTablaImprimir" >
|
||||
<b>Costes de producción</b>
|
||||
</div>
|
||||
@@ -196,7 +198,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="FooterImprimir">
|
||||
@* 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>
|
||||
|
||||
@@ -11,12 +11,16 @@
|
||||
|
||||
<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-12 d-flex justify-content-center" style="gap:20px;">
|
||||
<div class="formatoCampos pt-2" style="font-size:9pt;">
|
||||
<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)
|
||||
{
|
||||
@@ -37,6 +41,43 @@
|
||||
{
|
||||
<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 *@
|
||||
@@ -75,7 +116,10 @@
|
||||
|
||||
@* TABLA DE DATOS OPCIONALES *@
|
||||
|
||||
<div class="TituloTablaImprimir" style=" margin-top:50px;">
|
||||
<div class="TituloTablaImprimir" style="margin-top:10px;">
|
||||
</div>
|
||||
|
||||
<div class="TituloTablaImprimir">
|
||||
<b>Documentación Opcional:</b>
|
||||
</div>
|
||||
<div class="table-responsive espacioTablas">
|
||||
@@ -155,8 +199,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* FASES *@
|
||||
<div class="col-8 mx-auto" style="margin-top:250px;">
|
||||
<div class="col-8 mx-auto" style="margin-top:150px;">
|
||||
|
||||
<div class="TituloTablaImprimir" style=" margin-top:50px;">
|
||||
<b>Fases:</b>
|
||||
@@ -205,7 +250,7 @@
|
||||
</div>
|
||||
|
||||
@* INNOVACIÓN INSTRUMENTOS*@
|
||||
<div class="col-11 mx-auto ">
|
||||
<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">
|
||||
@@ -241,7 +286,10 @@
|
||||
|
||||
<div class="col-8 mx-auto mt-4">
|
||||
@* Solvencia tecnica *@
|
||||
<div class="TituloTablaImprimir">
|
||||
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
</div>
|
||||
<div class="TituloTablaImprimir" style="margin-top:50px;">
|
||||
<b>Solvencia técnica:</b>
|
||||
</div>
|
||||
|
||||
@@ -374,6 +422,7 @@
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
string espacioTabla = "margin-bottom:400px;";
|
||||
string espacioDocumentos = "";
|
||||
|
||||
|
||||
MarkupString msTextoEncabezado => (MarkupString)textoEncabezado;
|
||||
@@ -394,6 +443,15 @@
|
||||
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;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-4">
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 55).Descripcion))
|
||||
{
|
||||
@@ -51,7 +51,7 @@
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 56).Descripcion))
|
||||
{
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
</Grid>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-md-4">
|
||||
<label class="tituloLbl">
|
||||
@if (!string.IsNullOrEmpty(objetoLicitacionUrban.Enumerados.PuntosInformacion.FirstOrDefault(x => x.idPuntosInformacion == 57).Descripcion))
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
<b>Innovacion de los instrumentos</b>
|
||||
</div>
|
||||
<p class="col-6">
|
||||
<p>
|
||||
@* @if (!nuevaRedaccion)
|
||||
{ *@
|
||||
<InputNumber TValue="double" Value="@objetoLicitacionUrban.TrabajoProfesional.valorInstrumentos"
|
||||
|
||||
File diff suppressed because one or more lines are too long
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,32 +7,34 @@
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject NavigationManager Navigation
|
||||
@inject UserState UserState
|
||||
@inject IJSRuntime JS
|
||||
|
||||
|
||||
<div class="fondo">
|
||||
<div class="back">
|
||||
<div class="div-center">
|
||||
<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" >
|
||||
<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" />
|
||||
<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" />
|
||||
<PasswordInput Class="form-control" @bind-Value="@login.password" Id="pass" />
|
||||
</div>
|
||||
<ValidationMessage For="() => login.password" />
|
||||
</div>
|
||||
<div class="form-check" style="gap:10px;">
|
||||
<input type="checkbox" class="form-check-input" id="Recuerdame" />
|
||||
<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">
|
||||
@@ -48,27 +50,45 @@
|
||||
</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.")
|
||||
@@ -77,6 +97,9 @@
|
||||
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);
|
||||
}
|
||||
|
||||
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,10 +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="ClosedXML" Version="0.105.0" />
|
||||
<PackageReference Include="PuppeteerSharp" Version="20.2.2" />
|
||||
<PackageReference Include="DinkToPdf" Version="1.0.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -28,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>";
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -798,7 +830,7 @@ div.content {
|
||||
.TablaImprimir table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 9pt;
|
||||
font-size: 984pt;
|
||||
}
|
||||
|
||||
.TablaImprimir thead tr th {
|
||||
@@ -863,3 +895,9 @@ div.content {
|
||||
.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
@@ -25,3 +25,20 @@ window.descargarExcel = function (fileName, 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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user