forked from ddrilling/AsbCloudServer
54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
namespace AsbCloudApp.Data.SAUB
|
|
{
|
|
#nullable enable
|
|
/// <summary>
|
|
/// Пользователь панели оператора
|
|
/// </summary>
|
|
public class TelemetryUserDto : IId
|
|
{
|
|
/// <inheritdoc/>
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Имя
|
|
/// </summary>
|
|
public string? Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// Фамилия
|
|
/// </summary>
|
|
public string Surname { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Отчество
|
|
/// </summary>
|
|
public string? Patronymic { get; set; }
|
|
|
|
/// <summary>
|
|
/// Уровень доступа
|
|
/// </summary>
|
|
public int? Level { get; set; }
|
|
|
|
/// <summary>
|
|
/// Собрать отображаемое имя пользователя
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public string MakeDisplayName()
|
|
{
|
|
if (!string.IsNullOrEmpty(Surname))
|
|
{
|
|
var s = Surname;
|
|
if (!string.IsNullOrEmpty(Name))
|
|
{
|
|
s += $"{Name[0]}.";
|
|
if (!string.IsNullOrEmpty(Patronymic))
|
|
s += $" {Patronymic[0]}.";
|
|
}
|
|
return s;
|
|
}
|
|
else
|
|
return $"User #{Id}";
|
|
}
|
|
}
|
|
}
|