создание пдфки не работает

This commit is contained in:
Николай 2023-05-18 19:21:42 +04:00
parent d43bff822f
commit 66292d362b
4 changed files with 5 additions and 27 deletions

View File

@ -152,7 +152,7 @@ namespace HardwareShopContracts.BusinessLogicsContracts
/// <param name="model"></param> /// <param name="model"></param>
public void SendByMailPurchaseReport(ReportBindingModel model) public void SendByMailPurchaseReport(ReportBindingModel model)
{ {
byte[] file = _saveToPdf.GetEquipmentReportFile(new() byte[] file = _saveToPdf.GetPurchaseReportFile(new()
{ {
FileName = model.FileName, FileName = model.FileName,
Title = "Отчет по покупкам", Title = "Отчет по покупкам",

View File

@ -7,7 +7,7 @@ namespace HardwareShopBusinessLogic.OfficePackage
{ {
public abstract class AbstractSaveToPdf public abstract class AbstractSaveToPdf
{ {
public byte[] GetEquipmentReportFile(PdfInfo info) public byte[] GetPurchaseReportFile(PdfInfo info)
{ {
CreatePdf(info); CreatePdf(info);
@ -26,11 +26,11 @@ namespace HardwareShopBusinessLogic.OfficePackage
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
CreateTable(new List<string> { "5cm", "5cm", "5cm" }); CreateTable(new List<string> { "5cm", "5cm", "5cm", "5cm", "5cm" });
CreateRow(new PdfRowParameters CreateRow(new PdfRowParameters
{ {
Texts = new List<string> { "Комплектация", "Автомобили", "Работы" }, Texts = new List<string> { "Покупка", "Дата покупки", "Цена", "Комментарии", "Комплектующие" },
Style = "NormalTitle", Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });

View File

@ -1,23 +0,0 @@
using HardwareShopContracts.BindingModels;
using HardwareShopContracts.BusinessLogicsContracts;
using HardwareShopContracts.SearchModels;
using HardwareShopContracts.ViewModels;
using Microsoft.AspNetCore.Mvc;
namespace HardwareShopRestApi.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class WorkerReport : Controller
{
private readonly ILogger _logger;
private readonly IWorkerReportLogic _workerReportLogic;
public WorkerReport(IWorkerReportLogic workerReportLogic, ILogger<UserController> logger)
{
_logger = logger;
_workerReportLogic = workerReportLogic;
}
}
}

View File

@ -562,6 +562,7 @@ namespace HardwareShopWorkerApp.Controllers
return; return;
} }
reportModel.UserId = APIClient.User.Id; reportModel.UserId = APIClient.User.Id;
reportModel.UserEmail = APIClient.User.Email;
APIClient.PostRequest("api/report/SendByMailPurchaseReport", reportModel); APIClient.PostRequest("api/report/SendByMailPurchaseReport", reportModel);
} }
} }