From 111d1eee56f88d0089cb3cbad9a3b33b47e2071f Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Sun, 5 May 2024 03:17:38 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=A0=D0=9E=D0=91=D0=95=D0=9B=20=D0=B8?= =?UTF-8?q?=20=D0=B4=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/OrderLogic.cs | 7 +- .../MailWorker/MailKitWorker.cs | 1 + .../Controllers/HomeController.cs | 5 +- .../Views/Home/Mails.cshtml | 68 ++++++++++--------- LawFirm/LawFirmView/Program.cs | 2 +- 5 files changed, 45 insertions(+), 38 deletions(-) diff --git a/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs b/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs index 2d4adb6..200fc13 100644 --- a/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs +++ b/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs @@ -94,7 +94,12 @@ namespace AbstractLawFirmBusinessLogic.BusinessLogic model.Status = status; if (model.Status == OrderStatus.Выдан) model.DateImplement = DateTime.Now; if (element.ImplementerId.HasValue) model.ImplementerId = element.ImplementerId; - _orderStorage.Update(model); + element = _orderStorage.Update(model); + if(element == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } var clientView = _clientStorage.GetElement(new() { Id = element.ClientId }); SendEmail(clientView, element); diff --git a/LawFirm/AbstractLawFirmBusinessLogic/MailWorker/MailKitWorker.cs b/LawFirm/AbstractLawFirmBusinessLogic/MailWorker/MailKitWorker.cs index 39c4707..29b98fe 100644 --- a/LawFirm/AbstractLawFirmBusinessLogic/MailWorker/MailKitWorker.cs +++ b/LawFirm/AbstractLawFirmBusinessLogic/MailWorker/MailKitWorker.cs @@ -52,6 +52,7 @@ messageInfoLogic) : base(logger, messageInfoLogic) { } { try { + client.CheckCertificateRevocation = false; client.Connect(_popHost, _popPort, SecureSocketOptions.SslOnConnect); client.Authenticate(_mailLogin, _mailPassword); for (int i = 0; i < client.Count; i++) diff --git a/LawFirm/AbstractLawFirmClientApp/Controllers/HomeController.cs b/LawFirm/AbstractLawFirmClientApp/Controllers/HomeController.cs index 2c0da6b..1705b86 100644 --- a/LawFirm/AbstractLawFirmClientApp/Controllers/HomeController.cs +++ b/LawFirm/AbstractLawFirmClientApp/Controllers/HomeController.cs @@ -142,9 +142,8 @@ namespace AbstractLawFirmClientApp.Controllers { return Redirect("~/Home/Enter"); } - return - View(APIClient.GetRequest>($"api/client/getmessages?clientId={ APIClient.Client.Id}")); -} + return View(APIClient.GetRequest>($"api/client/getmessages?clientId={APIClient.Client.Id}")); + } } } \ No newline at end of file diff --git a/LawFirm/AbstractLawFirmClientApp/Views/Home/Mails.cshtml b/LawFirm/AbstractLawFirmClientApp/Views/Home/Mails.cshtml index 7b340d4..5f39b0c 100644 --- a/LawFirm/AbstractLawFirmClientApp/Views/Home/Mails.cshtml +++ b/LawFirm/AbstractLawFirmClientApp/Views/Home/Mails.cshtml @@ -1,51 +1,53 @@ @using AbstractLawFirmContracts.ViewModels @model List + @{ ViewData["Title"] = "Mails"; } +
-

Заказы

+

Письма

+ +
@{ if (Model == null) { -

Авторизируйтесь

+

Login bobr!

return; } - - - - - - - - - + +
- Дата письма - - Заголовок - - Текст -
+ + + + + + + + @foreach (var item in Model) { - - - - - + + + + + } - -
+ Дата + + Заголовок + + Текст +
- @Html.DisplayFor(modelItem => -item.DateDelivery) - - @Html.DisplayFor(modelItem => -item.Subject) - - @Html.DisplayFor(modelItem => -item.Body) -
+ @Html.DisplayFor(modelItem => item.DateDelivery) + + @Html.DisplayFor(modelItem => item.Subject) + + @Html.DisplayFor(modelItem => item.Body) +
+ + }
diff --git a/LawFirm/LawFirmView/Program.cs b/LawFirm/LawFirmView/Program.cs index e41d640..7accec2 100644 --- a/LawFirm/LawFirmView/Program.cs +++ b/LawFirm/LawFirmView/Program.cs @@ -46,7 +46,7 @@ namespace LawFirmView System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] ?? string.Empty, SmtpClientPort = - Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClient Port"]), + Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClientPort"]), PopHost = System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty, PopPort =