forked from ddrilling/AsbCloudServer
83 lines
1.9 KiB
C#
83 lines
1.9 KiB
C#
namespace AsbCloudApp.Data
|
|
{
|
|
/// <summary>
|
|
/// DTO пользователя платформы
|
|
/// </summary>
|
|
public class UserDto : IId
|
|
{
|
|
/// <inheritdoc/>
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// логин
|
|
/// </summary>
|
|
public string Login { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// Имя
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// Фамилия
|
|
/// </summary>
|
|
public string Surname { get; set; }
|
|
|
|
/// <summary>
|
|
/// Отчество
|
|
/// </summary>
|
|
public string Patronymic { get; set; }
|
|
|
|
/// <summary>
|
|
/// Email
|
|
/// </summary>
|
|
public string Email { get; set; }
|
|
|
|
/// <summary>
|
|
/// Phone
|
|
/// </summary>
|
|
public string Phone { get; set; }
|
|
|
|
/// <summary>
|
|
/// Должность
|
|
/// </summary>
|
|
public string Position { get; set; }
|
|
|
|
/// <summary>
|
|
/// Id компании
|
|
/// </summary>
|
|
public int? IdCompany { get; set; }
|
|
|
|
/// <summary>
|
|
/// Id состояния пользователя
|
|
/// </summary>
|
|
public short? IdState { get; set; }
|
|
|
|
/// <summary>
|
|
/// DTO компании
|
|
/// </summary>
|
|
public CompanyDto Company { get; set; }
|
|
|
|
/// <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;
|
|
}
|
|
}
|
|
}
|