Arreglos paso a Git
This commit is contained in:
@@ -87,6 +87,7 @@
|
||||
<PackageReference Include="MigraDocCore.Rendering" Version="1.3.67" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Serialize.Linq" Version="4.0.167" />
|
||||
<PackageReference Include="tsDocumentos" Version="1.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -94,9 +95,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="tsDocumentos">
|
||||
<HintPath>..\..\..\..\Comun\tsDocumentos\bin\Debug\net8.0\tsDocumentos.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="tsUtilidades">
|
||||
<HintPath>..\..\..\..\Comun\tsUtilidades\bin\Debug\net8.0\tsUtilidades.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
|
||||
<PackageReference Include="Serialize.Linq" Version="3.1.160" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
||||
<PackageReference Include="tsDocumentos" Version="1.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -31,9 +32,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="tsDocumentos">
|
||||
<HintPath>..\..\..\..\Comun\tsDocumentos\bin\Debug\net8.0\tsDocumentos.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="tsUtilidades">
|
||||
<HintPath>..\..\..\..\Comun\tsUtilidades\bin\Debug\net8.0\tsUtilidades.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -28,34 +28,37 @@ namespace SwaggerAntifraude.Controllers
|
||||
/// <param name="FechaEmision">Fecha de emisión del formulario</param>
|
||||
/// <param name="Extra">Campo extra opcional, según el tipo de formulario</param>
|
||||
/// <returns>Archivo PDF resultante</returns>
|
||||
[HttpGet("GenerarFormulario")]
|
||||
[Authorize(Policy = "LecturaPolicy")]
|
||||
public IActionResult GenerarFormulario(
|
||||
[FromQuery] string claveFormulario,
|
||||
[FromQuery] string idPersona,
|
||||
[FromQuery] string Motivo,
|
||||
[FromQuery] string texto1,
|
||||
[FromQuery] string texto2,
|
||||
[FromQuery] string FechaEfecto,
|
||||
[FromQuery] string Organo,
|
||||
[FromQuery] string FechaEmision,
|
||||
[FromQuery] string Extra)
|
||||
{
|
||||
var pdfBytes = _servicioFormularios.GenerarFormulario(
|
||||
claveFormulario,
|
||||
idPersona,
|
||||
Motivo,
|
||||
texto1,
|
||||
texto2,
|
||||
FechaEfecto,
|
||||
Organo,
|
||||
FechaEmision,
|
||||
Extra);
|
||||
///
|
||||
|
||||
if (pdfBytes == null || pdfBytes.Length == 0)
|
||||
return NotFound("No se pudo generar el formulario.");
|
||||
|
||||
return File(pdfBytes, "application/pdf", "formulario.pdf");
|
||||
}
|
||||
//[HttpGet("GenerarFormulario")]
|
||||
//[Authorize(Policy = "LecturaPolicy")]
|
||||
//public IActionResult GenerarFormulario(
|
||||
// [FromQuery] string claveFormulario,
|
||||
// [FromQuery] string idPersona,
|
||||
// [FromQuery] string Motivo,
|
||||
// [FromQuery] string texto1,
|
||||
// [FromQuery] string texto2,
|
||||
// [FromQuery] string FechaEfecto,
|
||||
// [FromQuery] string Organo,
|
||||
// [FromQuery] string FechaEmision,
|
||||
// [FromQuery] string Extra)
|
||||
//{
|
||||
// var pdfBytes = _servicioFormularios.GenerarFormulario(
|
||||
// claveFormulario,
|
||||
// idPersona,
|
||||
// Motivo,
|
||||
// texto1,
|
||||
// texto2,
|
||||
// FechaEfecto,
|
||||
// Organo,
|
||||
// FechaEmision,
|
||||
// Extra);
|
||||
|
||||
// if (pdfBytes == null || pdfBytes.Length == 0)
|
||||
// return NotFound("No se pudo generar el formulario.");
|
||||
|
||||
// return File(pdfBytes, "application/pdf", "formulario.pdf");
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
39
Antifraude.Net/SwaggerAntifraude/Servicios/tsXtraReport.cs
Normal file
39
Antifraude.Net/SwaggerAntifraude/Servicios/tsXtraReport.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using DevExpress.Data.Extensions;
|
||||
using DevExpress.DataProcessing.InMemoryDataProcessor;
|
||||
using System.Linq;
|
||||
using DevExpress.XtraReports.Parameters;
|
||||
namespace SwaggerAntifraude.Servicios
|
||||
{
|
||||
public class tsXtraReport
|
||||
{
|
||||
public static void ExportarAPDF(byte[] Plantilla, object Datos, string FicheroPDF)
|
||||
{
|
||||
DevExpress.XtraReports.UI.XtraReport xr;
|
||||
string s = System.Text.Encoding.UTF8.GetString(Plantilla);
|
||||
using (StreamWriter sw = new StreamWriter(new MemoryStream()))
|
||||
{
|
||||
sw.Write(s);
|
||||
sw.Flush();
|
||||
|
||||
xr = DevExpress.XtraReports.UI.XtraReport.FromStream(sw.BaseStream, true);
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
var pr = xr.Parameters.Cast<DevExpress.XtraReports.Parameters.Parameter>()
|
||||
.FirstOrDefault(p => p.Name == "Fecha");
|
||||
|
||||
|
||||
pr.Value = DateTime.Now;
|
||||
pr.Visible = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
xr.DataSource = Datos;
|
||||
xr.CreateDocument();
|
||||
xr.ExportToPdf(FicheroPDF);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,10 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DevExpress.Document.Processor.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Printing.Core.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Reporting.Core" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Reporting.Core.es" Version="23.2.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
|
||||
<PackageReference Include="Serialize.Linq" Version="3.1.160" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
@@ -21,6 +25,8 @@
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.3.1" />
|
||||
<PackageReference Include="System.Linq" Version="4.3.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.6" />
|
||||
<PackageReference Include="System.Linq.Expressions" Version="4.3.0" />
|
||||
<PackageReference Include="System.Linq.Queryable" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -31,9 +37,6 @@
|
||||
<Reference Include="tsUtilidades">
|
||||
<HintPath>..\..\..\..\Comun\tsUtilidades\bin\Debug\net8.0\tsUtilidades.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="tsWPFCore">
|
||||
<HintPath>..\..\..\..\Comun\tsWPFCore\bin\Debug\net8.0-windows\tsWPFCore.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="tsEFCore7" Version="1.0.2" />
|
||||
<PackageReference Include="tsl5" Version="1.0.0" />
|
||||
<PackageReference Include="tsUtilidades" Version="1.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -30,9 +31,6 @@
|
||||
<Reference Include="tsEFCore7">
|
||||
<HintPath>..\..\..\..\Comun\tsEFCore7\bin\Debug\net8.0\tsEFCore7.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="tsl5">
|
||||
<HintPath>..\..\..\..\Comun\tsl5\bin\Debug\tsl5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="tsUtilidades">
|
||||
<HintPath>..\..\..\..\Comun\tsUtilidades\bin\Debug\net8.0\tsUtilidades.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
Reference in New Issue
Block a user