ПРОБЕЛ и др

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;
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);

View File

@ -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++)

View File

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

View File

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

View File

@ -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 =