Compare commits

...

2 Commits

Author SHA1 Message Date
111d1eee56 ПРОБЕЛ и др 2024-05-05 03:17:38 +04:00
31edfd50d0 hjk 2024-05-05 01:22:12 +04:00
5 changed files with 46 additions and 40 deletions

View File

@ -94,7 +94,12 @@ namespace AbstractLawFirmBusinessLogic.BusinessLogic
model.Status = status; model.Status = status;
if (model.Status == OrderStatus.Выдан) model.DateImplement = DateTime.Now; if (model.Status == OrderStatus.Выдан) model.DateImplement = DateTime.Now;
if (element.ImplementerId.HasValue) model.ImplementerId = element.ImplementerId; 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 }); var clientView = _clientStorage.GetElement(new() { Id = element.ClientId });
SendEmail(clientView, element); SendEmail(clientView, element);

View File

@ -52,8 +52,8 @@ messageInfoLogic) : base(logger, messageInfoLogic) { }
{ {
try try
{ {
client.Connect(_popHost, _popPort, client.CheckCertificateRevocation = false;
SecureSocketOptions.SslOnConnect); client.Connect(_popHost, _popPort, SecureSocketOptions.SslOnConnect);
client.Authenticate(_mailLogin, _mailPassword); client.Authenticate(_mailLogin, _mailPassword);
for (int i = 0; i < client.Count; i++) for (int i = 0; i < client.Count; i++)
{ {

View File

@ -142,9 +142,8 @@ namespace AbstractLawFirmClientApp.Controllers
{ {
return Redirect("~/Home/Enter"); return Redirect("~/Home/Enter");
} }
return return View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId={APIClient.Client.Id}"));
View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId={ APIClient.Client.Id}")); }
}
} }
} }

View File

@ -1,51 +1,53 @@
@using AbstractLawFirmContracts.ViewModels @using AbstractLawFirmContracts.ViewModels
@model List<MessageInfoViewModel> @model List<MessageInfoViewModel>
@{ @{
ViewData["Title"] = "Mails"; ViewData["Title"] = "Mails";
} }
<div class="text-center"> <div class="text-center">
<h1 class="display-4">Заказы</h1> <h1 class="display-4">Письма</h1>
</div> </div>
<div class="text-center"> <div class="text-center">
@{ @{
if (Model == null) if (Model == null)
{ {
<h3 class="display-4">Авторизируйтесь</h3> <h3 class="display-4">Login bobr!</h3>
return; return;
} }
<table class="table">
<thead> <table class="table">
<tr> <thead>
<th> <tr>
Дата письма <th>
</th> Дата
<th> </th>
Заголовок <th>
</th> Заголовок
<th> </th>
Текст <th>
</th> Текст
</tr> </th>
</thead> </tr>
<tbody> </thead>
<tbody>
@foreach (var item in Model) @foreach (var item in Model)
{ {
<tr> <tr>
<td> <td>
@Html.DisplayFor(modelItem => @Html.DisplayFor(modelItem => item.DateDelivery)
item.DateDelivery) </td>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.Subject)
@Html.DisplayFor(modelItem => </td>
item.Subject) <td>
</td> @Html.DisplayFor(modelItem => item.Body)
<td> </td>
@Html.DisplayFor(modelItem => </tr>
item.Body)
</td>
</tr>
} }
</tbody> </tbody>
</table> </table>
} }
</div> </div>

View File

@ -46,7 +46,7 @@ namespace LawFirmView
System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] ?? System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] ??
string.Empty, string.Empty,
SmtpClientPort = SmtpClientPort =
Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClient Port"]), Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClientPort"]),
PopHost = PopHost =
System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty, System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty,
PopPort = PopPort =