ПРОБЕЛ и др

This commit is contained in:
AnnaLioness 2024-05-05 03:17:38 +04:00
parent 31edfd50d0
commit 111d1eee56
5 changed files with 45 additions and 38 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,6 +52,7 @@ messageInfoLogic) : base(logger, messageInfoLogic) { }
{ {
try try
{ {
client.CheckCertificateRevocation = false;
client.Connect(_popHost, _popPort, 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,23 +1,28 @@
@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"> <table class="table">
<thead> <thead>
<tr> <tr>
<th> <th>
Дата письма Дата
</th> </th>
<th> <th>
Заголовок Заголовок
@ -32,16 +37,13 @@
{ {
<tr> <tr>
<td> <td>
@Html.DisplayFor(modelItem => @Html.DisplayFor(modelItem => item.DateDelivery)
item.DateDelivery)
</td> </td>
<td> <td>
@Html.DisplayFor(modelItem => @Html.DisplayFor(modelItem => item.Subject)
item.Subject)
</td> </td>
<td> <td>
@Html.DisplayFor(modelItem => @Html.DisplayFor(modelItem => item.Body)
item.Body)
</td> </td>
</tr> </tr>
} }

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 =