37 lines
1.6 KiB
C#
37 lines
1.6 KiB
C#
|
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
|
|||
|
{
|
|||
|
[MapConfiguration("UserId", AllowCopyWithoutRigth = false)]
|
|||
|
[ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.Controls.ControlUserList, SecurityWindowsDesktop")]
|
|||
|
public Guid UserId { get; set; }
|
|||
|
|
|||
|
[ViewModelControlListProperty("Пользователь")]
|
|||
|
[MapConfiguration("User.UserName", IsDifficle = true, AllowCopyWithoutRigth = false)]
|
|||
|
public string UserName { get; set; }
|
|||
|
|
|||
|
[MapConfiguration("RoleId", AllowCopyWithoutRigth = false)]
|
|||
|
[ViewModelControlElementProperty("Роль", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.Controls.ControlRoleList, SecurityWindowsDesktop")]
|
|||
|
public Guid RoleId { get; set; }
|
|||
|
|
|||
|
[ViewModelControlListProperty("Роль")]
|
|||
|
[MapConfiguration("Role.RoleName", IsDifficle = true, AllowCopyWithoutRigth = false)]
|
|||
|
public string RoleName { get; set; }
|
|||
|
|
|||
|
public override string ToString() => $"{RoleName}-{UserName}";
|
|||
|
}
|
|||
|
}
|