comentados botones imprimir y descomentado comprobar que solo funcione de la url de cacoa
This commit is contained in:
@@ -39,22 +39,22 @@
|
|||||||
|
|
||||||
@code{
|
@code{
|
||||||
|
|
||||||
// protected override void OnAfterRender(bool firstRender)
|
protected override void OnAfterRender(bool firstRender)
|
||||||
// {
|
{
|
||||||
// if (firstRender)
|
if (firstRender)
|
||||||
// {
|
{
|
||||||
// string? urlAnterior = HttpContextAccessor.HttpContext?.Request.Headers["Referer"].ToString();
|
string? urlAnterior = HttpContextAccessor.HttpContext?.Request.Headers["Referer"].ToString();
|
||||||
// string rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri);
|
string rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri);
|
||||||
|
|
||||||
// if (rutaActual != "Denegado")
|
if (rutaActual != "Denegado")
|
||||||
// {
|
{
|
||||||
// if (string.IsNullOrEmpty(urlAnterior) || urlAnterior.Contains("cacoa.es"))
|
if (string.IsNullOrEmpty(urlAnterior) || urlAnterior.Contains("cacoa.es"))
|
||||||
// {
|
{
|
||||||
// Navigation.NavigateTo("/Denegado", true);
|
Navigation.NavigateTo("/Denegado", true);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<InputText @bind-Value="casa.NombreSimulacion" class="form-control inputForm formatoMoneda inputTabla " style="text-align:left;font-weight:bold;"></InputText>
|
<InputText @bind-Value="casa.NombreSimulacion" class="form-control inputForm formatoMoneda inputTabla " style="text-align:left;font-weight:bold;"></InputText>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex ml-auto impriManual">
|
<div class="d-flex ml-auto impriManual">
|
||||||
<button @onclick="imprimir" 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 @onclick="imprimir" 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 @onclick="VerManual" class="btnBlue d-flex align-items-center ms-1" style="background-color: #65b7c3 !important;"> <i class="fas fa-book pe-2"></i>Manual</button>
|
<button @onclick="VerManual" 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>
|
||||||
</div>
|
</div>
|
||||||
@@ -377,23 +377,27 @@
|
|||||||
public async Task imprimir()
|
public async Task imprimir()
|
||||||
{
|
{
|
||||||
|
|
||||||
// var cssPath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css");
|
var cssPath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css");
|
||||||
// var cssContent = await File.ReadAllTextAsync(cssPath);
|
var cssContent = await File.ReadAllTextAsync(cssPath);
|
||||||
|
|
||||||
var contenidoHtml = await JSA.InvokeAsync<string>("obtenerPDFImprimir", "DespachoImprimir");
|
var contenidoHtml = await JSA.InvokeAsync<string>("obtenerPDFImprimir", "DespachoImprimir");
|
||||||
var fullHtml = $@"
|
var fullHtml = $@"
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='UTF-8'>
|
||||||
|
<style>{cssContent}</style>
|
||||||
|
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN' crossorigin='anonymous'>
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{contenidoHtml}
|
{contenidoHtml}
|
||||||
</body>
|
</body>
|
||||||
</html>";
|
</html>";
|
||||||
|
|
||||||
// var arrayPDF = PdfService.HtmlToPdfWithSiteCss(fullHtml, Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css"));
|
|
||||||
|
|
||||||
var arrayPDF = PdfService.GenerarPdf(fullHtml);
|
var arrayPDF = PdfService.GenerarPdf(fullHtml);
|
||||||
|
|
||||||
string base64Pdf = Convert.ToBase64String(arrayPDF);
|
string base64Pdf = Convert.ToBase64String(arrayPDF);
|
||||||
|
|
||||||
await JSA.InvokeVoidAsync("descargarPdf", "prueba", base64Pdf);
|
await JSA.InvokeVoidAsync("descargarPdf", "SimulacionHerramientaCASA_"+ DateTime.Now , base64Pdf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
||||||
@inject ProtectedLocalStorage ProtectedLocalStore
|
@inject ProtectedLocalStorage ProtectedLocalStore
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
|
@inject ServicioPDF PdfService
|
||||||
|
|
||||||
|
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@@ -350,4 +352,30 @@
|
|||||||
// await JS.InvokeVoidAsync("mostrarPdf", Convert.ToBase64String(pdfBytes));
|
// await JS.InvokeVoidAsync("mostrarPdf", Convert.ToBase64String(pdfBytes));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
public async Task imprimir()
|
||||||
|
{
|
||||||
|
|
||||||
|
var cssPath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css");
|
||||||
|
var cssContent = await File.ReadAllTextAsync(cssPath);
|
||||||
|
|
||||||
|
var contenidoHtml = await JS.InvokeAsync<string>("obtenerPDFImprimir", "DespachoURBANImprimir");
|
||||||
|
var fullHtml = $@"
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='UTF-8'>
|
||||||
|
<style>{cssContent}</style>
|
||||||
|
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN' crossorigin='anonymous'>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{contenidoHtml}
|
||||||
|
</body>
|
||||||
|
</html>";
|
||||||
|
|
||||||
|
|
||||||
|
var arrayPDF = PdfService.GenerarPdf(fullHtml);
|
||||||
|
|
||||||
|
string base64Pdf = Convert.ToBase64String(arrayPDF);
|
||||||
|
|
||||||
|
await JS.InvokeVoidAsync("descargarPdf", "SimulacionHerramientaUrbanismo_" + DateTime.Now, base64Pdf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
@msTextoEncabezado
|
@msTextoEncabezado
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<label>Simulación: <span class="NombreSimulacionImprimir">@objetoCASA.NombreSimulacion</span></label>
|
<label>Simulación: <span class="NombreSimulacionImprimir">@objetoCASA.NombreSimulacion</span></label>
|
||||||
<br />
|
<br />
|
||||||
<label>Fecha de creación: <span class="NombreSimulacionImprimir">@DateTime.Now</span></label>
|
<label>Fecha de creación: <span class="NombreSimulacionImprimir">@DateTime.Now</span></label>
|
||||||
@@ -14,35 +14,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* TABLA COSTE HORA DESPACHO PROFESIONAL *@
|
@* TABLA COSTE HORA DESPACHO PROFESIONAL *@
|
||||||
<table>
|
|
||||||
<tr style="border-color: red !important;
|
|
||||||
border-width: 1px !important;
|
|
||||||
BORDER-STYLE: SOLID !important;
|
|
||||||
background-color:blue !important;
|
|
||||||
color:white !important;
|
|
||||||
">
|
|
||||||
<td>
|
|
||||||
hola
|
|
||||||
</td>
|
|
||||||
<td>adios</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div class="col-8 mx-auto" style="align-items: flex-end; margin-bottom:30px;">
|
<div class="col-8 mx-auto" style="align-items: flex-end; margin-bottom:30px;">
|
||||||
<div class="TituloTablaImprimir">
|
<div class="TituloTablaImprimir">
|
||||||
<b>Coste hora de los trabajos realizados por el despacho profesional</b>
|
<b>Coste hora de los trabajos realizados por el despacho profesional</b>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-responsive espacioTablas">
|
<div class="table-responsive espacioTablas">
|
||||||
|
|
||||||
<table class="TablaImprimir mb-0" style="width:100%;">
|
<table class="TablaImprimir mb-0" style="width:100%;">
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr style="border-color: red;
|
<tr>
|
||||||
border-width: 1px;
|
|
||||||
BORDER-STYLE: SOLID;
|
|
||||||
background-color:blue;
|
|
||||||
color:white;
|
|
||||||
">
|
|
||||||
<th>Tipo de costes</th>
|
<th>Tipo de costes</th>
|
||||||
<th>Coste/hora</th>
|
<th>Coste/hora</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
||||||
@inject ProtectedLocalStorage ProtectedLocalStore
|
@inject ProtectedLocalStorage ProtectedLocalStore
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
|
@inject ServicioPDF PdfService
|
||||||
|
|
||||||
|
|
||||||
@page "/LicitacionCASA"
|
@page "/LicitacionCASA"
|
||||||
@page "/LicitacionCASA/{idSimulador}"
|
@page "/LicitacionCASA/{idSimulador}"
|
||||||
@@ -516,4 +518,32 @@
|
|||||||
string urlManual = bd.enumeraciones.FirstOrDefault(x => x.Codigo.Contains("MANUAL.LICITACIONCASA")).ValorAlfabeticoLargo;
|
string urlManual = bd.enumeraciones.FirstOrDefault(x => x.Codigo.Contains("MANUAL.LICITACIONCASA")).ValorAlfabeticoLargo;
|
||||||
await JS.InvokeVoidAsync("abrirManual", urlManual);
|
await JS.InvokeVoidAsync("abrirManual", urlManual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task imprimir()
|
||||||
|
{
|
||||||
|
|
||||||
|
var cssPath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css");
|
||||||
|
var cssContent = await File.ReadAllTextAsync(cssPath);
|
||||||
|
|
||||||
|
var contenidoHtml = await JS.InvokeAsync<string>("obtenerPDFImprimir", "LicitacionesCASAImprimir");
|
||||||
|
var fullHtml = $@"
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='UTF-8'>
|
||||||
|
<style>{cssContent}</style>
|
||||||
|
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN' crossorigin='anonymous'>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{contenidoHtml}
|
||||||
|
</body>
|
||||||
|
</html>";
|
||||||
|
|
||||||
|
|
||||||
|
var arrayPDF = PdfService.GenerarPdf(fullHtml);
|
||||||
|
|
||||||
|
string base64Pdf = Convert.ToBase64String(arrayPDF);
|
||||||
|
|
||||||
|
await JS.InvokeVoidAsync("descargarPdf", "SimulacionLicitacionCASA_" + DateTime.Now, base64Pdf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
@using bdHerramientaCACOA.db
|
@using bdHerramientaCACOA.db
|
||||||
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
|
@inject ServicioPDF PdfService
|
||||||
|
|
||||||
@inject ProtectedLocalStorage ProtectedLocalStore
|
@inject ProtectedLocalStorage ProtectedLocalStore
|
||||||
|
|
||||||
@@ -588,4 +589,32 @@
|
|||||||
|
|
||||||
objetoLicitacionUrban.EsPorUsos = guardarSeleccion;
|
objetoLicitacionUrban.EsPorUsos = guardarSeleccion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task imprimir()
|
||||||
|
{
|
||||||
|
|
||||||
|
var cssPath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css");
|
||||||
|
var cssContent = await File.ReadAllTextAsync(cssPath);
|
||||||
|
|
||||||
|
var contenidoHtml = await JS.InvokeAsync<string>("obtenerPDFImprimir", "LiciURBANImprimir");
|
||||||
|
var fullHtml = $@"
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='UTF-8'>
|
||||||
|
<style>{cssContent}</style>
|
||||||
|
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN' crossorigin='anonymous'>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{contenidoHtml}
|
||||||
|
</body>
|
||||||
|
</html>";
|
||||||
|
|
||||||
|
|
||||||
|
var arrayPDF = PdfService.GenerarPdf(fullHtml);
|
||||||
|
|
||||||
|
string base64Pdf = Convert.ToBase64String(arrayPDF);
|
||||||
|
|
||||||
|
await JS.InvokeVoidAsync("descargarPdf", "SimulacionLicitacionUrbanismo_" + DateTime.Now, base64Pdf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ namespace HerramientaCASA
|
|||||||
},
|
},
|
||||||
Objects = {
|
Objects = {
|
||||||
new ObjectSettings() {
|
new ObjectSettings() {
|
||||||
HtmlContent = html,
|
HtmlContent = html
|
||||||
WebSettings = { DefaultEncoding = "utf-8", UserStyleSheet = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css") }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user