2021-03-28 19:15:55 +04:00
|
|
|
|
using ModuleTools.Attributes;
|
|
|
|
|
using ModuleTools.ViewModels;
|
2021-03-26 20:09:52 +04:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace SecurityBusinessLogic.ViewModels
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список пользователей
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class UserListViewModel : ListViewModel<UserViewModel> { }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Элемент пользователей
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class UserViewModel : ElementViewModel
|
|
|
|
|
{
|
2021-03-27 23:50:29 +04:00
|
|
|
|
[ViewModelOnListProperty("Пользователь")]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
[MapConfiguration("UserName")]
|
|
|
|
|
public string Login { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("StudentId")]
|
|
|
|
|
public Guid? StudentId { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("LecturerId")]
|
|
|
|
|
public Guid? LecturerId { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("EmployeeId")]
|
|
|
|
|
public Guid? EmployeeId { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("Avatar")]
|
|
|
|
|
public byte[] Avatar { get; set; }
|
|
|
|
|
|
2021-03-27 23:50:29 +04:00
|
|
|
|
[ViewModelOnListProperty("Посл. визит", 100)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
[MapConfiguration("DateLastVisit")]
|
|
|
|
|
public DateTime? DateLastVisit { get; set; }
|
|
|
|
|
|
2021-03-28 20:56:32 +04:00
|
|
|
|
[MapConfiguration("IsBanned", AllowCopyWithoutRigth = false)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public bool IsBanned { get; set; }
|
|
|
|
|
|
2021-03-27 23:50:29 +04:00
|
|
|
|
[ViewModelOnListProperty("Блокир.", 80)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public string Banned => IsBanned ? "Да" : "Нет";
|
|
|
|
|
|
2021-03-28 20:56:32 +04:00
|
|
|
|
[MapConfiguration("DateBanned", AllowCopyWithoutRigth = false)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public DateTime? DateBanned { get; set; }
|
|
|
|
|
|
2021-03-27 23:50:29 +04:00
|
|
|
|
[ViewModelOnListProperty("Дата Б.", 100)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public string DateBannedTitle => DateBanned.HasValue ? DateBanned.Value.ToShortDateString() : string.Empty;
|
|
|
|
|
|
2021-03-28 20:56:32 +04:00
|
|
|
|
[MapConfiguration("CountAttempt", AllowCopyWithoutRigth = false)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public int CountAttempt { get; set; }
|
|
|
|
|
|
|
|
|
|
public override string ToString() => Login;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|