DD.WellWorkover.Cloud/AsbCloudApp/Data/UserDto.cs

83 lines
1.9 KiB
C#
Raw Normal View History

namespace AsbCloudApp.Data
{
2022-06-02 12:35:51 +05:00
/// <summary>
/// DTO пользователя платформы
/// </summary>
2022-04-11 18:00:34 +05:00
public class UserDto : IId
{
2022-06-02 12:35:51 +05:00
/// <inheritdoc/>
public int Id { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// логин
/// </summary>
public string Login { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Имя
/// </summary>
public string Name { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Фамилия
/// </summary>
public string Surname { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Отчество
/// </summary>
2022-04-11 18:00:34 +05:00
public string Patronymic { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Email
/// </summary>
2022-04-11 18:00:34 +05:00
public string Email { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Phone
/// </summary>
public string Phone { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Должность
/// </summary>
public string Position { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Id компании
/// </summary>
public int? IdCompany { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// Id состояния пользователя
/// </summary>
public short? IdState { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// DTO компании
/// </summary>
public CompanyDto Company { get; set; }
2022-10-27 15:49:22 +05:00
/// <summary>
/// Получение отображаемого имени
/// </summary>
/// <returns></returns>
public string MakeDisplayName()
{
if (string.IsNullOrEmpty(Surname))
return Login;
var s = Surname;
if (!string.IsNullOrEmpty(Name))
{
s += $"{Name[0]}.";
if (!string.IsNullOrEmpty(Patronymic))
s += $" {Patronymic[0]}.";
}
return s;
}
}
}