2021-04-01 21:30:29 +04:00
|
|
|
|
using ModuleTools.Attributes;
|
|
|
|
|
using ModuleTools.Enums;
|
|
|
|
|
using ModuleTools.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace SecurityBusinessLogic.ViewModels
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список пользователей
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class UserRoleListViewModel : ListViewModel<UserRoleViewModel> { }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Элемент пользователей
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewModelControlElementClass()]
|
|
|
|
|
public class UserRoleViewModel : ElementViewModel
|
|
|
|
|
{
|
2021-04-02 16:06:12 +04:00
|
|
|
|
[ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")]
|
2021-04-03 16:21:16 +04:00
|
|
|
|
[MapConfiguration("UserId", AllowCopyWithoutRigth = false)]
|
2021-04-01 21:30:29 +04:00
|
|
|
|
public Guid UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
[ViewModelControlListProperty("Пользователь")]
|
|
|
|
|
[MapConfiguration("User.UserName", IsDifficle = true, AllowCopyWithoutRigth = false)]
|
|
|
|
|
public string UserName { get; set; }
|
|
|
|
|
|
2021-04-02 16:06:12 +04:00
|
|
|
|
[ViewModelControlElementProperty("Роль", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleList, SecurityWindowsDesktop")]
|
2021-04-03 16:21:16 +04:00
|
|
|
|
[MapConfiguration("RoleId", AllowCopyWithoutRigth = false)]
|
2021-04-01 21:30:29 +04:00
|
|
|
|
public Guid RoleId { get; set; }
|
|
|
|
|
|
|
|
|
|
[ViewModelControlListProperty("Роль")]
|
|
|
|
|
[MapConfiguration("Role.RoleName", IsDifficle = true, AllowCopyWithoutRigth = false)]
|
|
|
|
|
public string RoleName { get; set; }
|
|
|
|
|
|
|
|
|
|
public override string ToString() => $"{RoleName}-{UserName}";
|
|
|
|
|
}
|
|
|
|
|
}
|