Всё работает
This commit is contained in:
parent
f11e568b69
commit
702ae6d967
@ -34,7 +34,6 @@ namespace CarRepairShop
|
||||
dataGridView.DataSource = list;
|
||||
dataGridView.Columns["RepairId"].Visible = false;
|
||||
dataGridView.Columns["ClientId"].Visible = false;
|
||||
dataGridView.Columns["ClientEmail"].Visible = false;
|
||||
dataGridView.Columns["ImplementerId"].Visible = false;
|
||||
dataGridView.Columns["RepairName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ namespace CarRepairShopContracts.ViewModels
|
||||
public int ClientId { get; set; }
|
||||
[DisplayName("Клиент")]
|
||||
public string ClientFIO { get; set; } = string.Empty;
|
||||
public string ClientEmail { get; set; } = string.Empty;
|
||||
public int? ImplementerId { get; set; } = null;
|
||||
[DisplayName("Исполнитель")]
|
||||
public string ImplementerFIO { get; set; } = string.Empty;
|
||||
|
@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CarRepairShopDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(RepairsShopDatabase))]
|
||||
[Migration("20240520225652_InitialCreate")]
|
||||
[Migration("20240521131556_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
@ -36,8 +36,7 @@ namespace CarRepairShopDatabaseImplement.Models
|
||||
{
|
||||
Body = model.Body,
|
||||
Subject = model.Subject,
|
||||
ClientId = context.Clients.FirstOrDefault(x => x.Email == model.SenderName).Id,
|
||||
Client = context.Clients.FirstOrDefault(x => x.Email == model.SenderName),
|
||||
ClientId = context.Clients.FirstOrDefault(x => x.Email == model.SenderName)?.Id,
|
||||
MessageId = model.MessageId,
|
||||
SenderName = model.SenderName,
|
||||
DateDelivery = model.DateDelivery,
|
||||
|
@ -60,7 +60,6 @@ namespace CarRepairShopDatabaseImplement.Models
|
||||
ImplementerId = ImplementerId,
|
||||
RepairName = Repair?.RepairName ?? string.Empty,
|
||||
ClientFIO = Client?.ClientFIO ?? string.Empty,
|
||||
ClientEmail = Client.Email,
|
||||
Count = Count,
|
||||
Sum = Sum,
|
||||
Status = Status,
|
||||
|
@ -39,13 +39,15 @@ namespace CarRepairShopRestApi.Controllers
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public List<MessageInfoViewModel>? GetMessages(int clientId)
|
||||
public List<MessageInfoViewModel>? GetMessages(int clientId, int page, int pagesize = 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _mailLogic.ReadList(new MessageInfoSearchModel
|
||||
{
|
||||
ClientId = clientId
|
||||
ClientId = clientId,
|
||||
PageLength = pagesize,
|
||||
PageIndex = page
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -80,23 +82,5 @@ namespace CarRepairShopRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public List<MessageInfoViewModel>? GetMessages(int clientId, int page, int pagesize = 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _mailLogic.ReadList(new MessageInfoSearchModel
|
||||
{
|
||||
ClientId = clientId,
|
||||
PageLength = pagesize,
|
||||
PageIndex = page
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка получения писем клиента");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Mails">Письма</a>
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Mails" asp-route-page="1">Письма</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Вход</a>
|
||||
|
Loading…
Reference in New Issue
Block a user