2022-12-21 18:00:52 +05:00
|
|
|
|
namespace AsbCloudApp.Data.SAUB
|
2021-04-23 10:21:25 +05:00
|
|
|
|
{
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Пользователь панели оператора
|
|
|
|
|
/// </summary>
|
2021-09-09 12:31:12 +05:00
|
|
|
|
public class TelemetryUserDto : IId
|
2021-04-23 10:21:25 +05:00
|
|
|
|
{
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <inheritdoc/>
|
2021-04-23 10:21:25 +05:00
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Имя
|
|
|
|
|
/// </summary>
|
2023-02-20 15:06:26 +05:00
|
|
|
|
public string? Name { get; set; }
|
2021-04-23 10:21:25 +05:00
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Фамилия
|
|
|
|
|
/// </summary>
|
2023-02-20 15:06:26 +05:00
|
|
|
|
public string Surname { get; set; } = null!;
|
2021-04-23 10:21:25 +05:00
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Отчество
|
|
|
|
|
/// </summary>
|
2023-02-20 15:06:26 +05:00
|
|
|
|
public string? Patronymic { get; set; }
|
2021-04-23 10:21:25 +05:00
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Уровень доступа
|
|
|
|
|
/// </summary>
|
2023-02-20 15:06:26 +05:00
|
|
|
|
public int? Level { get; set; }
|
2022-11-18 12:58:53 +05:00
|
|
|
|
|
|
|
|
|
/// <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}";
|
|
|
|
|
}
|
2021-04-23 10:21:25 +05:00
|
|
|
|
}
|
|
|
|
|
}
|