forked from ddrilling/AsbCloudServer
Доработка по модалке контактов: в список контактов должны попадать только активные пользователи
This commit is contained in:
parent
23fd77eb9d
commit
2ee10e8e70
@ -29,18 +29,21 @@ namespace AsbCloudInfrastructure.Services
|
||||
{
|
||||
Caption = c.Caption,
|
||||
Id = c.Id,
|
||||
Users = c.Users.Select(u => new UserContactDto()
|
||||
{
|
||||
Id = u.Id,
|
||||
Name = u.Name,
|
||||
Patronymic = u.Patronymic,
|
||||
Surname = u.Surname,
|
||||
Company = u.Company.Adapt<CompanyDto>(),
|
||||
Email = u.Email,
|
||||
Phone = u.Phone,
|
||||
Position = u.Position,
|
||||
IsContact = u.RelationContactsWells.Any(rel => rel.IdWell == wellId)
|
||||
})
|
||||
Users = c.Users
|
||||
.Where(u => u.IdState == 1)
|
||||
.OrderBy(u => u.Surname)
|
||||
.Select(u => new UserContactDto()
|
||||
{
|
||||
Id = u.Id,
|
||||
Name = u.Name,
|
||||
Patronymic = u.Patronymic,
|
||||
Surname = u.Surname,
|
||||
Company = u.Company.Adapt<CompanyDto>(),
|
||||
Email = u.Email,
|
||||
Phone = u.Phone,
|
||||
Position = u.Position,
|
||||
IsContact = u.RelationContactsWells.Any(rel => rel.IdWell == wellId)
|
||||
})
|
||||
});
|
||||
|
||||
var entities = await query.AsNoTracking()
|
||||
|
Loading…
Reference in New Issue
Block a user