Ураааа, остались небольшие правки

This commit is contained in:
Алексей Тихоненков 2024-08-27 19:01:28 +04:00
parent e54749d6d7
commit 29e33b79fe
4 changed files with 4 additions and 5 deletions

View File

@ -17,7 +17,7 @@ namespace DiningRoomBusinessLogic.MailWorker
protected int _smtpClientPort;
protected string _popHost = string.Empty;
protected int _popPort;
private readonly ILogger _logger;
public AbstractMailWorker()
{
@ -52,8 +52,6 @@ namespace DiningRoomBusinessLogic.MailWorker
return;
}
_logger.LogDebug("Send Mail: {To}, {Subject}", info.MailAddress, info.Subject);
await SendMailAsync(info);
}

View File

@ -29,7 +29,7 @@ namespace DiningRoomBusinessLogic.MailWorker
objMailMessage.Body = info.Text;
objMailMessage.SubjectEncoding = Encoding.UTF8;
objMailMessage.BodyEncoding = Encoding.UTF8;
Attachment attachment = new Attachment("C:\\Users\\sshan\\OneDrive\\Desktop\\reports\\reportpdf.pdf", new ContentType(MediaTypeNames.Application.Pdf));
Attachment attachment = new Attachment("C:\\reportpdf.pdf", new ContentType(MediaTypeNames.Application.Pdf));
objMailMessage.Attachments.Add(attachment);
objSmtpClient.UseDefaultCredentials = false;

View File

@ -7,6 +7,7 @@ namespace DiningRoomBusinessLogic.OfficePackage
{
public void CreateDoc(PdfInfo info)
{
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
CreatePdf(info);
CreateParagraph(new PdfParagraph { Text = info.Title, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center });
CreateParagraph(new PdfParagraph { Text = $"с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });

View File

@ -563,7 +563,7 @@ namespace DiningRoomUserApp.Controllers
}
APIClient.PostRequest("api/main/SendComponentsByDateReportToEmail", new ReportBindingModel
{
FileName = "C:\\Dax\\reportpdf.pdf",
FileName = "C:\\reportpdf.pdf",
DateFrom = dateFrom,
DateTo = dateTo,
Email = APIClient.User.Email,