diff --git a/DiningRoom/DiningRoomBusinessLogic/MailWorker/AbstractMailWorker.cs b/DiningRoom/DiningRoomBusinessLogic/MailWorker/AbstractMailWorker.cs index 56f41fb..a6f2712 100644 --- a/DiningRoom/DiningRoomBusinessLogic/MailWorker/AbstractMailWorker.cs +++ b/DiningRoom/DiningRoomBusinessLogic/MailWorker/AbstractMailWorker.cs @@ -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); } diff --git a/DiningRoom/DiningRoomBusinessLogic/MailWorker/MailKitWorker.cs b/DiningRoom/DiningRoomBusinessLogic/MailWorker/MailKitWorker.cs index 8ff3a28..2cc3020 100644 --- a/DiningRoom/DiningRoomBusinessLogic/MailWorker/MailKitWorker.cs +++ b/DiningRoom/DiningRoomBusinessLogic/MailWorker/MailKitWorker.cs @@ -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; diff --git a/DiningRoom/DiningRoomBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/DiningRoom/DiningRoomBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index 7aed049..a9b38bb 100644 --- a/DiningRoom/DiningRoomBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/DiningRoom/DiningRoomBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -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 }); diff --git a/DiningRoom/DiningRoomUserApp/Controllers/HomeController.cs b/DiningRoom/DiningRoomUserApp/Controllers/HomeController.cs index 8c16dc8..e92fdd6 100644 --- a/DiningRoom/DiningRoomUserApp/Controllers/HomeController.cs +++ b/DiningRoom/DiningRoomUserApp/Controllers/HomeController.cs @@ -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,